From 948e90ad7c87dccd5266bc068081035f02f29ba0 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sun, 23 Aug 2015 17:54:59 +1000 Subject: [PATCH] Display dependant children in node theme --- booking.regn_node.inc | 79 +++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/booking.regn_node.inc b/booking.regn_node.inc index 93e6df1..d0f0e3c 100644 --- a/booking.regn_node.inc +++ b/booking.regn_node.inc @@ -649,44 +649,44 @@ function booking_view($node, $view_mode) { if (variable_get('booking_enable_passport', 1) == 1) { - $rows[] = array(t('Passport Number:'), $node->booking_passport_num); - $rows[] = array(t('Passport Expiry:'), t('!timestamp', array('!timestamp' => _booking_convert_ts($node->booking_passport_expiry_date)->format('d/m/Y')))); - $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('Passport Number:'), $node->booking_passport_num); + $rows[] = array(t('Passport Expiry:'), t('!timestamp', array('!timestamp' => _booking_convert_ts($node->booking_passport_expiry_date)->format('d/m/Y')))); + $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); - //outbound flight - $flight_rows[] = array(t('Internal Flight Booking Reference:'), $node->booking_outflight_bookingnum); - $flight_rows[] = array(t('Internal Flight Number:'), $node->booking_outflight_flightnum); - $flight_rows[] = array(t('Internal Flight Origin to Destination:'), $node->booking_outflight_origin); - $flight_rows[] = array(t('Internal Flight Departure Time:'), - $node->booking_outflight_origin_ts == 0 ? '' : format_date($node->booking_outflight_origin_ts, 'custom', 'd/m/Y H:i') ); - $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_outflight_connecting_flightnum); - $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_outflight_destination); - $flight_rows[] = array(t('Internal Flight Arrival Time:'), - $node->booking_outflight_destination_ts == 0 ? '' : format_date($node->booking_outflight_destination_ts, 'custom', 'd/m/Y H:i') ); - //return flight - $flight_rows[] = array(t('Return Internal Flight Booking Reference:'), $node->booking_rtrnflight_bookingnum); - $flight_rows[] = array(t('Return Internal Flight Number:'), $node->booking_rtrnflight_flightnum); - $flight_rows[] = array(t('Return Internal Flight Origin to Destination:'), $node->booking_rtrnflight_origin); - $flight_rows[] = array(t('Return Internal Flight Departure Time:'), - $node->booking_rtrnflight_origin_ts == 0 ? '' : format_date($node->booking_rtrnflight_origin_ts, 'custom', 'd/m/Y H:i') ); - $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_rtrnflight_connecting_flightnum); - $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_rtrnflight_destination); - $flight_rows[] = array(t('Return Internal Flight Arrival Time:'), - $node->booking_rtrnflight_destination_ts == 0 ? '' : format_date($node->booking_rtrnflight_destination_ts, 'custom', 'd/m/Y H:i') ); - - //add the flight info to a new section - $flight_heading = t("

Internal Flight Details

"); + //outbound flight + $flight_rows[] = array(t('Internal Flight Booking Reference:'), $node->booking_outflight_bookingnum); + $flight_rows[] = array(t('Internal Flight Number:'), $node->booking_outflight_flightnum); + $flight_rows[] = array(t('Internal Flight Origin to Destination:'), $node->booking_outflight_origin); + $flight_rows[] = array(t('Internal Flight Departure Time:'), + $node->booking_outflight_origin_ts == 0 ? '' : format_date($node->booking_outflight_origin_ts, 'custom', 'd/m/Y H:i') ); + $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_outflight_connecting_flightnum); + $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_outflight_destination); + $flight_rows[] = array(t('Internal Flight Arrival Time:'), + $node->booking_outflight_destination_ts == 0 ? '' : format_date($node->booking_outflight_destination_ts, 'custom', 'd/m/Y H:i') ); + //return flight + $flight_rows[] = array(t('Return Internal Flight Booking Reference:'), $node->booking_rtrnflight_bookingnum); + $flight_rows[] = array(t('Return Internal Flight Number:'), $node->booking_rtrnflight_flightnum); + $flight_rows[] = array(t('Return Internal Flight Origin to Destination:'), $node->booking_rtrnflight_origin); + $flight_rows[] = array(t('Return Internal Flight Departure Time:'), + $node->booking_rtrnflight_origin_ts == 0 ? '' : format_date($node->booking_rtrnflight_origin_ts, 'custom', 'd/m/Y H:i') ); + $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_rtrnflight_connecting_flightnum); + $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_rtrnflight_destination); + $flight_rows[] = array(t('Return Internal Flight Arrival Time:'), + $node->booking_rtrnflight_destination_ts == 0 ? '' : format_date($node->booking_rtrnflight_destination_ts, 'custom', 'd/m/Y H:i') ); + + //add the flight info to a new section + $flight_heading = t("

Internal Flight Details

"); $node->content['flight-heading'] = array( - '#markup' => $flight_heading, - '#weight' => 2, - ); - $node->content['flight-details'] = array( - '#markup' => theme('table', array('header' => $header, 'rows' => $flight_rows)), - '#weight' => 3, - ); + '#markup' => $flight_heading, + '#weight' => 2, + ); + $node->content['flight-details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $flight_rows)), + '#weight' => 3, + ); } $rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type))); @@ -713,7 +713,12 @@ function booking_view($node, $view_mode) { $rows[] = array(t('Ecclesia:'), t('!ecclesia', array('!ecclesia' => $node->booking_ecclesia))); $rows[] = array(t('Baptised:'), t('!ans', array('!ans' => ($node->booking_baptised == 'Y' ? 'Yes' : 'No')))); $rows[] = array(t('Married:'), t('!ans', array('!ans' => ($node->booking_married == 'Y' ? 'Yes' : 'No')))); - + + if (variable_get('booking_ask_dependant_children', 0) == 1) + { + $rows[] = array(t('Bringing dependant children:'), t('!ans', array('!ans' => ($node->booking_dependant_children == 'Y' ? 'Yes' : 'No')))); + } + $rows[] = array(t('Linked Partner:'), t($partner_name)); $rows[] = array(t('Linked Boyfriend/Girlfriend:'), t($bf_gf)); $rows[] = array(t('Emergency Contact Name:'), $node->booking_guardian_name);