Пример #1
0
 /**
  *	Constructor
  *
  *	@return
  */
 public function __construct($args)
 {
     parent::__construct($args);
     $this->_root = $this->_ticket->getRootOfBranch();
     if (is_object($this->_root->state())) {
         $this->_can['reply'] = $this->_root->state()->can('reply');
     } else {
         M('Trace')->trace('ticket_null', 'Warning! State of root ticket cannot be null! TICKET: ' . $this->_ticket->id() . ' ROOT: ' . $this->_root->id());
     }
 }
Пример #2
0
 /**
  * Saves ticket state history
  *
  * @param 	RM_Ticket_Object	obTicket	ticket
  * @param 	RM_Account_iUser	obUser		status changer
  * @return void
  */
 public function saveStateHistory(RM_Ticket_Object $obTicket, RM_Account_iUser $obUser, $time = NULL)
 {
     if (isNull($time)) {
         $time = M('Tools')->date()->dbDateTime();
     }
     $this->_dbh->exec("INSERT INTO " . $this->_tables['state_history'] . " (ticket_id, user_id, state, changed) VALUES (?, ?, ?, ?)", $obTicket->id(), $obUser->id(), $obTicket->state()->name(), $time);
 }