Added logging to travel form
This commit is contained in:
@@ -431,7 +431,6 @@ function _booking_rooms_cleanup($nid)
|
|||||||
{
|
{
|
||||||
global $event;
|
global $event;
|
||||||
|
|
||||||
|
|
||||||
//first of all make sure we need to do anything
|
//first of all make sure we need to do anything
|
||||||
if (variable_get('booking_enable_roomallocations', 0) == 1)
|
if (variable_get('booking_enable_roomallocations', 0) == 1)
|
||||||
{
|
{
|
||||||
|
@@ -1346,6 +1346,9 @@ function _booking_update($node) {
|
|||||||
//Remove from any study groups
|
//Remove from any study groups
|
||||||
_booking_studygroups_cleanup($node->nid);
|
_booking_studygroups_cleanup($node->nid);
|
||||||
|
|
||||||
|
//Remove from any rooms allocated
|
||||||
|
_booking_rooms_cleanup($node->nid);
|
||||||
|
|
||||||
//check if there is room on the booked-in list
|
//check if there is room on the booked-in list
|
||||||
if (_booking_check_bookings_full() == False)
|
if (_booking_check_bookings_full() == False)
|
||||||
{
|
{
|
||||||
@@ -1558,24 +1561,7 @@ function booking_view($node, $view_mode) {
|
|||||||
|
|
||||||
//now populate the table
|
//now populate the table
|
||||||
$rows[] = array(t('Date/Time registered:'), t('!timestamp', array('!timestamp' => format_date($node->booking_timestamp, 'custom', 'd/m/Y H:i'))));
|
$rows[] = array(t('Date/Time registered:'), t('!timestamp', array('!timestamp' => format_date($node->booking_timestamp, 'custom', 'd/m/Y H:i'))));
|
||||||
$rows[] = array(t('Name:'), t('!first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)));
|
$rows[] = arra t('!amount_paid', array('!amount_paid' => $payment_type)));
|
||||||
$rows[] = array(t('Gender:'), t('!gender', array('!gender' => $node->booking_gender == 'M' ? 'Male' : 'Female')));
|
|
||||||
$rows[] = array(t('Status:'), t('!status', array('!status' => _booking_status_generate($node->booking_status))));
|
|
||||||
$rows[] = array(t('Committee Member:'), t('!ans', array('!ans' => ($node->booking_committee_member == 'Y' ? '<b>Yes</b>' : 'No'))));
|
|
||||||
$rows[] = array(t('Welfare Required:'), $node->booking_welfare_required == 'Y' ? 'Yes' : 'No');
|
|
||||||
$rows[] = array(t('Barcode:'), t('!id', array('!id' => $node->booking_barcode)));
|
|
||||||
$rows[] = array(t('Date of birth:'), t('!dob', array('!dob' => format_date($node->booking_dob, 'custom', 'd/m/Y'))));
|
|
||||||
$rows[] = array(t('Email address:'), t('!email', array('!email' => $node->booking_email)));
|
|
||||||
|
|
||||||
if (variable_get('booking_enable_passport', 1) == 1)
|
|
||||||
{
|
|
||||||
$rows[] = array(t('Passport Number:'), $node->booking_passport_num);
|
|
||||||
$rows[] = array(t('Passport Expiry:'), t('!timestamp', array('!timestamp' => _booking_convert_ts($node->booking_passport_expiry_date)->format('d/m/Y'))));
|
|
||||||
$rows[] = array(t('Passport Exact Issued Name:'), $node->booking_passport_issue_name);
|
|
||||||
$rows[] = array(t('Passport Issue Location:'), $node->booking_passport_issue_location);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type)));
|
|
||||||
$rows[] = array(t('Amount Paid:'), t('!amount_paid', array('!amount_paid' => $node->booking_amount_paid)));
|
$rows[] = array(t('Amount Paid:'), t('!amount_paid', array('!amount_paid' => $node->booking_amount_paid)));
|
||||||
$rows[] = array(t('Total Amount Due:'), t('!amount_paid', array('!amount_paid' => $node->booking_total_pay_reqd)));
|
$rows[] = array(t('Total Amount Due:'), t('!amount_paid', array('!amount_paid' => $node->booking_total_pay_reqd)));
|
||||||
$rows[] = array(t('Refund Due:'), t('!amount_due', array('!amount_due' => $node->booking_refund_due)));
|
$rows[] = array(t('Refund Due:'), t('!amount_due', array('!amount_due' => $node->booking_refund_due)));
|
||||||
|
@@ -312,6 +312,7 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
t('You have entered an invalid registration id for your boyfriend/girlfriend. Please ensure you are using only the registration reference number your boyfriend/girlfriend received via email. If you believe this to be incorrect, please !contact using the details provided.',
|
t('You have entered an invalid registration id for your boyfriend/girlfriend. Please ensure you are using only the registration reference number your boyfriend/girlfriend received via email. If you believe this to be incorrect, please !contact using the details provided.',
|
||||||
array('!contact' => l('contact us', 'contact')))
|
array('!contact' => l('contact us', 'contact')))
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form non-numeric bf/gf\n@info</pre>", array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//don't allow them to specify their own node id
|
//don't allow them to specify their own node id
|
||||||
@@ -320,6 +321,7 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
form_set_error('booking_bf_gf_nid',
|
form_set_error('booking_bf_gf_nid',
|
||||||
t('You have entered your own registration id. Please ensure you enter only the registration reference number your boyfriend/girlfriend received via email when registering, not your own registration id.')
|
t('You have entered your own registration id. Please ensure you enter only the registration reference number your boyfriend/girlfriend received via email when registering, not your own registration id.')
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form bf/gf same as person id\n@info</pre>", array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//check that the partner exists
|
//check that the partner exists
|
||||||
@@ -334,6 +336,7 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
t('We cannot find a matching registration id for your boyfriend/girlfriend. Please ensure you are using only the number that relates to their registration. If you believe this to be incorrect, please !contact using the details provided.',
|
t('We cannot find a matching registration id for your boyfriend/girlfriend. Please ensure you are using only the number that relates to their registration. If you believe this to be incorrect, please !contact using the details provided.',
|
||||||
array('!contact' => l('contact us', 'contact')))
|
array('!contact' => l('contact us', 'contact')))
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form unknown bf/gf id\n@info</pre>", array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,6 +348,8 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
form_set_error('booking_flightnum_inbound',
|
form_set_error('booking_flightnum_inbound',
|
||||||
t('Please enter the flight number associated with your arrival flight.')
|
t('Please enter the flight number associated with your arrival flight.')
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form missing flight number for arrival flight\n@info</pre>",
|
||||||
|
array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -358,6 +363,7 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
form_set_error('booking_flight_datetime_inbound',
|
form_set_error('booking_flight_datetime_inbound',
|
||||||
t('Please enter the arrival time associated with your flight.')
|
t('Please enter the arrival time associated with your flight.')
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form missing flight arrival time\n@info</pre>", array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (! isset($form_state['values']['booking_flightnum_outbound'])) || ($form_state['values']['booking_flightnum_outbound'] == '') )
|
if ( (! isset($form_state['values']['booking_flightnum_outbound'])) || ($form_state['values']['booking_flightnum_outbound'] == '') )
|
||||||
@@ -365,6 +371,8 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
form_set_error('booking_flightnum_outbound',
|
form_set_error('booking_flightnum_outbound',
|
||||||
t('Please enter the flight number associated with your departing flight.')
|
t('Please enter the flight number associated with your departing flight.')
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form missing flight number for departing flight\n@info</pre>",
|
||||||
|
array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -378,6 +386,7 @@ function travel_form_validate($form, &$form_state) {
|
|||||||
form_set_error('booking_flight_datetime_outbound',
|
form_set_error('booking_flight_datetime_outbound',
|
||||||
t('Please enter the departure time associated with your flight.')
|
t('Please enter the departure time associated with your flight.')
|
||||||
);
|
);
|
||||||
|
watchdog('booking', "<pre>Travel form missing flight departure time\n@info</pre>", array('@info' => print_r( $form_state['values'], true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user