make previous sw question configurable

This commit is contained in:
Nathan Coad
2019-09-15 09:18:53 +10:00
parent 7eb77b042f
commit 4ce3df3339
2 changed files with 12 additions and 1 deletions

View File

@@ -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(),
);