From a283320925e0a1e7594a58faa2bccc158ac1563b Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sun, 17 Jan 2016 19:10:42 +1100 Subject: [PATCH] Add new include for study group leaders/helpers calculations --- booking.admin.inc | 2 +- booking.helper.inc | 2 +- booking.module | 9 ++++++++- booking.regn_form.inc | 8 ++++---- booking.regn_node.inc | 2 +- booking.studygroup_leaders.inc | 16 ++++++++++++++++ 6 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 booking.studygroup_leaders.inc diff --git a/booking.admin.inc b/booking.admin.inc index b795f3c..e1b4836 100644 --- a/booking.admin.inc +++ b/booking.admin.inc @@ -269,7 +269,7 @@ function booking_admin() { $form['regn_options']['booking_default_state'] = array ( '#type' => 'select', '#title' => t('Select Default State'), - '#description' => t('Select default state for residential address.'), + '#description' => t('Select default state for residential address. Select the last value (blank) in most cases, to ensure attendees choose a value for this field'), '#options' => _booking_state_options(), '#default_value' => variable_get('booking_default_state', 'NSW'), ); diff --git a/booking.helper.inc b/booking.helper.inc index a0f167f..18f0a5d 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -839,7 +839,7 @@ function _booking_add_paypal_fees($amount, $country) $percentage = (float) variable_get('booking_paypal_transaction_fee_percentage', '2.6'); } else { $percentage = (float) variable_get('booking_paypal_transaction_fee_percentage_intl', '3.6'); - watchdog('booking', "Calculating paypal fees for a currency conversion transaction which adds $percentage percent."); + //watchdog('booking', "Calculating paypal fees for a currency conversion transaction which adds $percentage percent."); } //apply the percentage diff --git a/booking.module b/booking.module index 8ad13ff..934a9fa 100644 --- a/booking.module +++ b/booking.module @@ -62,6 +62,7 @@ module_load_include('inc', 'booking', 'booking.variety'); module_load_include('inc', 'booking', 'booking.studygroups'); // Load the include for study group definitions module_load_include('inc', 'booking', 'booking.studygroups_admin'); +module_load_include('inc', 'booking', 'booking.studygroup_leaders'); // Load the include for the travel form module_load_include('inc', 'booking', 'booking.travel'); // Load the include for managing room bookings and definitions @@ -457,7 +458,13 @@ function booking_menu() { 'type' => MENU_NORMAL_ITEM, ); - + $items['admin/booking/studygroups/calculateleaders'] = array( + 'title' => 'Calculate Study Group Leaders', + 'description' => 'Calculate Study Group Leaders and Helpers', + 'page callback' => 'booking_studygroups_leaders_calculate', + 'access arguments' => array("edit study groups"), + //'type' => MENU_NORMAL_ITEM, + ); $items['admin/booking/studygroups/%/view'] = array( 'title' => 'View Study Group', diff --git a/booking.regn_form.inc b/booking.regn_form.inc index dae9ef4..3095db1 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -1172,17 +1172,17 @@ function _booking_validate($node, &$form_state) { t('You have entered an invalid medicare number. Please check your medicare card and re-enter the number. If you believe this to be incorrect, please !contact.', array('!contact' => l('send us an email', 'mailto:' . variable_get('booking_contact_email') . '?subject=Invalid Medicare Number')) ) - ); - } + ); + } elseif ( (variable_get('booking_enforce_medicare_verification', 1) == 0) && (! _valid_medicare_number($form_state['booking_medicare'])) ) { drupal_set_message( t('You have entered an invalid medicare number. Please ensure you check your medicare card and send us the correct information via !contact.', array('!contact' => l('email', 'mailto:' . variable_get('booking_contact_email') . '?subject=Invalid Medicare Number')) - ), + ), 'error', FALSE ); - } + } } //verify state information with the new few checks diff --git a/booking.regn_node.inc b/booking.regn_node.inc index 3028d17..dcaca55 100644 --- a/booking.regn_node.inc +++ b/booking.regn_node.inc @@ -642,7 +642,7 @@ function booking_view($node, $view_mode) { $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('Internal comments on this registration:'), $node->booking_comment_field); + $rows[] = array(t('Internal comments on this registration:'), t('!comment', array('!comment' => $node->booking_comment_field))); $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))); diff --git a/booking.studygroup_leaders.inc b/booking.studygroup_leaders.inc new file mode 100644 index 0000000..3d820cd --- /dev/null +++ b/booking.studygroup_leaders.inc @@ -0,0 +1,16 @@ +