add preselection for leaders/helpers

This commit is contained in:
Nathan Coad
2016-06-08 15:36:20 +10:00
parent f23c896a12
commit 67112c71b4

View File

@@ -304,6 +304,7 @@ function booking_manual_email_form($form, &$form_state)
$preselection_options['unpaid'] = 'People booked-in with outstanding balance'; $preselection_options['unpaid'] = 'People booked-in with outstanding balance';
$preselection_options['notravelform'] = "People booked-in no travel form received"; $preselection_options['notravelform'] = "People booked-in no travel form received";
$preselection_options['notravelforminclwaiting'] = "People booked-in/waiting no travel form received"; $preselection_options['notravelforminclwaiting'] = "People booked-in/waiting no travel form received";
$preselection_options['leaderhelper'] = "Leaders/Helpers";
$preselection_options['test'] = 'Testing'; $preselection_options['test'] = 'Testing';
$header = array( $header = array(
@@ -568,7 +569,15 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
if (($person->booking_status == 1 || $person->booking_status == 2) && $person->tid == 0) { if (($person->booking_status == 1 || $person->booking_status == 2) && $person->tid == 0) {
$defaults[] = $person->nid; $defaults[] = $person->nid;
} }
break; break;
case 'leaderhelper':
foreach ($person as $key => $value) {
if (preg_match('/^session(\d+)_role/', $key, $matches) &&
$value > 0) {
$defaults[] = $person->nid;
}
}
break;
case 'test': case 'test':
if ($person->booking_lastname == 'Coad') { if ($person->booking_lastname == 'Coad') {
$defaults[] = $person->nid; $defaults[] = $person->nid;