From d88159c25aa2cb20e9d121d510b93da2a41b46b8 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sun, 26 Jun 2016 21:41:05 +1000 Subject: [PATCH] remove people no longer coming from travel report --- booking.reports.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/booking.reports.inc b/booking.reports.inc index e7a9720..e616a29 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -453,9 +453,13 @@ function booking_report_travel() { //get travel info from database $query = db_select('booking_person', 'p'); $query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid'); - $query->condition('p.booking_eventid', $event->eid, '=') - ->fields('p') - ->fields('t'); + //include people either booked in or on the waiting list or hosts, that belong to the current event id + $db_or = db_or(); + $db_or->condition('p.booking_status', 1, '='); + $db_or->condition('p.booking_status', 2, '='); + $db_or->condition('p.booking_status', 5, '='); + $db_and = db_and()->condition($db_or)->condition('p.booking_eventid', $event->eid, '='); + $query->fields('p')->fields('t'); //allow user to sort columns $table_sort = $query->extend('TableSort')->orderbyHeader($header); $result = $table_sort->execute(); @@ -475,7 +479,7 @@ function booking_report_travel() { //$travel_link = l(t('Travel'), t('node/!id/edit', array('!id' => $person->tid))); $this_row[] = t('!transport', array('!transport' => $person->booking_transport_type)); $this_row[] = t('!train', array('!train' => $person->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No')); - $this_row[] = t('!inflightnum', array('!transport' => $person->booking_flightnum_inbound)); + $this_row[] = t('!inflightnum', array('!inflightnum' => $person->booking_flightnum_inbound)); $this_row[] = t('!inflighttime', array('!inflighttime' => $person->booking_flight_datetime_inbound == 0 ? '' : format_date($person->booking_flight_datetime_inbound, 'custom', 'd/m/Y H:i'))); $this_row[] = t('!outflightnum', array('!outflightnum' => $person->booking_flightnum_outbound));