Some formatting of travel information
This commit is contained in:
@@ -1365,13 +1365,13 @@ function _booking_delete($node) {
|
||||
|
||||
|
||||
function booking_view($node, $view_mode) {
|
||||
|
||||
global $event;
|
||||
$rows = array();
|
||||
$travel_rows = array();
|
||||
|
||||
//calculate the price owed by this person
|
||||
$price_lookup = db_query("SELECT booking_price_descrip, booking_price, booking_late_price FROM {booking_price} where pid = :pid ",
|
||||
array(':pid' => $node->booking_payment_id))
|
||||
->fetchObject();
|
||||
$price = _booking_is_earlybird() == true ? $price_lookup->booking_price : $price_lookup->booking_late_price;
|
||||
$payment_type = $price_lookup->booking_price_descrip . ' ($' . $price . ')';
|
||||
$price = _booking_is_earlybird() == true ? $node->booking_price : $node->booking_late_price;
|
||||
$payment_type = $node->booking_price_descrip . ' ($' . $price . ')';
|
||||
|
||||
//look up the actual name for a linked partner
|
||||
if ($node->booking_partner_id != 0)
|
||||
@@ -1395,8 +1395,14 @@ function booking_view($node, $view_mode) {
|
||||
else
|
||||
$bf_gf = "N/A";
|
||||
|
||||
$header = array('Attribute', 'Value');
|
||||
$rows = array();
|
||||
//$header = array('Attribute', 'Value');
|
||||
|
||||
$header = array(
|
||||
array('data' => t('Attribute'), 'width' => '40%'),
|
||||
array('data' => t('Value'), 'width' => '60%'),
|
||||
);
|
||||
|
||||
//now populate the table
|
||||
$rows[] = array(t('Date/Time registered:'), t('!timestamp', array('!timestamp' => format_date($node->booking_timestamp, 'custom', 'd/m/Y H:i'))));
|
||||
$rows[] = array(t('Name:'), t('!first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)));
|
||||
$rows[] = array(t('Gender:'), t('!gender', array('!gender' => $node->booking_gender == 'M' ? 'Male' : 'Female')));
|
||||
@@ -1492,27 +1498,40 @@ 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
|
||||
$rows[] = array(t('Temporary UUID:'), $node->booking_tempid);
|
||||
|
||||
//add 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',
|
||||
$travel_rows[] = array(t('Transport Type:'), $node->booking_transport_type);
|
||||
$travel_rows[] = array(t('Catching the train to Study Week:'), $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No');
|
||||
$travel_rows[] = array(t('Inbound Flight Number:'), $node->booking_flightnum_inbound == '' ? 'N/A' : $node->booking_flightnum_inbound);
|
||||
$travel_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',
|
||||
$travel_rows[] = array(t('Outbound Flight Number:'), $node->booking_flightnum_outbound == '' ? 'N/A' : $node->booking_flightnum_outbound);
|
||||
$travel_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');
|
||||
$travel_rows[] = array(t('Accommodation before Study Week Required:'), $node->booking_accom_before_reqd == 1 ? 'Yes' : 'No');
|
||||
$travel_rows[] = array(t('Accommodation after Study Week Required:'), $node->booking_accom_after_reqd == 1 ? 'Yes' : 'No');
|
||||
|
||||
$node->content['travel-heading'] = array(
|
||||
'#markup' => "<h2>Travel Details</h2>",
|
||||
'#weight' => 2,
|
||||
);
|
||||
|
||||
$node->content['travel-details'] = array(
|
||||
'#markup' => theme('table', array('header' => $header, 'rows' => $travel_rows)),
|
||||
'#weight' => 3,
|
||||
);
|
||||
}
|
||||
|
||||
$rows[] = array(t('Temporary UUID:'), $node->booking_tempid);
|
||||
|
||||
$node->content['details'] = array(
|
||||
'#markup' => theme('table', array('header' => $header, 'rows' => $rows)),
|
||||
'#weight' => 1,
|
||||
);
|
||||
|
||||
|
||||
|
||||
return $node;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user