public function executeRilevanzaTag() { $this->session = $this->getUser(); $last_date = OppTagHistoryCachePeer::fetchLastData(); // estrae tutte le date per cui esistono dati $this->all_dates = OppTagHistoryCachePeer::extractDates(); $this->all_tags_categories = OppTeseottPeer::doSelect(new Criteria()); // reset dei filtri, se richiesto esplicitamente if ($this->getRequestParameter('reset_filters', 'false') == 'true') { $this->getRequest()->getParameterHolder()->set('filter_tags_category', '0'); $this->getRequest()->getParameterHolder()->set('filter_data', $last_date); } $this->processFilters(array('tags_category', 'data'), $last_date); // if all filters were reset, then restart if ($this->getRequestParameter('filter_tags_category') == '0' && $this->getRequestParameter('filter_data') == $last_date) { $this->redirect('datiStorici/rilevanzaTag'); } $this->processListSort('indice'); if ($this->hasRequestParameter('itemsperpage')) { $this->getUser()->setAttribute('itemsperpage', $this->getRequestParameter('itemsperpage')); } $itemsperpage = $this->getUser()->getAttribute('itemsperpage', sfConfig::get('app_pagination_limit')); $this->pager = new sfPropelPager('OppTagHistoryCache', $itemsperpage); $c = new Criteria(); $c->addJoin(TagPeer::ID, OppTagHistoryCachePeer::CHI_ID); $this->addFiltersCriteriaTag($c); $this->addListSortCriteriaTag($c); $c->addDescendingOrderByColumn(OppTagHistoryCachePeer::CHI_ID); $c->add(OppTagHistoryCachePeer::CHI_TIPO, 'S'); $this->pager->setCriteria($c); $this->pager->setPage($this->getRequestParameter('page', 1)); $this->pager->setPeerMethod('doSelect'); $this->pager->init(); }
public function executeMaggioranzaSalva() { $this->session = $this->getUser(); $this->query = $this->getRequestParameter('query', ''); $this->getResponse()->setTitle('I voti di Camera e Senato in cui la maggioranza di governo e\' stata salvata dai voti dell\'opposizione - ' . sfConfig::get('app_main_title')); $this->response->addMeta('description', 'Il dettaglio delle votazioni elettroniche di Camera e Senato in cui la maggioranza è stata salvata dai voti e dalle assenze dei parlamentari di opposizione.', true); // estrae tutte le macrocategorie, per costruire la select $this->all_tags_categories = OppTeseottPeer::doSelect(new Criteria()); // reset dei filtri se richiesto esplicitamente if ($this->getRequestParameter('reset_filters', 'false') == 'true') { $this->getRequest()->getParameterHolder()->set('filter_tags_category', '0'); $this->getRequest()->getParameterHolder()->set('filter_type', '0'); $this->getRequest()->getParameterHolder()->set('filter_ramo', '0'); $this->getRequest()->getParameterHolder()->set('filter_esito', '0'); } $this->processFilters(array('tags_category', 'type', 'ramo', 'esito')); // if all filters were reset, then restart if ($this->getRequestParameter('filter_tags_category') == '0' && $this->getRequestParameter('filter_type') == '0' && $this->getRequestParameter('filter_ramo') == '0' && $this->getRequestParameter('filter_esito') == '0') { $this->redirect('/votazioni/maggioranzaSalva'); } $this->processListSort(); if ($this->hasRequestParameter('itemsperpage')) { $this->getUser()->setAttribute('itemsperpage', $this->getRequestParameter('itemsperpage')); } $itemsperpage = $this->getUser()->getAttribute('itemsperpage', sfConfig::get('app_pagination_limit')); $this->pager = new sfPropelPager('OppVotazione', $itemsperpage); $c = OppVotazionePeer::getVotazioniMaggioranzaSalva(); $this->addListSortCriteria($c); $this->addFiltersCriteria($c); $this->pager->setCriteria($c); $this->pager->setPage($this->getRequestParameter('page', 1)); $this->pager->setPeerMethod('doSelectJoinOppSeduta'); $this->pager->setPeerCountMethod('doCountJoinOppSeduta'); $this->pager->init(); }
/** * Executes Atto non legislativo list action * */ public function executeAttoNonLegislativoList() { $this->session = $this->getUser(); $this->query = $this->getRequestParameter('query', ''); $this->getResponse()->setTitle('Tutti gli atti non legislativi presentati in Parlamento - ' . sfConfig::get('app_main_title')); $this->response->addMeta('description', 'La lista e gli aggiornamenti su tutte le mozioni, interpellanze, interrogazioni, risoluzioni e ordini del giorno presentati in Parlamento', true); $atti_non_legislativi_ids = array('2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '14'); // estrae tutte le macrocategorie, per costruire la select $this->all_tags_categories = OppTeseottPeer::doSelect(new Criteria()); // reset di filtri e ordinamento se cambio modulo $this->_reset_session_vars(); // reset dei filtri se richiesto esplicitamente if ($this->getRequestParameter('reset_filters', 'false') == 'true') { $this->getRequest()->getParameterHolder()->set('filter_tags_category', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_type', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_ramo', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_stato', '0'); } $this->processFilters(array('tags_category', 'act_type', 'act_ramo', 'act_stato')); // if all filters were reset, then restart if ($this->getRequestParameter('filter_tags_category') == '0' && $this->getRequestParameter('filter_act_type') == '0' && $this->getRequestParameter('filter_act_ramo') == '0' && $this->getRequestParameter('filter_act_stato') == '0') { $this->redirect('@attiNonLegislativi'); } $this->processAttoNonLegislativoListSort(); if ($this->hasRequestParameter('itemsperpage')) { $this->getUser()->setAttribute('itemsperpage', $this->getRequestParameter('itemsperpage')); } $itemsperpage = $this->getUser()->getAttribute('itemsperpage', sfConfig::get('app_pagination_limit')); $this->pager = new sfPropelPager('OppAtto', $itemsperpage); $c = new Criteria(); $this->addAttoNonLegislativoListSortCriteria($c); $c->addDescendingOrderByColumn(OppAttoPeer::DATA_PRES); $c->add(OppAttoPeer::TIPO_ATTO_ID, $atti_non_legislativi_ids, Criteria::IN); $this->addFiltersCriteria($c); $this->pager->setCriteria($c); $this->pager->setPage($this->getRequestParameter('page', 1)); $this->pager->setPeerMethod('doSelectJoinOppTipoAtto'); $this->pager->init(); // estrazione data ultimo aggiornamento $c = new Criteria(); $c->addDescendingOrderByColumn(OppAttoPeer::DATA_AGG); $c->add(OppAttoPeer::TIPO_ATTO_ID, $atti_non_legislativi_ids, Criteria::IN); $this->last_updated_item = OppAttoPeer::doSelectOne($c); }
public function executeAtti() { $this->_getAndCheckParlamentare(); $title = 'Atti presentati in Parlamento da '; if ($this->carica) { if ($this->carica->getTipoCaricaId() == 1) { $ramo = 'C'; } if ($this->carica->getTipoCaricaId() == 4 || $this->carica->getTipoCaricaId() == 5) { $ramo = 'S'; } $this->ramo = $ramo == 'C' ? 'camera' : 'senato'; $title .= $this->ramo == 'camera' ? ' On. ' : ' Sen. '; // if ($this->ramo=='camera') // $this->getResponse()->setTitle('On. '.$this->parlamentare->getNome().' '.$this->parlamentare->getCognome().' - gli atti su cui lavora - '.sfConfig::get('app_main_title')); // else // $this->getResponse()->setTitle('Sen. '.$this->parlamentare->getNome().' '.$this->parlamentare->getCognome().' - gli atti su cui lavora - '.sfConfig::get('app_main_title')); } // else $this->getResponse()->setTitle($this->parlamentare->getNome().' '.$this->parlamentare->getCognome().' - gli atti su cui lavora - '.sfConfig::get('app_main_title')); $this->getResponse()->setTitle($title . $this->parlamentare->getNome() . ' ' . $this->parlamentare->getCognome() . ' - ' . sfConfig::get('app_main_title')); $this->response->addMeta('description', 'Gli atti parlamentari e il loro iter, quotidianamente aggiornato, firmati da ' . $this->parlamentare->getNome() . ' ' . $this->parlamentare->getCognome(), true); $this->session = $this->getUser(); // estrae tutte le macrocategorie, per costruire la select $this->all_tags_categories = OppTeseottPeer::doSelect(new Criteria()); // reset dei filtri se richiesto esplicitamente if ($this->getRequestParameter('reset_filters', 'false') == 'true') { $this->getRequest()->getParameterHolder()->set('filter_tags_category', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_type', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_ramo', '0'); $this->getRequest()->getParameterHolder()->set('filter_act_stato', '0'); } $this->processAttiFilters(array('tags_category', 'act_type', 'act_firma', 'act_stato')); // if all filters were reset, then restart if ($this->getRequestParameter('filter_tags_category') == '0' && $this->getRequestParameter('filter_act_type') == '0' && $this->getRequestParameter('filter_act_firma') == '0' && $this->getRequestParameter('filter_act_stato') == '0') { $this->redirect('@parlamentare_atti?id=' . $this->getRequestParameter('id') . '&slug=' . $this->parlamentare->getSlug()); } $this->processAttiSort(); if ($this->hasRequestParameter('itemsperpage')) { $this->getUser()->setAttribute('itemsperpage', $this->getRequestParameter('itemsperpage')); } $itemsperpage = $this->getUser()->getAttribute('itemsperpage', sfConfig::get('app_pagination_limit')); $this->pager = new sfPropelPager('OppCaricaHasAtto', $itemsperpage); // estrazione cariche parlamentare $cariche_ids = $this->parlamentare->getCaricheCorrentiIds(); $c = new Criteria(); $c->addJoin(OppAttoPeer::ID, OppCaricaHasAttoPeer::ATTO_ID); $c->add(OppCaricaHasAttoPeer::CARICA_ID, $cariche_ids, Criteria::IN); $this->addAttiFiltersCriteria($c); $this->addAttiSortCriteria($c); $c->addDescendingOrderByColumn(OppAttoPeer::DATA_PRES); $this->pager->setCriteria($c); $this->pager->setPage($this->getRequestParameter('page', 1)); $this->pager->setPeerMethod('doSelectJoinOppAtto'); $this->pager->init(); }