Ejemplo n.º 1
0
 public function domultipleAction()
 {
     $selected = $this->_getParam('selected');
     $ids = split(',', $selected);
     $status = mb_strtolower($this->_getParam('expenseaction'));
     $user = $this->_getParam('user');
     $client = $this->_getParam('clientid');
     $status = $status == 'approve' ? Expense::APPROVED : Expense::DENIED;
     foreach ($ids as $id) {
         $expense = $this->byId($id);
         if ($expense != null) {
             $this->expenseService->setExpenseStatus($expense, $status);
         }
     }
     if ($user) {
         $this->redirect('expense', 'listforuser', array('username' => $user));
     } else {
         $this->redirect('client', 'view', array('id' => $client, '#expenses'));
     }
 }