예제 #1
0
 /**
  * Delete all changelog entries from the database.
  */
 public function actionClearChangelog()
 {
     Changelog::model()->deleteAll();
     $this->redirect('viewChangelog');
 }
 /**
  * @param $instructionId
  * @param $columnName
  * @throws CHttpException
  * @return bool
  */
 public function actionShowChangeLogs($instructionId, $columnName)
 {
     $this->layout = "//layouts/new/popup";
     if (!$instructionId) {
         throw new CHttpException(404, 'Instruction id must be passed');
     }
     $historyCriteria = new CDbCriteria();
     $historyCriteria->compare('cha_row', $instructionId, false, 'AND', false);
     $historyCriteria->compare('cha_field', $columnName, false, 'AND', false);
     $historyCriteria->order = 'cha_datetime DESC';
     $dealChangeLog = Changelog::model()->findAll($historyCriteria);
     $this->render('_changeLogs', ['dealChangeLog' => $dealChangeLog]);
 }