Added dependant children option to regn form
This commit is contained in:
@@ -269,7 +269,34 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
||||
),
|
||||
'#default_value' => !empty($data->booking_partner_name) ? $data->booking_partner_name : ''
|
||||
);
|
||||
|
||||
|
||||
if (variable_get('booking_ask_dependant_children', 0) == 1)
|
||||
{
|
||||
$form['your-details']['booking_dependant_children'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Are you bringing dependant children to study week?'),
|
||||
'#options' => array (0 => t('No'), t('Yes')),
|
||||
'#default_value' => (!empty($data->booking_dependant_children) && $data->booking_dependant_children == 'Y') ? 1 : 0,
|
||||
'#required' => FALSE,
|
||||
'#states' => array(
|
||||
// Only show this field when the 'booking_married' checkbox is enabled.
|
||||
'visible' => array(
|
||||
':input[name="booking_married"]' => array('checked' => TRUE),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$form['your-details']['booking_dependant_children_warning'] = array(
|
||||
'#type' => 'container',
|
||||
'#children' => variable_get('booking_dependant_children_text_definition', "<b>Please note that only one dependant child under the age of two is allowed.</b>"),
|
||||
'#states' => array(
|
||||
'visible' => array(
|
||||
':input[name="booking_dependant_children"]' => array('value' => 1),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if ($inserting == TRUE)
|
||||
{
|
||||
$form['your-details']['booking_partner_id'] = array(
|
||||
@@ -1260,10 +1287,12 @@ function booking_form_submit($form, &$form_state) {
|
||||
//fields that may or may not have been present in the initial form
|
||||
$node->booking_barcode = empty($values['booking_barcode']) ? '' : $values['booking_barcode'];
|
||||
$node->booking_luckynum = empty($values['booking_luckynum']) ? 0 : $values['booking_luckynum'];
|
||||
$node->booking_random_facts = empty($values['booking_random_facts']) ? '' : $values['booking_random_facts'];
|
||||
$node->booking_welfare_required = empty($values['booking_welfare_required']) ? 'N' : ($values['booking_welfare_required'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_committee_member = empty($values['booking_committee_member']) ? 'N' : ($values['booking_committee_member'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_payment_complete = empty($values['booking_payment_complete']) ? 'N' : ($values['booking_payment_complete'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_refund_processed = empty($values['booking_refund_processed']) ? 'N' : ($values['booking_refund_processed'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_dependant_children = empty($values['booking_dependant_children']) ? 'N' : ($values['booking_dependant_children'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_refund_due = empty($values['booking_refund_due']) ? 0 : $values['booking_refund_due'];
|
||||
$node->booking_help_music = empty($values['booking_help_music']) ? '' : $values['booking_help_music'];
|
||||
$node->booking_help_meditations = empty($values['booking_help_meditations']) ? '' : $values['booking_help_meditations'];
|
||||
|
Reference in New Issue
Block a user