foreach ($lanci as $l) { $lancio = OppAttoPeer::retrieveByPk($l); ?> <li class="float-container"> <div style="margin-right:30px;" class="float-right"><small>utenti:</small></div> <p style="color: #BEBEBE;font-size:11px;font-weight:bold;"> <?php echo format_date($lancio->getDataPres(), 'dd/MM/yyyy'); ?> , <?php echo $lancio->getOppTipoAtto()->getDescrizione(); echo $lancio->getRamo() == 'C' ? ' alla Camera' : ' al Senato'; ?> <?php $f_signers = OppAttoPeer::doSelectPrimiFirmatari($lancio->getId()); ?> <?php if (count($f_signers) > 0) { ?> <?php $c = new Criteria(); ?> <?php $c->add(OppPoliticoPeer::ID, key($f_signers), Criteria::EQUAL); ?> <?php $f_signer = OppPoliticoPeer::doSelectOne($c); ?> <?php echo ' di ' . $f_signer->getCognome() . (count($f_signers) > 1 ? ' e altri' : '');
public function executeAttiInEvidenza() { $namespace = $this->getRequestParameter('namespace'); setlocale(LC_TIME, 'it_IT'); sfLoader::loadHelpers(array('Tag', 'Url', 'DeppNews')); $feed = new sfRss2ExtendedFeed(); $feed->initialize(array('title' => 'Atti in evidenza', 'link' => url_for('@homepage', true), 'feedUrl' => $this->getRequest()->getURI(), 'siteUrl' => 'http://' . sfConfig::get('sf_site_url'), 'image' => 'http://' . sfConfig::get('sf_site_url') . '/images/logo-openparlamento.png', 'language' => 'it', 'authorEmail' => '*****@*****.**', 'authorName' => 'Openparlamento', 'description' => "Openparlamento.it - il progetto Openpolis per la trasparenza del Parlamento", 'sy_updatePeriod' => 'daily', 'sy_updateFrequency' => '1', 'sy_updateBase' => '2000-01-01T12:00+00:00')); $atti = OppAttoPeer::getAttiInEvidenza($namespace); foreach ($atti as $atto) { $description = $atto->getOppTipoAtto()->getDescrizione() . ($atto->getRamo() == 'C' ? ' alla Camera' : ' al Senato'); $f_signers = OppAttoPeer::doSelectPrimiFirmatari($atto->getId()); if (count($f_signers) > 0) { $c = new Criteria(); $c->add(OppPoliticoPeer::ID, key($f_signers)); $f_signer = OppPoliticoPeer::doSelectOne($c); $description .= ' di ' . $f_signer->getCognome() . (count($f_signers) > 1 ? ' e altri' : ''); } $description .= ", presentato il " . $atto->getDataPres('d/M/Y'); $item = new sfRss2ExtendedItem(); $aggiuntivo_only = true; $item->initialize(array('title' => Text::denominazioneAtto($atto, 'list', $aggiuntivo_only), 'link' => url_for('@singolo_atto?id=' . $atto->getId(), true), 'permalink' => url_for('@singolo_atto?id=' . $atto->getId(), true), 'pubDate' => $atto->getStatoLastDate('U') ? $atto->getStatoLastDate('U') : $atto->getDataPres('U'), 'uniqueId' => $atto->getId(), 'description' => $description, 'authorEmail' => '*****@*****.**', 'authorName' => 'Openparlamento')); $feed->addItem($item); } $this->_send_output($feed); return sfView::NONE; }
public function executeWidget() { function tronca($testo, $caratteri) { if (strlen($testo) <= $caratteri) { return $testo; } $nuovo = wordwrap($testo, $caratteri, "|"); $nuovotesto = explode("|", $nuovo); return $nuovotesto[0] . "..."; } $this->bg_color = $this->getRequestParameter('bg_color'); $this->text_color = $this->getRequestParameter('textcolor'); $this->pos = $this->getRequestParameter('pos'); // $this->border_color=retrieveByPk($this->getRequestParameter('border_color')); $atto = OppAttoPeer::retrieveByPk($this->getRequestParameter('bill_id')); $this->id = $atto->getId(); $this->tipo = $atto->getOppTipoAtto()->getDescrizione(); if (substr_count($this->tipo, 'interrogazione') > 0) { $this->tipo = 'interrrogazione'; } if (substr_count($this->tipo, 'risoluzione') > 0) { $this->tipo = 'risoluzione'; } if (substr_count($this->tipo, 'odg') > 0) { $this->tipo = 'ordine del giorno'; } if (substr_count($this->tipo, 'dlgs') > 0) { $this->tipo = 'dlgs'; } $this->ramo = $atto->getRamo(); $this->numfase = $atto->getNumfase(); $this->datapres = $atto->getDataPres(); $this->status = $atto->getStatoFase(); $this->status_data = $atto->getStatoLastDate(); $this->fav = $atto->getUtFav(); $this->contr = $atto->getUtContr(); $this->monitor = $atto->getNMonitoringUsers(); $this->commenti = $atto->getNbPublicComments(); $titolo = ""; $titolos = explode(" ", Text::denominazioneAtto($atto, 'list')); for ($x = 1; $x < count($titolos); $x++) { $titolo = $titolo . " " . $titolos[$x]; } $this->titolo = tronca(trim($titolo), 180); $f_signers = OppAttoPeer::doSelectPrimiFirmatari($atto->getId()); if (count($f_signers) > 0) { $this->firmatario = OppPoliticoPeer::retrieveByPk(key($f_signers)); } }