logic fix
This commit is contained in:
@@ -294,7 +294,7 @@ function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tok
|
|||||||
//calculate which fields to show and whether we need to show the fieldset at all
|
//calculate which fields to show and whether we need to show the fieldset at all
|
||||||
$show_dietary = variable_get('booking_enable_dietary', 0) == 1 || $inserting == FALSE;
|
$show_dietary = variable_get('booking_enable_dietary', 0) == 1 || $inserting == FALSE;
|
||||||
$show_medical = variable_get('booking_enable_medcond', 0) == 1 || $inserting == FALSE;
|
$show_medical = variable_get('booking_enable_medcond', 0) == 1 || $inserting == FALSE;
|
||||||
$show_roommate = variable_get('booking_enable_roommate', 0) == 1 || $inserting == FALSE;
|
$show_roommate = (variable_get('booking_enable_roommate', 0) == 1 && $person->booking_partner_id == 0) || $inserting == FALSE;
|
||||||
$show_bf_gf = $person->booking_partner_id == 0 || $inserting == FALSE;
|
$show_bf_gf = $person->booking_partner_id == 0 || $inserting == FALSE;
|
||||||
$show_special_requirements = ($show_dietary || $show_medical || $show_roommate || $show_bf_gf);
|
$show_special_requirements = ($show_dietary || $show_medical || $show_roommate || $show_bf_gf);
|
||||||
|
|
||||||
@@ -324,19 +324,16 @@ function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tok
|
|||||||
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : $booking_medical_conditions
|
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : $booking_medical_conditions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//only show the room mate field if we're allowed to
|
//only show the room mate field if we're allowed to and the person isn't married
|
||||||
if ($show_roommate) {
|
if ($show_roommate) {
|
||||||
//married people won't need to select a room mate
|
$form['requirements']['booking_room_mate1'] = array(
|
||||||
if ($person->booking_partner_id == 0) {
|
'#type' => 'textfield',
|
||||||
$form['requirements']['booking_room_mate1'] = array(
|
'#title' => t('I would like to share a room with'),
|
||||||
'#type' => 'textfield',
|
'#description' => t('This field contains information you entered when you registered. Update if necessary.'),
|
||||||
'#title' => t('I would like to share a room with'),
|
'#maxlength' => 200,
|
||||||
'#description' => t('This field contains information you entered when you registered. Update if necessary.'),
|
'#required' => FALSE,
|
||||||
'#maxlength' => 200,
|
'#default_value' => !empty($data->booking_room_mate1) ? $data->booking_room_mate1 : $booking_roommate
|
||||||
'#required' => FALSE,
|
);
|
||||||
'#default_value' => !empty($data->booking_room_mate1) ? $data->booking_room_mate1 : $booking_roommate
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//only show this field if this person isn't married
|
//only show this field if this person isn't married
|
||||||
if ($show_bf_gf) {
|
if ($show_bf_gf) {
|
||||||
|
Reference in New Issue
Block a user