Add flight detail fields
This commit is contained in:
@@ -398,6 +398,13 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
||||
//'#date_label_position' => 'within',
|
||||
'#date_year_range' => '+0:+13'
|
||||
);
|
||||
$form['passport-details']['booking_travel_insurance'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Travel insurance policy details'),
|
||||
'#maxlength' => 120,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_travel_insurance) ? $data->booking_travel_insurance : ''
|
||||
);
|
||||
if ($inserting == FALSE)
|
||||
{
|
||||
$form['passport-details']['booking_destination_country'] = array(
|
||||
@@ -406,8 +413,22 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
||||
'#maxlength' => 120,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_destination_country) ? $data->booking_destination_country : '',
|
||||
);
|
||||
}
|
||||
);
|
||||
$form['passport-details']['booking_internal_flight_outbound'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Internal flight details leaving conference'),
|
||||
'#maxlength' => 120,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_internal_flight_outbound) ? $data->booking_internal_flight_outbound : '',
|
||||
);
|
||||
$form['passport-details']['booking_internal_flight_inbound'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Internal flight details returning to conference'),
|
||||
'#maxlength' => 120,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_internal_flight_inbound) ? $data->booking_internal_flight_inbound : '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$form['contact-details'] = array(
|
||||
@@ -949,6 +970,7 @@ function booking_form_submit($form, &$form_state) {
|
||||
$node->booking_passport_issue_name = empty($values['booking_passport_issue_name']) ? '' : $values['booking_passport_issue_name'];
|
||||
$node->booking_passport_expiry_date = empty($values['booking_passport_expiry_date']) ? '0' : _datearray_to_ts($values['booking_passport_expiry_date']);
|
||||
$node->booking_destination_country = empty($values['booking_destination_country']) ? '' : $values['booking_destination_country'];
|
||||
$node->booking_travel_insurance = empty($values['booking_travel_insurance']) ? '' : $values['booking_travel_insurance'];
|
||||
|
||||
//payment details
|
||||
$node->booking_payment_id = $values['booking_payment_id'];
|
||||
@@ -1080,15 +1102,21 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
||||
{
|
||||
global $event;
|
||||
$studygroup_count = variable_get('booking_studygroup_count','0');
|
||||
|
||||
//TODO: only add room info if the feature is enabled
|
||||
|
||||
$query = db_select('booking_person', 'p');
|
||||
//add price info
|
||||
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
||||
//add travel form info if it exists
|
||||
$query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid');
|
||||
//add room info
|
||||
$query->leftJoin('booking_room_mapping', 'rm', 'p.nid = rm.booking_nodeid');
|
||||
$query->leftJoin('booking_room_definition', 'r', 'rm.booking_roomid = r.rid');
|
||||
|
||||
//add the joins for room allocation info if enabled
|
||||
if (variable_get('booking_enable_roomallocations', 0) == 1)
|
||||
{
|
||||
$query->leftJoin('booking_room_mapping', 'rm', 'p.nid = rm.booking_nodeid');
|
||||
$query->leftJoin('booking_room_definition', 'r', 'rm.booking_roomid = r.rid');
|
||||
}
|
||||
|
||||
//add the joins to flatten out study groups into columns
|
||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
||||
@@ -1113,9 +1141,13 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
||||
//add the database fields we always want to retrieve
|
||||
$query->fields('p')
|
||||
->fields('t')
|
||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'))
|
||||
->fields('rm', array('booking_room_bedtype'))
|
||||
->fields('r', array('rid', 'booking_room_location_id', 'booking_room_number'));
|
||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'));
|
||||
|
||||
if (variable_get('booking_enable_roomallocations', 0) == 1)
|
||||
{
|
||||
$query->fields('rm', array('booking_room_bedtype'))
|
||||
->fields('r', array('rid', 'booking_room_location_id', 'booking_room_number'));
|
||||
}
|
||||
|
||||
//now add the study group fields if applicable
|
||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
||||
@@ -1185,6 +1217,9 @@ function _booking_insert($node) {
|
||||
'booking_passport_issue_name' => $node->booking_passport_issue_name,
|
||||
'booking_passport_expiry_date' => $node->booking_passport_expiry_date,
|
||||
'booking_destination_country' => $node->booking_destination_country,
|
||||
'booking_travel_insurance' => $node->booking_travel_insurance,
|
||||
'booking_internal_flight_outbound' => $node->booking_internal_flight_outbound,
|
||||
'booking_internal_flight_inbound' => $node->booking_internal_flight_inbound,
|
||||
'booking_gender' => $node->booking_gender,
|
||||
'booking_street' => $node->booking_street,
|
||||
'booking_suburb' => $node->booking_suburb,
|
||||
@@ -1272,6 +1307,9 @@ function _booking_update($node) {
|
||||
'booking_passport_issue_name' => $node->booking_passport_issue_name,
|
||||
'booking_passport_expiry_date' => _date_to_ts($node->booking_passport_expiry_date),
|
||||
'booking_destination_country' => $node->booking_destination_country,
|
||||
'booking_travel_insurance' => $node->booking_travel_insurance,
|
||||
'booking_internal_flight_outbound' => $node->booking_internal_flight_outbound,
|
||||
'booking_internal_flight_inbound' => $node->booking_internal_flight_inbound,
|
||||
'booking_gender' => $node->booking_gender,
|
||||
'booking_street' => $node->booking_street,
|
||||
'booking_suburb' => $node->booking_suburb,
|
||||
@@ -1633,6 +1671,9 @@ function booking_view($node, $view_mode) {
|
||||
$rows[] = array(t('Passport Exact Issued Name:'), $node->booking_passport_issue_name);
|
||||
$rows[] = array(t('Passport Issue Location:'), $node->booking_passport_issue_location);
|
||||
$rows[] = array(t('Destination Country:'), $node->booking_destination_country);
|
||||
$rows[] = array(t('Travel Insurance details:'), $node->booking_travel_insurance);
|
||||
$rows[] = array(t('Internal Flight Outbound:'), $node->booking_internal_flight_outbound);
|
||||
$rows[] = array(t('Internal Flight Returning:'), $node->booking_internal_flight_inbound);
|
||||
}
|
||||
|
||||
$rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type)));
|
||||
|
Reference in New Issue
Block a user