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
|
||||
$show_dietary = variable_get('booking_enable_dietary', 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_special_requirements = ($show_dietary || $show_medical || $show_roommate || $show_bf_gf);
|
||||
|
||||
@@ -324,10 +324,8 @@ 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
|
||||
);
|
||||
}
|
||||
//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) {
|
||||
//married people won't need to select a room mate
|
||||
if ($person->booking_partner_id == 0) {
|
||||
$form['requirements']['booking_room_mate1'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('I would like to share a room with'),
|
||||
@@ -337,7 +335,6 @@ function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tok
|
||||
'#default_value' => !empty($data->booking_room_mate1) ? $data->booking_room_mate1 : $booking_roommate
|
||||
);
|
||||
}
|
||||
}
|
||||
//only show this field if this person isn't married
|
||||
if ($show_bf_gf) {
|
||||
$form['requirements']['booking_bf_gf_nid'] = array(
|
||||
|
Reference in New Issue
Block a user