Configuration option for enabling dietary requirement specification
This commit is contained in:
@@ -181,8 +181,19 @@ function booking_admin() {
|
|||||||
'#options' => array (0 => t('No'), t('Yes')),
|
'#options' => array (0 => t('No'), t('Yes')),
|
||||||
'#default_value' => variable_get('booking_enable_roommate', 0),
|
'#default_value' => variable_get('booking_enable_roommate', 0),
|
||||||
);
|
);
|
||||||
|
$form['misc']['booking_enable_dietary'] = array (
|
||||||
|
'#type' => 'radios',
|
||||||
|
'#title' => t('Allow attendee to specify dietary requirements?'),
|
||||||
|
'#description' => t('If set to No, the following text definition will be used instead.'),
|
||||||
|
'#options' => array (0 => t('No'), t('Yes')),
|
||||||
|
'#default_value' => variable_get('booking_enable_dietary', 0),
|
||||||
|
);
|
||||||
|
$form['misc']['booking_dietary_text_definition'] = array (
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Dietary Requirements Text Definition'),
|
||||||
|
'#default_value' => variable_get('booking_dietary_text_definition', ''),
|
||||||
|
'#description' => 'Text to use if attendee cannot specify dietary requirements',
|
||||||
|
);
|
||||||
|
|
||||||
return system_settings_form($form);
|
return system_settings_form($form);
|
||||||
}
|
}
|
||||||
|
@@ -647,30 +647,33 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
|||||||
'#default_value' => (!empty($data->booking_dietary) && $data->booking_dietary == 'Y') ? 1 : 0
|
'#default_value' => (!empty($data->booking_dietary) && $data->booking_dietary == 'Y') ? 1 : 0
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
if (variable_get('booking_enable_dietary', 0) == 1)
|
||||||
$form['misc-areas']['booking_dietary'] = array(
|
{
|
||||||
'#type' => 'textfield',
|
$form['misc-areas']['booking_dietary'] = array(
|
||||||
'#title' => t('Please describe your dietary requirements.'),
|
'#type' => 'textfield',
|
||||||
'#maxlength' => 120,
|
'#title' => t('Please describe your dietary requirements.'),
|
||||||
'#required' => FALSE,
|
'#maxlength' => 120,
|
||||||
'#states' => array(
|
'#required' => FALSE,
|
||||||
'visible' => array(
|
'#states' => array(
|
||||||
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
|
'visible' => array(
|
||||||
|
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
||||||
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
);
|
||||||
);
|
}
|
||||||
*/
|
else
|
||||||
|
{
|
||||||
$form['misc-areas']['booking_dietary'] = array(
|
$form['misc-areas']['booking_dietary'] = array(
|
||||||
'#type' => 'container',
|
'#type' => 'container',
|
||||||
'#children' => t('Please send an email to bookings@studyweek.net describing your dietary requirements.'),
|
'#children' => variable_get('booking_dietary_text_definition', "Please contact us to specify your dietary requirements."),
|
||||||
'#states' => array(
|
'#states' => array(
|
||||||
'visible' => array(
|
'visible' => array(
|
||||||
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
|
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
|
||||||
$form['misc-areas']['booking_medical_conditions_check'] = array(
|
$form['misc-areas']['booking_medical_conditions_check'] = array(
|
||||||
|
@@ -23,7 +23,7 @@ function booking_available_leadhelp_select_form() {
|
|||||||
//select all the study groups for this event id
|
//select all the study groups for this event id
|
||||||
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", array(':eid' => $event->eid));
|
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", array(':eid' => $event->eid));
|
||||||
$studygroups = $studygroups_query->fetchAllAssoc('sid');
|
$studygroups = $studygroups_query->fetchAllAssoc('sid');
|
||||||
$group_options[0] = '';
|
//$group_options[0] = '';
|
||||||
foreach ($studygroups as $group)
|
foreach ($studygroups as $group)
|
||||||
$group_options[$group->sid] = $group->booking_studygroup_descrip;
|
$group_options[$group->sid] = $group->booking_studygroup_descrip;
|
||||||
|
|
||||||
@@ -45,17 +45,16 @@ function booking_available_leadhelp_select_form() {
|
|||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#title' => t('Select which Study Group to process'),
|
'#title' => t('Select which Study Group to process'),
|
||||||
'#required' => TRUE,
|
'#required' => TRUE,
|
||||||
'#default_value' => '0',
|
|
||||||
'#options' => $group_options,
|
'#options' => $group_options,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$header = array (
|
$header = array (
|
||||||
'booking_nid' => array('data' => t('Booking ID'), 'field' => 'nid'),
|
//'booking_nid' => array('data' => t('Booking ID'), 'field' => 'nid'),
|
||||||
'booking_name' => array('data' => t('Name'), 'field' => 'booking_lastname'),
|
'booking_name' => array('data' => t('Name'), 'field' => 'booking_lastname'),
|
||||||
//'booking_gender' => array('data' => t('Gender')),
|
//'booking_gender' => array('data' => t('Gender')),
|
||||||
'booking_baptised' => array('data' => t('Baptised?'), 'field' => 'booking_baptised'),
|
'booking_baptised' => array('data' => t('Baptised?'), 'field' => 'booking_baptised'),
|
||||||
'booking_age' => array('data' => t('Age at week'), 'field' => 'booking_dob', 'sort' => 'asc'),
|
'booking_age' => array('data' => t('Age (start of week)'), 'field' => 'booking_dob', 'sort' => 'asc'),
|
||||||
'booking_state' => array('data' => t('State'), 'field' => 'booking_state'),
|
'booking_state' => array('data' => t('State'), 'field' => 'booking_state'),
|
||||||
//'booking_assign_leader_group' => array('data' => t('Assign leader group')),
|
//'booking_assign_leader_group' => array('data' => t('Assign leader group')),
|
||||||
'booking_assign_leader_session' => array('data' => t('Leader Session')),
|
'booking_assign_leader_session' => array('data' => t('Leader Session')),
|
||||||
@@ -96,8 +95,8 @@ function booking_available_leadhelp_select_form() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$options[$data->nid] = array (
|
$options[$data->nid] = array (
|
||||||
'booking_nid' => l(t('!id', array('!id' => $data->nid)), t('node/!id', array('!id' => $data->nid))),
|
//'booking_nid' => l(t('!id', array('!id' => $data->nid)), t('node/!id', array('!id' => $data->nid))),
|
||||||
'booking_name' => $data->booking_firstname . " " . $data->booking_lastname,
|
'booking_name' => l(t($data->booking_firstname . " " . $data->booking_lastname), t('node/!id', array('!id' => $data->nid))),
|
||||||
//'booking_gender' => $data->booking_gender == 'M' ? 'Male' : 'Female',
|
//'booking_gender' => $data->booking_gender == 'M' ? 'Male' : 'Female',
|
||||||
'booking_baptised' => $data->booking_baptised == 'Y' ? 'Yes' : 'No',
|
'booking_baptised' => $data->booking_baptised == 'Y' ? 'Yes' : 'No',
|
||||||
'booking_age' => _booking_avg_age($data->booking_dob, 1, $event->booking_event_start),
|
'booking_age' => _booking_avg_age($data->booking_dob, 1, $event->booking_event_start),
|
||||||
@@ -118,7 +117,7 @@ function booking_available_leadhelp_select_form() {
|
|||||||
*/
|
*/
|
||||||
'booking_assign_leader_session' => array('data' => array(
|
'booking_assign_leader_session' => array('data' => array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#default_value' => 0,
|
//'#default_value' => 0,
|
||||||
'#options' => $session_options,
|
'#options' => $session_options,
|
||||||
'#name' => 'booking_assign_leader_session[' . $data->nid . ']',
|
'#name' => 'booking_assign_leader_session[' . $data->nid . ']',
|
||||||
)
|
)
|
||||||
@@ -134,7 +133,7 @@ function booking_available_leadhelp_select_form() {
|
|||||||
*/
|
*/
|
||||||
'booking_assign_helper_session' => array('data' => array(
|
'booking_assign_helper_session' => array('data' => array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#default_value' => 0,
|
//'#default_value' => 0,
|
||||||
'#options' => $session_options,
|
'#options' => $session_options,
|
||||||
'#name' => 'booking_assign_helper_session[' . $data->nid . ']',
|
'#name' => 'booking_assign_helper_session[' . $data->nid . ']',
|
||||||
)
|
)
|
||||||
@@ -289,21 +288,11 @@ function booking_available_leadhelp_select_form_submit($form, &$form_state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$counter++;
|
$counter++;
|
||||||
|
|
||||||
/*
|
|
||||||
$person = db_query("SELECT m.booking_node_id " .
|
|
||||||
"FROM {booking_studygroup_mapping} m " .
|
|
||||||
"WHERE booking_node_id = :nid AND booking_eventid = :eid AND booking_studygroup_id = :sid",
|
|
||||||
array(':nid' => $key, ':eid' => $event->eid, ':sid' = > $value))
|
|
||||||
->fetchObject();
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
drupal_set_message("Defined leader/helper numbers for $counter people.", 'status', FALSE);
|
|
||||||
watchdog('booking', "Defined leader/helper numbers for $counter people.");
|
$message = t("Defined !num leader/helper sessions for group id !id", array('!num' => $counter, '!id' => $booking_studygroup));
|
||||||
|
drupal_set_message($message, 'status', FALSE);
|
||||||
|
watchdog('booking', $message);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user