Ejemplo n.º 1
0
 protected function afterSave()
 {
     if ($this->isNewModel && !$this->isCompleted) {
         Yii::app()->jobQueue->add('Export', 5);
     }
     parent::afterSave();
 }
 protected function afterSave()
 {
     Yii::app()->custom->resolveOpportunityCustomActionsAfterSave($this);
     parent::afterSave();
 }
Ejemplo n.º 3
0
 /**
  * After a mission is saved, if it is new, then a notification should go out to all users alerting them
  * of a new mission.  Depending on the status change of the mission, a notification can go out as well to
  * the owner or user who has taken the mission.
  */
 protected function afterSave()
 {
     if ($this->isNewModel && $this->getScenario() != 'importModel') {
         MissionsUtil::makeAndSubmitNewMissionNotificationMessage($this);
     }
     if (isset($this->originalAttributeValues['status']) && !$this->isNewModel && $this->originalAttributeValues['status'] != $this->status) {
         if ($this->status == self::STATUS_TAKEN) {
             $messageContent = Zurmo::t('MissionsModule', 'A mission you created has been taken on by {takenByUserName}', array('{takenByUserName}' => strval($this->takenByUser)));
             MissionsUtil::makeAndSubmitStatusChangeNotificationMessage($this->owner, $this->id, $messageContent);
         } elseif ($this->status == self::STATUS_COMPLETED) {
             $messageContent = Zurmo::t('MissionsModule', 'A mission you created has been completed');
             MissionsUtil::makeAndSubmitStatusChangeNotificationMessage($this->owner, $this->id, $messageContent);
         } elseif ($this->status == self::STATUS_REJECTED && $this->takenByUser->id > 0) {
             $messageContent = Zurmo::t('MissionsModule', 'A mission you completed has been rejected');
             MissionsUtil::makeAndSubmitStatusChangeNotificationMessage($this->takenByUser, $this->id, $messageContent);
         } elseif ($this->status == self::STATUS_ACCEPTED && $this->takenByUser->id > 0) {
             $messageContent = Zurmo::t('MissionsModule', 'A mission you completed has been accepted');
             MissionsUtil::makeAndSubmitStatusChangeNotificationMessage($this->takenByUser, $this->id, $messageContent);
         }
     }
     parent::afterSave();
 }
Ejemplo n.º 4
0
 protected function afterSave()
 {
     $this->deleteCampaignItemsForUnsetEmailMessagesIfPausedToggledToActiveStatus();
     $resolveForOldModel = false;
     if (isset($this->originalAttributeValues['status']) && $this->status == static::STATUS_ACTIVE) {
         $resolveForOldModel = true;
     }
     Yii::app()->jobQueue->resolveToAddJobTypeByModelByDateTimeAttribute($this, 'sendOnDateTime', 'CampaignGenerateDueCampaignItems', $resolveForOldModel);
     parent::afterSave();
 }
Ejemplo n.º 5
0
 /**
  * Handle audit of projects after save
  */
 protected function afterSave()
 {
     if ($this->getIsNewModel()) {
         ProjectAuditEvent::logAuditEvent(ProjectAuditEvent::PROJECT_CREATED, $this, $this->name);
     } elseif ($this->status == Project::STATUS_ARCHIVED) {
         ProjectAuditEvent::logAuditEvent(ProjectAuditEvent::PROJECT_ARCHIVED, $this, $this->name);
     }
     parent::afterSave();
 }
Ejemplo n.º 6
0
 /**
  * Handle audit of projects after save
  */
 protected function afterSave()
 {
     if ($this->getIsNewModel()) {
         ProjectAuditEvent::logAuditEvent(ProjectAuditEvent::PROJECT_CREATED, $this, $this->name);
         ProjectsNotificationUtil::submitProjectNotificationMessage($this, ProjectAuditEvent::PROJECT_CREATED);
     } elseif ($this->status == Project::STATUS_ARCHIVED && isset($this->originalAttributeValues['status'])) {
         ProjectAuditEvent::logAuditEvent(ProjectAuditEvent::PROJECT_ARCHIVED, $this, $this->name);
         ProjectsNotificationUtil::submitProjectNotificationMessage($this, ProjectAuditEvent::PROJECT_ARCHIVED);
     }
     parent::afterSave();
 }
Ejemplo n.º 7
0
 protected function afterSave()
 {
     Yii::app()->jobQueue->resolveToAddJobTypeByModelByDateTimeAttribute($this, 'sendOnDateTime', 'CampaignGenerateDueCampaignItems');
     parent::afterSave();
 }
Ejemplo n.º 8
0
 protected function afterSave()
 {
     $this->Contract_Number = 'Agmnt-' . $this->id;
     $this->save();
     parent::afterSave();
 }