Ejemplo n.º 1
0
 public function executeList()
 {
     $this->processSort();
     $this->processFilters();
     $this->filters = $this->getUser()->getAttributeHolder()->getAll('sf_admin/documento/filters');
     if (isset($this->filters['id_proyecto']) && $this->filters['id_proyecto'] != 0) {
         $this->fases = FasePeer::getFasesEmpresaProyecto($this->filters['id_proyecto']);
         if (isset($this->filters['id_fase']) && $this->filters['id_fase'] != 0) {
             $this->reuniones = ReunionPeer::getListaReuniones($this->filters['id_proyecto'], $this->filters['id_fase']);
         } else {
             $this->reuniones = array();
         }
     } else {
         $this->fases = array();
         $this->reuniones = array();
     }
     $this->pager = new sfPropelPager('Documento', 20);
     // Rober 25-nov-2009: si es administrador, que pueda ver todos los documentos.
     $this->es_administrador = false;
     $usuario = Usuario::getUsuarioActual();
     if ($usuario && $usuario->getEsAdministrador()) {
         $c = new Criteria();
         $this->es_administrador = true;
     } else {
         //Ana: 04-11-09. Filtro por empresa y trabajador.
         $c = DocumentoPeer::getAlcance();
     }
     $this->addSortCriteria($c);
     $this->addFiltersCriteria($c);
     $this->pager->setCriteria($c);
     $this->pager->setPage($this->getRequestParameter('page', 1));
     $this->pager->init();
 }