/**
  * @param REQUEST issue_id
  */
 public function respond()
 {
     // Load the issue
     try {
         $issue = new Issue($_REQUEST['issue_id']);
         $ticket = $issue->getTicket();
     } catch (\Exception $e) {
         $_SESSION['errorMessages'][] = $e;
         header('Location: ' . BASE_URL . '/tickets');
         exit;
     }
     // Handle what the user posts
     if (isset($_POST['contactMethod_id'])) {
         $r = new Response();
         $r->handleUpdate($_POST);
         try {
             $r->save();
             header('Location: ' . $ticket->getURL());
             exit;
         } catch (\Exception $e) {
             $_SESSION['errorMessages'][] = $e;
         }
     }
     // Display the view
     $this->template->setFilename('tickets');
     $this->template->blocks['ticket-panel'][] = new Block('tickets/ticketInfo.inc', array('ticket' => $ticket));
     $this->template->blocks['history-panel'][] = new Block('tickets/history.inc', array('history' => $ticket->getHistory()));
     $this->template->blocks['issue-panel'][] = new Block('tickets/responseForm.inc', array('issue' => $issue));
     $this->addLocationInfoBlocks($ticket);
 }
Example #2
0
 /**
  * Records that someone responded to an issue
  *
  * @param int $index The issue index
  * @param Response $response
  */
 public function addResponse($index, Response $response)
 {
     $response->validate();
     $this->data['issues'][$index]['responses'][] = $response->getData();
 }