コード例 #1
1
ファイル: update.class.php プロジェクト: soulcreate/Tickets
 /**
  * @return bool
  */
 public function afterSave()
 {
     $new_thread = $this->object->get('thread');
     if ($this->old_thread != $new_thread) {
         $this->object->changeThread($this->old_thread, $new_thread);
     } else {
         $this->object->clearTicketCache();
     }
     return parent::afterSave();
 }
コード例 #2
0
ファイル: create.class.php プロジェクト: soulcreate/Tickets
 /**
  * @return bool
  */
 public function afterSave()
 {
     if ($this->object->get('published')) {
         $this->thread->fromArray(array('comment_last' => $this->object->get('id'), 'comment_time' => $this->object->get('createdon')));
         $this->thread->save();
     }
     if ($this->guest) {
         if (!isset($_SESSION['TicketComments'])) {
             $_SESSION['TicketComments'] = array('ids' => array());
         }
         $_SESSION['TicketComments']['name'] = $this->object->get('name');
         $_SESSION['TicketComments']['email'] = $this->object->get('email');
         $_SESSION['TicketComments']['ids'][$this->object->get('id')] = 1;
     }
     $this->thread->updateCommentsCount();
     $this->object->clearTicketCache();
     return parent::afterSave();
 }
コード例 #3
0
ファイル: update.class.php プロジェクト: soulcreate/Tickets
 /**
  * @return bool
  */
 public function beforeSave()
 {
     $this->object->fromArray(array('editedon' => time(), 'editedby' => $this->modx->user->isAuthenticated($this->modx->context->key) ? $this->modx->user->id : 0));
     if ($this->guest) {
         $_SESSION['TicketComments']['name'] = $this->object->get('name');
         $_SESSION['TicketComments']['email'] = $this->object->get('email');
     }
     return parent::beforeSave();
 }
コード例 #4
0
ファイル: undelete.class.php プロジェクト: soulcreate/Tickets
 /**
  *
  */
 public function logManagerAction()
 {
     $this->modx->logManagerAction($this->objectType . '_undelete', $this->classKey, $this->object->get($this->primaryKeyField));
 }
コード例 #5
0
 /**
  * @param string $action
  */
 public function logManagerAction($action = '')
 {
     $this->modx->logManagerAction($this->objectType . '_unpublish', $this->classKey, $this->object->get($this->primaryKeyField));
 }