/**
  * Executes any command triggered on the admin page.
  */
 protected function processAdminCommand()
 {
     if (isset($_POST['command'], $_POST['id']) && $_POST['command'] === 'delete') {
         $trans = Trans::model()->findbyPk($_POST['id']);
         ChangeLog::addLog('DELETE', 'Trans', $trans->toString());
         $trans->delete();
         // reload the current page to avoid duplicated delete actions
         $this->refresh();
     }
 }
 /**
  * Executes any command triggered on the admin page.
  */
 protected function processAdminCommand()
 {
     if (isset($_POST['command'], $_POST['id']) && $_POST['command'] === 'delete') {
         $deletePeriod = $this->loadPeriod($_POST['id']);
         if (Yii::app()->user->getState('allowReEditingOfTransactions') || Trans::model()->find('periodId=' . $_POST['id']) == null) {
             ChangeLog::addLog('DELETE', 'Period', $deletePeriod->toString());
             $deletePeriod->delete();
             $usersModel = User::model()->findbyPk(Yii::app()->user->id);
             $usersModel->setStates(true);
         }
         // reload the current page to avoid duplicated delete actions
         $this->refresh();
     }
 }
 /**
  * Executes any command triggered on the admin page.
  */
 protected function processAdminCommand()
 {
     if (isset($_POST['command'], $_POST['id']) && $_POST['command'] === 'delete') {
         $deleteUser = $this->loadUser($_POST['id']);
         ChangeLog::addLog('DELETE', 'User', $deleteUser->toString());
         $deleteUser->delete();
         // reload the current page to avoid duplicated delete actions
         $this->refresh();
     }
 }
 /**
  * Executes any command triggered on the admin page.
  */
 protected function processAdminCommand()
 {
     if (isset($_POST['command'], $_POST['id']) && $_POST['command'] === 'delete') {
         $deletecompany = $this->loadCompany($_POST['id']);
         ChangeLog::addLog('DELETE', 'Company', $deletecompany->toString());
         $deletecompany->delete();
         $usersModel = User::model()->findbyPk(Yii::app()->user->id);
         $usersModel->setStates(true);
         // reload the current page to avoid duplicated delete actions
         $this->refresh();
     }
 }