Exemplo n.º 1
0
 /**
  * Event handler called from Ticket::handleAdd()
  *
  * Handles the autoClose and autoResponse sending
  * @param Ticket $ticket
  */
 public function onTicketAdd(Ticket &$ticket)
 {
     if ($this->autoCloseIsActive()) {
         $ticket->handleChangeStatus(['status' => 'closed', 'substatus_id' => $this->getAutoCloseSubstatus_id(), 'notes' => AUTO_CLOSE_COMMENT]);
     }
     if ($this->autoResponseIsActive()) {
         foreach ($ticket->getReportedByPeople() as $person) {
             $message = $this->getAutoResponseText();
             # Commenting out the inclusion of a link to the ticket
             #if ($this->allowsDisplay($person)) {
             #    $message.="\n\n{$ticket->getURL()}\n";
             #}
             $person->sendNotification($message, null, $this->getNotificationReplyEmail());
         }
     }
 }