From 26e4b868bef2c48dd24088fdbb145cbb2a7715fb Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Thu, 29 May 2014 22:37:03 +1000 Subject: [PATCH] Added logging to travel form --- booking.helper.inc | 1 - booking.register.inc | 22 ++++------------------ booking.travel.inc | 23 ++++++++++++++++------- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/booking.helper.inc b/booking.helper.inc index 54cd5d0..28afcd8 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -431,7 +431,6 @@ function _booking_rooms_cleanup($nid) { global $event; - //first of all make sure we need to do anything if (variable_get('booking_enable_roomallocations', 0) == 1) { diff --git a/booking.register.inc b/booking.register.inc index c3a3e61..d878e96 100644 --- a/booking.register.inc +++ b/booking.register.inc @@ -1345,6 +1345,9 @@ function _booking_update($node) { //Remove from any study groups _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 if (_booking_check_bookings_full() == False) @@ -1558,24 +1561,7 @@ function booking_view($node, $view_mode) { //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('Name:'), t('!first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname))); - $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' ? 'Yes' : '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[] = arra 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('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))); diff --git a/booking.travel.inc b/booking.travel.inc index 3d00278..19d3ca1 100644 --- a/booking.travel.inc +++ b/booking.travel.inc @@ -311,7 +311,8 @@ function travel_form_validate($form, &$form_state) { form_set_error('booking_bf_gf_nid', 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'))) - ); + ); + watchdog('booking', "
Travel form non-numeric bf/gf\n@info
", array('@info' => print_r( $form_state['values'], true))); } //don't allow them to specify their own node id @@ -319,7 +320,8 @@ function travel_form_validate($form, &$form_state) { { 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.') - ); + ); + watchdog('booking', "
Travel form bf/gf same as person id\n@info
", array('@info' => print_r( $form_state['values'], true))); } //check that the partner exists @@ -333,7 +335,8 @@ function travel_form_validate($form, &$form_state) { form_set_error('booking_bf_gf_nid', 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'))) - ); + ); + watchdog('booking', "
Travel form unknown bf/gf id\n@info
", array('@info' => print_r( $form_state['values'], true))); } } @@ -344,7 +347,9 @@ function travel_form_validate($form, &$form_state) { { form_set_error('booking_flightnum_inbound', t('Please enter the flight number associated with your arrival flight.') - ); + ); + watchdog('booking', "
Travel form missing flight number for arrival flight\n@info
", + array('@info' => print_r( $form_state['values'], true))); } if ( @@ -357,14 +362,17 @@ function travel_form_validate($form, &$form_state) { { form_set_error('booking_flight_datetime_inbound', t('Please enter the arrival time associated with your flight.') - ); + ); + watchdog('booking', "
Travel form missing flight arrival time\n@info
", array('@info' => print_r( $form_state['values'], true))); } if ( (! isset($form_state['values']['booking_flightnum_outbound'])) || ($form_state['values']['booking_flightnum_outbound'] == '') ) { form_set_error('booking_flightnum_outbound', t('Please enter the flight number associated with your departing flight.') - ); + ); + watchdog('booking', "
Travel form missing flight number for departing flight\n@info
", + array('@info' => print_r( $form_state['values'], true))); } if ( @@ -377,7 +385,8 @@ function travel_form_validate($form, &$form_state) { { form_set_error('booking_flight_datetime_outbound', t('Please enter the departure time associated with your flight.') - ); + ); + watchdog('booking', "
Travel form missing flight departure time\n@info
", array('@info' => print_r( $form_state['values'], true))); } }