updates to travel form and add calls to _booking_node_create_mysqlview
This commit is contained in:
@@ -69,7 +69,7 @@ function booking_travel_page()
|
||||
);
|
||||
//actual form
|
||||
$return_array[] = array(
|
||||
'form' => drupal_get_form('travel_form', true, $node->nid)
|
||||
'form' => drupal_get_form('travel_form', true, $node, $tokens)
|
||||
);
|
||||
//text after form
|
||||
/*
|
||||
@@ -92,7 +92,7 @@ function booking_travel_page()
|
||||
|
||||
}
|
||||
|
||||
function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
function travel_form($node, &$form_state, $inserting = FALSE, $node = NULL, $tokens = NULL)
|
||||
{
|
||||
global $event;
|
||||
date_default_timezone_set(date_default_timezone(FALSE));
|
||||
@@ -105,7 +105,7 @@ function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
$transport_type_options = array(
|
||||
'Driving' => 'Driving',
|
||||
//'Train' => 'Train',
|
||||
'Flying' => 'Flying'
|
||||
'Flying' => 'Flying',
|
||||
);
|
||||
|
||||
//there's already info in $node so use that
|
||||
@@ -118,9 +118,9 @@ function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
}
|
||||
|
||||
//get info about this person from the relevant node id
|
||||
$person = db_query("SELECT booking_dietary, booking_medical_conditions, booking_bf_gf_nid, booking_partner_id, booking_room_mate1 " . "FROM {booking_person} " . "WHERE nid = :nid ", array(
|
||||
':nid' => $nid <> 0 ? $nid : $data->booking_person_nid
|
||||
))->fetchObject();
|
||||
$person = db_query("SELECT booking_dietary, booking_medical_conditions, booking_bf_gf_nid, booking_partner_id, booking_room_mate1 " .
|
||||
"FROM {booking_person} " . "WHERE nid = :nid ",
|
||||
array(':nid' => $node->nid <> NULL ? $node->nid : $data->booking_person_nid))->fetchObject();
|
||||
|
||||
if ($person) {
|
||||
$booking_dietary = $person->booking_dietary;
|
||||
@@ -134,12 +134,12 @@ function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
//store the node id
|
||||
$form['personid'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => $nid
|
||||
'#value' => $node->nid,
|
||||
);
|
||||
|
||||
$form['travel'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'Travel details'
|
||||
'#title' => 'Travel details',
|
||||
);
|
||||
$form['travel']['booking_transport_type'] = array(
|
||||
'#type' => 'radios',
|
||||
@@ -298,14 +298,17 @@ function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : $booking_dietary
|
||||
);
|
||||
}
|
||||
$form['requirements']['booking_medical_conditions'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Please describe any medical condition we need to know about.'),
|
||||
'#description' => t('This field contains information you entered when you registered.'),
|
||||
'#maxlength' => 180,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_medical_conditions) ? $data->booking_medical_conditions : $booking_medical_conditions
|
||||
);
|
||||
//display the medical conditions question if it is enabled
|
||||
if (variable_get('booking_enable_medcond', 0) == 1) {
|
||||
$form['requirements']['booking_medical_conditions'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Please describe any medical condition we need to know about.'),
|
||||
'#description' => t('This field contains information you entered when you registered.'),
|
||||
'#maxlength' => 180,
|
||||
'#required' => FALSE,
|
||||
'#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
|
||||
if (variable_get('booking_enable_roommate', 0) == 1 || $inserting == FALSE) {
|
||||
//married people won't need to select a room mate
|
||||
|
Reference in New Issue
Block a user