Add travel info to booking node view

This commit is contained in:
2014-02-28 17:17:18 +11:00
parent 2a773cee4d
commit 397448d47c
6 changed files with 55 additions and 20 deletions

View File

@@ -1009,12 +1009,13 @@ function booking_form_submit($form, &$form_state) {
}
}
//check whether we should send an automatic email
//check whether we should send an automatic email even though they haven't paid yet
if (variable_get('booking_auto_confirm_email', 0) == 1)
{
//send the person an email
_booking_registration_email($node->nid, FALSE, FALSE);
} else
}
else
{
//just send a notification email
_booking_regn_notifyonly_email($node, FALSE);
@@ -1047,7 +1048,7 @@ function booking_load($nodes) {
//add that data to the array of node references
foreach ($result as $record)
{
//watchdog('booking', "<pre>Loading node:\n@info</pre>", array('@info' => print_r( $record, true)));
watchdog('booking', "<pre>Loading node:\n@info</pre>", array('@info' => print_r( $record, true)));
// run through each result row and add in the needed attributes
foreach ($record as $key => $value)
{
@@ -1491,6 +1492,20 @@ function booking_view($node, $view_mode) {
$rows[] = array(t('Mission related skills:'), t('!value', array('!value' => $skill_areas)));
$rows[] = array(t('Previous Mission Experience:'), $node->booking_mission_experience_details);
}
//print the travel info if it has been defined for this attendee
if (! empty($node->tid))
{
$rows[] = array(t('Transport Type:'), $node->booking_transport_type);
$rows[] = array(t('Catching the train to Study Week:'), $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No');
$rows[] = array(t('Inbound Flight Number:'), $node->booking_flightnum_inbound == '' ? 'N/A' : $node->booking_flightnum_inbound);
$rows[] = array(t('Flight Arrival:'), t('!date',
array('!date' => $node->booking_flight_datetime_inbound == 0 ? 'N/A' : format_date($node->booking_flight_datetime_inbound, 'custom', 'd/m/Y H:i'))));
$rows[] = array(t('Outbound Flight Number:'), $node->booking_flightnum_outbound == '' ? 'N/A' : $node->booking_flightnum_outbound);
$rows[] = array(t('Flight Departure:'), t('!date',
array('!date' => $node->booking_flight_datetime_outbound == 0 ? 'N/A' : format_date($node->booking_flight_datetime_outbound, 'custom', 'd/m/Y H:i'))));
$rows[] = array(t('Accommodation before Study Week Required:'), $node->booking_accom_before_reqd == 1 ? 'Yes' : 'No');
$rows[] = array(t('Accommodation after Study Week Required:'), $node->booking_accom_after_reqd == 1 ? 'Yes' : 'No');
}
$rows[] = array(t('Temporary UUID:'), $node->booking_tempid);