make previous sw question configurable
This commit is contained in:
@@ -706,6 +706,16 @@ function booking_admin() {
|
||||
),
|
||||
'#default_value' => variable_get('booking_enable_previous_studyweeks', 0)
|
||||
);
|
||||
$form['regn_options']['booking_require_previous_sw'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Require attendees to select number of previous study weeks?'),
|
||||
'#description' => t('Select whether to require attendees to choose the number of study weeks they previously attended. Doesn\'t have any effect if previous studyweek question is not enabled above.'),
|
||||
'#options' => array(
|
||||
0 => t('No'),
|
||||
t('Yes')
|
||||
),
|
||||
'#default_value' => variable_get('booking_require_previous_sw', 0)
|
||||
);
|
||||
$form['management'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'Data Management Options',
|
||||
|
@@ -961,10 +961,11 @@ function booking_form($node, &$form_state, $inserting = FALSE)
|
||||
);
|
||||
}
|
||||
if (variable_get('booking_enable_previous_studyweeks', 0) == 1) {
|
||||
$prev_sw_required_check = (variable_get('booking_require_previous_sw', 1) == 1) && $inserting;
|
||||
$form['misc-areas']['booking_prev_sw_count'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t("How many Study Weeks have you been to previously?"),
|
||||
'#required' => FALSE,
|
||||
'#required' => $prev_sw_required_check,
|
||||
'#default_value' => variable_get('booking_prev_sw_count', empty($data->booking_prev_sw_count) ? '' : $data->booking_prev_sw_count),
|
||||
'#options' => _get_previous_sw_options(),
|
||||
);
|
||||
|
Reference in New Issue
Block a user