Beispiel #1
0
 /**
  * Guarda los datos que se editaron.
  *
  */
 public function saveAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
     }
     $planilla_id = $this->request->getPost("planilla_id");
     $planilla = Planilla::findFirstByplanilla_id($planilla_id);
     if (!$planilla) {
         $this->flash->error("La planilla N° " . $planilla_id . " no existe");
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
     }
     $planilla->setPlanillaNombrecliente(strtoupper($this->request->getPost("planilla_nombreCliente")));
     if (!$planilla->save()) {
         foreach ($planilla->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "edit", "params" => array($planilla->planilla_id)));
     }
     $this->flash->success("La planilla ha sido actualizada correctamente");
     return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
 }