Ejemplo n.º 1
0
 /**
  * Before save operations
  */
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->created = time();
         $this->userid = Yii::app()->user->id;
     }
     // Increase the revision id by 1
     $this->revisionid = $this->maxPageRevision();
     return parent::beforeSave();
 }
Ejemplo n.º 2
0
 /**
  * afterSave event
  *
  */
 public function afterSave()
 {
     $this->activity['projectid'] = $this->projectid;
     $this->activity['type'] = Activity::TYPE_TICKET;
     if ($this->isNewRecord) {
         $this->activity['title'] = 'Created a new ticket <strong>{tickettitle}</strong>';
     } else {
         $this->activity['title'] = 'Updated ticket <strong>{tickettitle}</strong>';
     }
     // Append project params
     $this->activity['params'] = array_merge($this->activity['params'], array('{tickettitle}' => $this->getLink()));
     // Activity: New Project
     Activity::log($this->activity);
     return parent::afterSave();
 }
Ejemplo n.º 3
0
 /**
  * afterSave event
  *
  */
 public function afterSave()
 {
     // @todo add activity log
     return parent::afterSave();
 }
Ejemplo n.º 4
0
 /**
  * After delete event
  */
 public function afterDelete()
 {
     $this->activity['projectid'] = $this->projectid;
     $this->activity['type'] = Activity::TYPE_WIKI;
     $this->activity['title'] = "Deleted The Wiki Page: <strong>{pagetitle}</strong> and all it's revisions.";
     // Append project params
     $this->activity['params'] = array_merge($this->activity['params'], array('{pagetitle}' => $this->title));
     // Activity: New Project
     Activity::log($this->activity);
     return parent::afterDelete();
 }