Medical conditions section on regn form is now more flexible
This commit is contained in:
@@ -332,7 +332,7 @@ function booking_admin() {
|
|||||||
'#options' => _booking_get_help_areas(),
|
'#options' => _booking_get_help_areas(),
|
||||||
'#default_value' => variable_get('booking_enabled_helparea_options', ''),
|
'#default_value' => variable_get('booking_enabled_helparea_options', ''),
|
||||||
'#states' => array(
|
'#states' => array(
|
||||||
// Only show this field when the 'booking_enable_helpareas' checkbox is enabled.
|
// Only show this field when the 'booking_enable_helpareas' radio option is set to true
|
||||||
'visible' => array(
|
'visible' => array(
|
||||||
':input[name="booking_enable_helpareas"]' => array('value' => 1),
|
':input[name="booking_enable_helpareas"]' => array('value' => 1),
|
||||||
),
|
),
|
||||||
@@ -356,16 +356,43 @@ function booking_admin() {
|
|||||||
'#type' => 'radios',
|
'#type' => 'radios',
|
||||||
'#title' => t('Allow attendee to specify dietary requirements?'),
|
'#title' => t('Allow attendee to specify dietary requirements?'),
|
||||||
'#description' => t('If set to No, the following text definition will be used instead.'),
|
'#description' => t('If set to No, the following text definition will be used instead.'),
|
||||||
'#options' => array (0 => t('No'), t('Yes')),
|
'#options' => array (0 => t('No'), 1 => t('Yes')),
|
||||||
'#default_value' => variable_get('booking_enable_dietary', 0),
|
'#default_value' => variable_get('booking_enable_dietary', 0),
|
||||||
);
|
);
|
||||||
$form['regn_options']['booking_dietary_text_definition'] = array (
|
$form['regn_options']['booking_dietary_text_definition'] = array (
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
'#title' => t('Dietary Requirements Text Definition'),
|
'#title' => t('Dietary Requirements Text Definition'),
|
||||||
'#default_value' => variable_get('booking_dietary_text_definition', 'Please use the contact us form to indicate what dietary requirements you have.'),
|
'#default_value' => variable_get('booking_dietary_text_definition', 'Please use the contact us form to indicate what dietary requirements you have.'),
|
||||||
'#description' => 'Text to use on registration form if attendee may not specify dietary requirements (as above).',
|
'#description' => 'Text to use on registration form if attendee may not specify dietary requirements.',
|
||||||
'#size' => 150,
|
'#size' => 150,
|
||||||
'#maxlength' => 2000,
|
'#maxlength' => 2000,
|
||||||
|
'#states' => array(
|
||||||
|
// Only show this field when the 'booking_enable_dietary' radio option is set to No
|
||||||
|
'visible' => array(
|
||||||
|
':input[name="booking_enable_dietary"]' => array('value' => 0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
$form['regn_options']['booking_enable_medcond'] = array (
|
||||||
|
'#type' => 'radios',
|
||||||
|
'#title' => t('Allow attendee to specify medical conditions?'),
|
||||||
|
'#description' => t('If set to No, the following text definition will be used instead.'),
|
||||||
|
'#options' => array (0 => t('No'), 1 => t('Yes')),
|
||||||
|
'#default_value' => variable_get('booking_enable_medcond', 0),
|
||||||
|
);
|
||||||
|
$form['regn_options']['booking_medcond_text_definition'] = array (
|
||||||
|
'#type' => 'textfield',
|
||||||
|
'#title' => t('Medical Condition Text Definition'),
|
||||||
|
'#default_value' => variable_get('booking_medcond_text_definition', 'Please use the contact us form to indicate what medical condition you have.'),
|
||||||
|
'#description' => 'Text to use on registration form if attendee may not specify a medical condition.',
|
||||||
|
'#size' => 150,
|
||||||
|
'#maxlength' => 2000,
|
||||||
|
'#states' => array(
|
||||||
|
// Only show this field when the 'booking_enable_medcond' radio option is set to No
|
||||||
|
'visible' => array(
|
||||||
|
':input[name="booking_enable_medcond"]' => array('value' => 0),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['management'] = array (
|
$form['management'] = array (
|
||||||
|
@@ -914,6 +914,7 @@ if (variable_get('booking_enable_passport', 0) == 1)
|
|||||||
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
//the user is not allowed to enter data directly, so show them the instructions specified by the admin configuration options
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form['misc-areas']['booking_dietary'] = array(
|
$form['misc-areas']['booking_dietary'] = array(
|
||||||
@@ -927,12 +928,14 @@ if (variable_get('booking_enable_passport', 0) == 1)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$form['misc-areas']['booking_medical_conditions_check'] = array(
|
$form['misc-areas']['booking_medical_conditions_check'] = array(
|
||||||
'#type' => 'checkbox',
|
'#type' => 'checkbox',
|
||||||
'#title' => t('I have special medical condition(s), including allergies'),
|
'#title' => t('I have special medical condition(s), including allergies'),
|
||||||
'#default_value' => (!empty($data->booking_medical_conditions) && $data->booking_medical_conditions == 'Y') ? 1 : 0
|
'#default_value' => (!empty($data->booking_medical_conditions) && $data->booking_medical_conditions == 'Y') ? 1 : 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (variable_get('booking_enable_medcond', 0) == 1)
|
||||||
|
{
|
||||||
$form['misc-areas']['booking_medical_conditions'] = array(
|
$form['misc-areas']['booking_medical_conditions'] = array(
|
||||||
'#type' => 'textarea',
|
'#type' => 'textarea',
|
||||||
'#title' => t('Please list any medical conditions we need to be aware of. For allegies, please list the reaction to the allergen(s).'),
|
'#title' => t('Please list any medical conditions we need to be aware of. For allegies, please list the reaction to the allergen(s).'),
|
||||||
@@ -948,7 +951,22 @@ if (variable_get('booking_enable_passport', 0) == 1)
|
|||||||
'#attributes' => array('maxlength' => 1000),
|
'#attributes' => array('maxlength' => 1000),
|
||||||
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : '',
|
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : '',
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
//the user is not allowed to enter data directly, so show them the instructions specified by the admin configuration options
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$form['misc-areas']['booking_medical_conditions'] = array(
|
||||||
|
'#type' => 'container',
|
||||||
|
'#children' => variable_get('booking_medcond_text_definition', "Please contact us to specify your dietary requirements."),
|
||||||
|
'#states' => array(
|
||||||
|
'visible' => array(
|
||||||
|
':input[name="booking_medical_conditions_check"]' => array('checked' => TRUE),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//inserting is not true, so give the admin the textfield for entering/viewing data for dietary and medical conditions
|
||||||
} else {
|
} else {
|
||||||
$form['misc-areas']['booking_dietary'] = array(
|
$form['misc-areas']['booking_dietary'] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
@@ -957,10 +975,14 @@ if (variable_get('booking_enable_passport', 0) == 1)
|
|||||||
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
|
||||||
);
|
);
|
||||||
$form['misc-areas']['booking_medical_conditions'] = array(
|
$form['misc-areas']['booking_medical_conditions'] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textarea',
|
||||||
'#title' => t('Please list any medical conditions we need to be aware of.'),
|
'#title' => t('Please list any medical conditions we need to be aware of. For allegies, please list the reaction to the allergen(s).'),
|
||||||
'#maxlength' => 120,
|
'#cols' => 60,
|
||||||
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : ''
|
'#rows' => 5,
|
||||||
|
'#resizable' => TRUE,
|
||||||
|
'#required' => FALSE,
|
||||||
|
'#attributes' => array('maxlength' => 1000),
|
||||||
|
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user