Ejemplo n.º 1
0
 protected function onModelSaved($model)
 {
     if ($model instanceof ExpenseReport) {
         // Check to see if the expense date is set.
         if (!empty($model->paiddate)) {
             // make sure to update all child expenses to mark when it was
             // paid
             $this->expenseService->markPaidExpenses($model);
         }
         if ($this->_getParam('username')) {
             $this->redirect('expense', 'listforuser', array('username' => $this->_getParam('username')));
         } else {
             $this->redirect('client', 'view', array('id' => $this->_getParam('clientid'), '#expenses'));
         }
     } else {
         /*if ($model->clientid) {
               $this->redirect('client', 'view', array('id'=>$model->clientid, '#expenses'));            
           } else {*/
         $this->redirect('expense', 'listforuser', array('username' => $model->username));
         //}
     }
 }