reorganise functions into appropriate files

This commit is contained in:
2016-06-18 14:04:38 +10:00
parent 1e912f526c
commit ee350ed26b
3 changed files with 69 additions and 148 deletions

View File

@@ -301,6 +301,7 @@ function booking_manual_email_form($form, &$form_state)
$email_options_array['travelcomplete'] = 'Travel Form Complete Email';
$preselection_options['---'] = "---";
$preselection_options['bookedin'] = 'People who are booked-in';
$preselection_options['waitinglist'] = 'People on waiting list';
$preselection_options['unpaid'] = 'People booked-in with outstanding balance';
$preselection_options['notravelform'] = "People booked-in no travel form received";
$preselection_options['notravelforminclwaiting'] = "People booked-in/waiting no travel form received";
@@ -555,6 +556,11 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
$defaults[] = $person->nid;
}
break;
case 'waitinglist':
if ($person->booking_status == 2) {
$defaults[] = $person->nid;
}
break;
case 'unpaid':
if ($person->booking_payment_complete == 'N' && $person->booking_status == 1) {
$defaults[] = $person->nid;
@@ -572,9 +578,11 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
break;
case 'leaderhelper':
foreach ($person as $key => $value) {
if (preg_match('/^session(\d+)_role/', $key, $matches) &&
$value > 0) {
$defaults[] = $person->nid;
if (preg_match('/^session(\d+)_role/', $key, $matches) && $value > 0) {
//don't add the person multiple times if they're leading/helping multiple groups
if (! in_array($person->nid, $defaults)) {
$defaults[] = $person->nid;
}
}
}
break;