예제 #1
0
파일: Topics.php 프로젝트: dsyman2/X2CRM
 public function afterSave()
 {
     if ($this->_originalPost->isNewRecord || $this->_postTextChanged) {
         if ($this->_originalPost->isNewRecord) {
             $this->_originalPost->topicId = $this->id;
             $this->_originalPost->assignedTo = Yii::app()->user->getName();
         }
         $this->_originalPost->updatedBy = Yii::app()->user->getName();
         $this->_originalPost->save();
     }
     return parent::afterSave();
 }
예제 #2
0
 public function afterSave()
 {
     $this->saveMetaData();
     if ($this->reminder) {
         if (!$this->isNewRecord) {
             $this->deleteOldNotifications($this->notificationUsers);
         }
         $this->createNotifications($this->notificationUsers, $this->dueDate - $this->notificationTime * 60, 'action_reminder');
     }
     parent::afterSave();
     $association = X2Model::getAssociationModel($this->associationType, $this->associationId);
     if ($this->isNewRecord && $association && $association->hasAttribute('lastActivity')) {
         $association->lastActivity = time();
         $association->update(array('lastActivity'));
         X2Flow::trigger('RecordUpdateTrigger', array('model' => $association));
     }
 }
예제 #3
0
파일: Services.php 프로젝트: dsyman2/X2CRM
 /**
  *
  * @return boolean whether or not to save
  */
 public function afterSave()
 {
     $model = $this->getOwner();
     $oldAttributes = $model->getOldAttributes();
     if ($model->escalatedTo != '' && (!isset($oldAttributes['escalatedTo']) || $model->escalatedTo != $oldAttributes['escalatedTo'])) {
         $event = new Events();
         $event->type = 'case_escalated';
         $event->user = $this->updatedBy;
         $event->associationType = 'Services';
         $event->associationId = $model->id;
         if ($event->save()) {
             $notif = new Notification();
             $notif->user = $model->escalatedTo;
             $notif->createDate = time();
             $notif->type = 'escalateCase';
             $notif->modelType = 'Services';
             $notif->modelId = $model->id;
             $notif->save();
         }
     }
     parent::afterSave();
 }
예제 #4
0
파일: X2List.php 프로젝트: xl602/X2CRM
 public function afterSave()
 {
     if ($this->type == 'dynamic' && isset($this->criteriaInput)) {
         $this->processCriteria();
     }
     return parent::afterSave();
 }
예제 #5
0
파일: Actions.php 프로젝트: keyeMyria/CRM
 public function afterSave()
 {
     $this->saveMetaData();
     return parent::afterSave();
 }