Add flight detail fields
This commit is contained in:
@@ -108,7 +108,7 @@ function _booking_room_location_lookup($input = NULL)
|
|||||||
$location[] = t('Bezer');
|
$location[] = t('Bezer');
|
||||||
$location[] = t('Hebron');
|
$location[] = t('Hebron');
|
||||||
$location[] = t('Shechem');
|
$location[] = t('Shechem');
|
||||||
$location[] = t('Kedesh');
|
$location[] = t('Kadesh');
|
||||||
$location[] = t('Elpis Israel House Rooms 17-33');
|
$location[] = t('Elpis Israel House Rooms 17-33');
|
||||||
$location[] = t('Elpis Israel House Rooms 34-51');
|
$location[] = t('Elpis Israel House Rooms 34-51');
|
||||||
|
|
||||||
|
@@ -412,6 +412,23 @@ function booking_update_7221() {
|
|||||||
db_add_field('booking_person', 'booking_destination_country', $spec);
|
db_add_field('booking_person', 'booking_destination_country', $spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add field for travel insurance info when collecting passport information
|
||||||
|
*/
|
||||||
|
function booking_update_7222() {
|
||||||
|
$spec = array('type' => 'varchar', 'length' => '500', 'not null' => FALSE);
|
||||||
|
db_add_field('booking_person', 'booking_travel_insurance', $spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add fields for flight details when collecting passport information
|
||||||
|
*/
|
||||||
|
function booking_update_7223() {
|
||||||
|
$spec = array('type' => 'varchar', 'length' => '500', 'not null' => FALSE);
|
||||||
|
db_add_field('booking_person', 'booking_internal_flight_outbound', $spec);
|
||||||
|
db_add_field('booking_person', 'booking_internal_flight_inbound', $spec);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
@@ -442,7 +459,7 @@ $result = db_insert('booking_price')
|
|||||||
'booking_eventid' => 1,
|
'booking_eventid' => 1,
|
||||||
'booking_price' => '50.00',
|
'booking_price' => '50.00',
|
||||||
'booking_price_descrip' => 'Deposit',
|
'booking_price_descrip' => 'Deposit',
|
||||||
'booking_buttonid' => '9LMSELBEEL5W2',
|
'booking_buttonid' => '',
|
||||||
'booking_price_active' => 1,
|
'booking_price_active' => 1,
|
||||||
'booking_depositonly' => 1,
|
'booking_depositonly' => 1,
|
||||||
))
|
))
|
||||||
|
@@ -398,6 +398,13 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
|||||||
//'#date_label_position' => 'within',
|
//'#date_label_position' => 'within',
|
||||||
'#date_year_range' => '+0:+13'
|
'#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)
|
if ($inserting == FALSE)
|
||||||
{
|
{
|
||||||
$form['passport-details']['booking_destination_country'] = array(
|
$form['passport-details']['booking_destination_country'] = array(
|
||||||
@@ -406,8 +413,22 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
|||||||
'#maxlength' => 120,
|
'#maxlength' => 120,
|
||||||
'#required' => FALSE,
|
'#required' => FALSE,
|
||||||
'#default_value' => !empty($data->booking_destination_country) ? $data->booking_destination_country : '',
|
'#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(
|
$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_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_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_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
|
//payment details
|
||||||
$node->booking_payment_id = $values['booking_payment_id'];
|
$node->booking_payment_id = $values['booking_payment_id'];
|
||||||
@@ -1080,15 +1102,21 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
|||||||
{
|
{
|
||||||
global $event;
|
global $event;
|
||||||
$studygroup_count = variable_get('booking_studygroup_count','0');
|
$studygroup_count = variable_get('booking_studygroup_count','0');
|
||||||
|
|
||||||
|
//TODO: only add room info if the feature is enabled
|
||||||
|
|
||||||
$query = db_select('booking_person', 'p');
|
$query = db_select('booking_person', 'p');
|
||||||
//add price info
|
//add price info
|
||||||
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
||||||
//add travel form info if it exists
|
//add travel form info if it exists
|
||||||
$query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid');
|
$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');
|
//add the joins for room allocation info if enabled
|
||||||
$query->leftJoin('booking_room_definition', 'r', 'rm.booking_roomid = r.rid');
|
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
|
//add the joins to flatten out study groups into columns
|
||||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
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
|
//add the database fields we always want to retrieve
|
||||||
$query->fields('p')
|
$query->fields('p')
|
||||||
->fields('t')
|
->fields('t')
|
||||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'))
|
->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'));
|
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
|
//now add the study group fields if applicable
|
||||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
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_issue_name' => $node->booking_passport_issue_name,
|
||||||
'booking_passport_expiry_date' => $node->booking_passport_expiry_date,
|
'booking_passport_expiry_date' => $node->booking_passport_expiry_date,
|
||||||
'booking_destination_country' => $node->booking_destination_country,
|
'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_gender' => $node->booking_gender,
|
||||||
'booking_street' => $node->booking_street,
|
'booking_street' => $node->booking_street,
|
||||||
'booking_suburb' => $node->booking_suburb,
|
'booking_suburb' => $node->booking_suburb,
|
||||||
@@ -1272,6 +1307,9 @@ function _booking_update($node) {
|
|||||||
'booking_passport_issue_name' => $node->booking_passport_issue_name,
|
'booking_passport_issue_name' => $node->booking_passport_issue_name,
|
||||||
'booking_passport_expiry_date' => _date_to_ts($node->booking_passport_expiry_date),
|
'booking_passport_expiry_date' => _date_to_ts($node->booking_passport_expiry_date),
|
||||||
'booking_destination_country' => $node->booking_destination_country,
|
'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_gender' => $node->booking_gender,
|
||||||
'booking_street' => $node->booking_street,
|
'booking_street' => $node->booking_street,
|
||||||
'booking_suburb' => $node->booking_suburb,
|
'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 Exact Issued Name:'), $node->booking_passport_issue_name);
|
||||||
$rows[] = array(t('Passport Issue Location:'), $node->booking_passport_issue_location);
|
$rows[] = array(t('Passport Issue Location:'), $node->booking_passport_issue_location);
|
||||||
$rows[] = array(t('Destination Country:'), $node->booking_destination_country);
|
$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)));
|
$rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type)));
|
||||||
|
@@ -13,7 +13,7 @@ function booking_room_view_summary() {
|
|||||||
global $event;
|
global $event;
|
||||||
$output = "";
|
$output = "";
|
||||||
$header = array('Location', 'Assign Attendees', 'View Rooms For Location');
|
$header = array('Location', 'Assign Attendees', 'View Rooms For Location');
|
||||||
$attributes = array('style' => 'max-width:45%');
|
$attributes = array('style' => 'max-width:60%');
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
//get room definitions
|
//get room definitions
|
||||||
@@ -681,9 +681,9 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) {
|
|||||||
$room_mapping = $room_mapping_query->fetchAllAssoc('booking_nodeid');
|
$room_mapping = $room_mapping_query->fetchAllAssoc('booking_nodeid');
|
||||||
|
|
||||||
//query for room definitions
|
//query for room definitions
|
||||||
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY booking_room_number",
|
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY CAST(booking_room_number as SIGNED INTEGER) ASC",
|
||||||
array(':lid' => $location_id));
|
array(':lid' => $location_id));
|
||||||
|
|
||||||
//query for attendees
|
//query for attendees
|
||||||
$query = db_query("SELECT nid, booking_firstname, booking_lastname, booking_gender, booking_dob, booking_partner_id " .
|
$query = db_query("SELECT nid, booking_firstname, booking_lastname, booking_gender, booking_dob, booking_partner_id " .
|
||||||
" FROM {booking_person} " .
|
" FROM {booking_person} " .
|
||||||
|
@@ -714,8 +714,12 @@ function booking_define_personspecific_tokens($node)
|
|||||||
$tokens['travel-summary'] = _booking_travelform_email_summary($node);
|
$tokens['travel-summary'] = _booking_travelform_email_summary($node);
|
||||||
$tokens['studygroup-summary'] = _booking_studygroup_email_summary($node);
|
$tokens['studygroup-summary'] = _booking_studygroup_email_summary($node);
|
||||||
$tokens['leaderhelper-pair'] = _booking_leader_helper_email_summary($node);
|
$tokens['leaderhelper-pair'] = _booking_leader_helper_email_summary($node);
|
||||||
$tokens['room-allocation'] = _booking_room_email_summary($node);
|
|
||||||
$tokens['bed-type'] = _booking_room_bedtype_lookup($node->booking_room_bedtype);
|
if (variable_get('booking_enable_roomallocations', 0) == 1)
|
||||||
|
{
|
||||||
|
$tokens['room-allocation'] = _booking_room_email_summary($node);
|
||||||
|
$tokens['bed-type'] = _booking_room_bedtype_lookup($node->booking_room_bedtype);
|
||||||
|
}
|
||||||
|
|
||||||
return $tokens;
|
return $tokens;
|
||||||
}
|
}
|
Reference in New Issue
Block a user