예제 #1
0
 /**
  * Searches for centrocosto
  */
 public function buscarCCPorLineaAction($centroCosto_id)
 {
     parent::importarJsSearch();
     $numberPage = 1;
     $numberPage = $this->request->getQuery("page", "int");
     $centrocosto = Centrocosto::find(array("centroCosto_lineaId=:linea_id: AND centroCosto_habilitado=1", 'bind' => array('linea_id' => $centroCosto_id)));
     if (count($centrocosto) == 0) {
         $this->flash->notice("No se encontraron resultados en la busqueda");
         return $this->dispatcher->forward(array("controller" => "centrocosto", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $centrocosto, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $this->view->pick('centrocosto/search');
 }
예제 #2
0
 /**
  * Buscar la linea correspondiente a un ID enviado por GET
  * @return bool
  */
 public function buscarLineaPorIdAction()
 {
     if (!$this->request->isGet()) {
         return $this->redireccionar('linea/index');
     }
     parent::importarJsSearch();
     $numberPage = 1;
     $numberPage = $this->request->getQuery("page", "int");
     $linea = Linea::find(array('linea_id=:linea_id:', 'bind' => array('linea_id' => $this->request->get('linea_id')), 'order by' => 'linea_nombre ASC'));
     if (count($linea) == 0) {
         $this->flash->notice("No se encontraron resultados en la búsqueda");
         return $this->dispatcher->forward(array("controller" => "linea", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $linea, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $this->view->pick('linea/search');
 }
예제 #3
0
 /**
  * Searches for archivo
  */
 public function searchAction()
 {
     parent::importarJsSearch();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Archivo", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "archivo_id";
     $archivo = Archivo::find($parameters);
     if (count($archivo) == 0) {
         $this->flash->notice("No se encontraron resultados");
         return $this->dispatcher->forward(array("controller" => "archivo", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $archivo, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
예제 #4
0
 public function verOrdenesAction($planillaId)
 {
     parent::importarJsSearch();
     $numberPage = 1;
     $orden = Orden::findByOrden_planillaId($planillaId);
     if (count($orden) == 0) {
         $this->flash->notice("La planilla seleccionada no contiene ordenes cargadas.");
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "search"));
     }
     $tabla = $this->generarTablaDeOrdenes($orden);
     $paginator = new Paginator(array("data" => $tabla, "limit" => 100000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $planilla = Planilla::findFirstByPlanilla_id($planillaId);
     if ($planilla) {
         $this->view->planilla = $planilla;
     }
     $this->view->pick('orden/search');
 }