Example #1
0
 /**
  * Creacion de una nueva planilla. Al usuario se le solicita unicamente el nombre de la planilla.
  *
  */
 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
     }
     $planilla = new Planilla();
     $planilla->setPlanillaNombrecliente(strtoupper($this->request->getPost("planilla_nombreCliente")));
     $planilla->setPlanillaFecha(Date('Y-m-d'));
     //fecha de creacion de la planilla, current time
     $planilla->setPlanillaArmada(0);
     $planilla->setPlanillaHabilitado(1);
     if (!$planilla->save()) {
         foreach ($planilla->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "new"));
     }
     $this->flashSession->success("La Planilla ha sido creada correctamente, por favor agregue las <strong> columnas extras</strong>");
     $this->view->planilla = $planilla;
     $this->response->redirect('planilla/columnas');
     $this->view->disable();
 }