public function testAddressServiceDataDoesNotLatLong() { $ticket = new Ticket(); $ticket->setLocation('Somewhere'); $ticket->setLatitude(37); $ticket->setLongitude(-80); $ticket->setAddressServiceData($this->data); $this->assertEquals($this->data['location'], $ticket->getLocation(), 'Address string was not updated from AddressService'); $this->assertEquals(37, $ticket->getLatitude(), 'Latitude was changed from AddressService'); $this->assertEquals(-80, $ticket->getLongitude(), 'Longitude was changed from AddressService'); }
/** * @param Ticket $ticket */ private function addStandardInfoBlocks(Ticket $ticket) { $this->template->blocks['history-panel'][] = new Block('tickets/history.inc', array('history' => $ticket->getHistory())); $this->template->blocks['issue-panel'][] = new Block('tickets/issueList.inc', array('issueList' => $ticket->getIssues(), 'ticket' => $ticket, 'disableButtons' => $ticket->getStatus() == 'closed')); if ($ticket->getLocation()) { $locationBlocks = array('locationInfo', 'masterAddressData', 'locationPeople'); foreach ($locationBlocks as $b) { $this->template->blocks['bottom-left'][] = new Block("locations/{$b}.inc", array('location' => $ticket->getLocation(), 'disableButtons' => true)); } $this->template->blocks['bottom-right'][] = new Block('tickets/ticketLocationInfo.inc', array('ticket' => $ticket)); $table = new TicketTable(); $list = $table->find(array('location' => $ticket->getLocation())); if (count($list) > 1) { $this->template->blocks['bottom-left'][] = new Block('tickets/ticketList.inc', array('ticketList' => $list, 'title' => 'Other cases for this location', 'filterTicket' => $ticket, 'disableButtons' => true)); } } }
/** * @param Ticket $ticket */ private function addLocationInfoBlocks(Ticket $ticket) { if ($ticket->getLocation()) { $this->template->blocks['bottom-left'][] = new Block('locations/locationInfo.inc', array('location' => $ticket->getLocation(), 'disableButtons' => true)); $table = new TicketTable(); $this->template->blocks['bottom-right'][] = new Block('tickets/ticketList.inc', array('ticketList' => $table->find(['location' => $ticket->getLocation()]), 'title' => 'Other tickets for this location', 'disableButtons' => true, 'filterTicket' => $ticket)); } }