diff --git a/src/Controller/TicketController.php b/src/Controller/TicketController.php index 7c18ee6f..2d8551c8 100644 --- a/src/Controller/TicketController.php +++ b/src/Controller/TicketController.php @@ -96,6 +96,20 @@ class TicketController extends Controller // process rows $rows = []; foreach ($obj_rows as $orow) { + // check for the ticket types (legacy vs new) + $ttype = ''; + $new_ticket_type = $orow->getNewTicketType(); + if ($new_ticket_type == null) + { + // get legacy ticket type + $ttype = TicketType::getName($orow->getTicketType()); + } + else + { + // use new ticket type + $ttype = $orow->getNewTicketType()->getName(); + } + // add row data $row['id'] = $orow->getID(); $row['date_create'] = $orow->getDateCreate()->format("d M Y g:i A"); @@ -103,7 +117,7 @@ class TicketController extends Controller $row['last_name'] = $orow->getLastName(); $row['contact_num'] = $orow->getContactNumber(); $row['status'] = TicketStatus::getName($orow->getStatus()); - $row['ticket_type'] = TicketType::getName($orow->getTicketType()); + $row['ticket_type'] = $ttype; $row['plate_number'] = $orow->getPlateNumber(); // add row metadata diff --git a/src/Entity/Ticket.php b/src/Entity/Ticket.php index c8efee8f..d2a19569 100644 --- a/src/Entity/Ticket.php +++ b/src/Entity/Ticket.php @@ -195,6 +195,9 @@ class Ticket public function getTicketTypeText() { + if ($this->new_ticket_type != null) + return $this->new_ticket_type->getName(); + if ($this->ticket_type == LegacyTicketType::OTHER) { return $this->other_ticket_type; } else {