public function executeItemshortinline()
 {
     switch (get_class($this->item)) {
         case 'OppPolitico':
             $str = $this->item->__toString();
             $url = '@parlamentare?' . $this->item->getUrlParams();
             $this->title = '';
             break;
         case 'OppAtto':
             $str = $this->item->getRamo() . "." . $this->item->getNumfase();
             $url = '@singolo_atto?id=' . $this->item->getId();
             $this->title = Text::denominazioneAtto($this->item, 'index');
             break;
         case 'Tag':
             $str = $this->item->getTripleValue();
             $url = '@argomento?triple_value=' . $this->item->getTripleValue();
             $this->title = '';
             break;
     }
     $this->str = $str . " (" . $this->item->getNMonitoringUsers() . ")";
     $this->url = $url;
 }
 public function getTitoloCompleto()
 {
     return $this->getTitolo() . ' - ' . Text::denominazioneAtto($this->getOppAtto(), 'list');
 }
                <?php 
    if ($f_signers->next()) {
        ?>
  
                  <?php 
        echo ' da ' . $f_signers->getString(2) . ' ' . $f_signers->getString(3) . ($f_signers->getString(6) != '' ? ' (' . $f_signers->getString(6) . ')' : '') . ($f_signers->next() ? ' e altri' : '');
        ?>
                <?php 
    }
    ?>
          
            </span> 
          </p>
	      <p>
            <?php 
    echo link_to(Text::denominazioneAtto($ddl, 'list'), 'atto/index?id=' . $ddl->getId());
    ?>
          </p>
        </th>  	
        <td>
          <?php 
    if ($ddl->getStatoFase() != '') {
        ?>
            <p class="date"><?php 
        echo format_date($ddl->getStatoLastDate(), 'dd/MM/yyyy');
        ?>
</p>
            <p class="gold"><?php 
        echo $ddl->getStatoFase();
        ?>
</p>
 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;
 }
Ejemplo n.º 5
0
 public function getTitoloCompleto()
 {
     return Text::denominazioneAtto($this, 'list');
 }
    }
    ?>
	      </span>
	
	     <?php 
}
?>
	
	
	


		  <!-- SINOSSI -->
		  <p class="synopsis">
	            <?php 
echo Text::denominazioneAtto($atto, 'index');
?>
    
	          </p>

	      <ul class="presentation float-container" style="margin-bottom:12px;">
	        <li><h6>presentato il: <em><?php 
echo format_date($atto->getDataPres(), 'dd/MM/yyyy');
?>
</em></h6></li>

	        <?php 
if ($tipo_iniziativa != '') {
    ?>
	          <li><h6>tipo di iniziativa: <em><?php 
    echo $tipo_iniziativa;
			<div><b><?php 
    echo link_to('link alla fonte', 'http://aic.camera.it/aic/scheda.html?core=aic&numero=' . $documento->getOppAtto()->getNumfase() . '&ramo=' . $documento->getOppAtto()->getRamo() . '&leg=' . $documento->getOppAtto()->getLegislatura(), array('class' => 'external'));
    ?>
</b>
			<b><?php 
    echo link_to('scarica il documento in PDF', 'http://aic.camera.it/aic/scheda.pdf?core=aic&numero=' . $documento->getOppAtto()->getNumfase() . '&ramo=' . $documento->getOppAtto()->getRamo() . '&leg=' . $documento->getOppAtto()->getLegislatura(), array('class' => 'external'));
    ?>
</b>
			</div>
		<?php 
}
?>
		
		<br />
      <h5 class="subsection">Atto a cui si riferisce:<br /> <?php 
echo link_to(Text::denominazioneAtto($documento->getOppAtto(), 'list'), 'atto/index?id=' . $documento->getOppAtto()->getId());
?>
</h5>
      <br /><br />


		<?php 
if ($documento->getTesto()) {
    ?>
			<?php 
    if ($documento->getOppAtto()->getTipoAttoId() > 1 && $documento->getOppAtto()->getTipoAttoId() < 12) {
        ?>
			<?php 
        echo "<div id='testo_atto'><br />" . $documento->getTesto() . "</div>";
        ?>
			<?php 
/**
 * generate the html representation for the given news
 *
 * @param string $news 
 * @return string (html)
 * @author Guglielmo Celata
 */
function community_news_text($news)
{
    $news_string = "";
    // fetch generator model
    $generator_model = $news->getGeneratorModel();
    // fetch related model and object (item)
    $related_model = $news->getRelatedModel();
    $related_id = $news->getRelatedId();
    $item = call_user_func_array($related_model . 'Peer::retrieveByPK', array($related_id));
    if (is_null($item)) {
        return "notizia su oggetto inesistente: ({$related_model}:{$related_id})";
    }
    // build item link
    switch ($related_model) {
        case 'OppPolitico':
            // link al politico
            $item_type = 'il parlamentare';
            $link = link_to_in_mail($item, '@parlamentare?' . $item->getUrlParams(), array('title' => 'Vai alla scheda del politico'));
            break;
        case 'OppDocumento':
            // link al documento
            $link = link_to_in_mail($item->getTitolo(), '@documento?id=' . $related_id, array('title' => $item->getTitolo()));
            $related_atto = OppAttoPeer::retrieveByPK($item->getAttoId());
            // costruzione del link all'atto relativo al documento
            if (in_array($related_atto->getTipoAttoId(), array(1, 3, 4, 5, 6, 10, 11, 14))) {
                $atto_article = 'all\'';
            } elseif (in_array($related_atto->getTipoAttoId(), array(12, 13, 15, 16, 17))) {
                $atto_article = 'al ';
            } else {
                $atto_article = 'alla ';
            }
            $atto_link = $atto_article . $related_atto->getOppTipoAtto()->getDescrizione() . " ";
            $atto_link .= link_to_in_mail(Text::denominazioneAtto($related_atto, 'list', true), 'atto/index?id=' . $related_atto->getId(), array('title' => $related_atto->getTitolo()));
            break;
        case 'OppAtto':
            // link all'atto
            if (in_array($item->getTipoAttoId(), array(1, 10, 11, 12, 13, 15, 16, 17))) {
                $gender = 'm';
            } else {
                $gender = 'f';
            }
            $item_type = articolo($item->getTipoAttoId()) . $item->getOppTipoAtto()->getDescrizione() . " ";
            $link = link_to_in_mail(Text::denominazioneAtto($item, 'list'), 'atto/index?id=' . $related_id, array('title' => $item->getTitolo()));
            break;
        case 'OppVotazione':
            // link alla votazione
            $item_type = 'la votazione';
            $link = link_to_in_mail($item->getTitolo(), '@votazione?' . $item->getUrlParams(), array('title' => 'Vai alla pagina della votazione'));
            break;
        case 'OppEmendamento':
            // link all'emendamento
            $item_type = 'l\'emendamento';
            $link = link_to_in_mail($item->getTitoloCompleto(), '@singolo_emendamento?id=' . $item->getId(), array('title' => 'Vai alla pagina dell\'emendamento'));
            break;
        case 'Tag':
            // link all'argomento
            $item_type = 'l\'argomento';
            $link = link_to_in_mail($item->getTripleValue(), '@argomento?triple_value=' . $item->getTripleValue(), array('title' => 'Vai alla pagina dell\'argomento'));
            break;
    }
    // build html code
    switch ($generator_model) {
        case 'sfEmendComment':
            // link al documento
            $link = link_to_in_mail($item->getTitolo(), '@documento?id=' . $related_id, array('title' => $item->getTitolo()));
            if ($news->getType() == 'C') {
                return sprintf("<div class='ico-type float-left'>%s</div><p>%s ha commentato il documento</p><p><strong>%s</strong></p><p>relativo %s</p>", image_tag('/images/ico-type-commento.png', array('alt' => 'commento')), strtolower($news->getUsername()), $link, $atto_link);
            }
            break;
        case 'sfComment':
            return sprintf("<div class='ico-type float-left'>%s</div><p>%s ha commentato %s</p><p> %s</p>", image_tag('/images/ico-type-commento.png', array('alt' => 'commento')), strtolower($news->getUsername()), $item_type, $link);
            break;
        case 'Monitoring':
            if ($news->getType() == 'C') {
                if ($news->getTotal() > 0) {
                    if ($news->getTotal() > 1) {
                        return sprintf("<div class='ico-type float-left'>%s</div><p>un utente si è aggiunto agli altri %d che stanno monitorando %s</p><p> %s", image_tag('/images/ico-type-monitoring.png', array('alt' => 'monitor')), $news->getTotal(), $item_type, $link);
                    } else {
                        return sprintf("<div class='ico-type float-left'>%s</div><p>un utente si è aggiunto a un altro che sta monitorando %s</p><p> %s", image_tag('/images/ico-type-monitoring.png', array('alt' => 'monitor')), $item_type, $link);
                    }
                } else {
                    return sprintf("<div class='ico-type float-left'>%s</div><p>un primo utente ha avviato il monitoraggio per %s</p><p> %s", image_tag('/images/ico-type-monitoring.png', array('alt' => 'monitor')), $item_type, $link);
                }
            } else {
                return sprintf("<div class='ico-type float-left'>%s</div><p>un utente ha smesso di monitorare %s</p><p> %s</p>", image_tag('/images/ico-type-monitoring.png', array('alt' => 'monitor')), $item_type, $link);
            }
            break;
        case 'sfVoting':
            if ($news->getType() == 'C') {
                if ($news->getVote() == 1) {
                    $fav_contr = '<span style="color:green; font-weight:bold;">favorevoli</span>';
                } else {
                    $fav_contr = '<span style="color:red; font-weight:bold;">contrari</span>';
                }
                if ($news->getTotal() > 0) {
                    if ($news->getTotal() > 1) {
                        return sprintf("<div class='ico-type float-left'>%s</div><p>un utente si è aggiunto agli altri %d %s al%s </p><p> %s</p>", image_tag('/images/ico-type-votazione-user.png', array('alt' => 'voto')), $news->getTotal(), $fav_contr, $item_type, $link);
                    } else {
                        if (substr_count($fav_contr, 'favorevoli') == 1) {
                            $fav_contr = '<span style="color:green; font-weight:bold;">favorevole</span>';
                        } else {
                            $fav_contr = '<span style="color:red; font-weight:bold;">contrario</span>';
                        }
                        return sprintf("<div class='ico-type float-left'>%s</div><p>un utente si è aggiunto a un altro %s al%s</p><p>%s</p>", image_tag('/images/ico-type-votazione-user.png', array('alt' => 'voto')), $fav_contr, $item_type, $link);
                    }
                } else {
                    if (substr_count($fav_contr, 'favorevoli') == 1) {
                        $fav_contr = '<span style="color:green; font-weight:bold;">favorevole</span>';
                    } else {
                        $fav_contr = '<span style="color:red; font-weight:bold;">contrario</span>';
                    }
                    return sprintf("<div class='ico-type float-left'>%s</div><p>un utente &egrave; %s al%s</p><p> %s</p>", image_tag('/images/ico-type-votazione-user.png', array('alt' => 'voto')), $fav_contr, $item_type, $link);
                }
            } else {
                return sprintf("<div class='ico-type float-left'>%s</div><p>utente ha ritirato il suo voto per %s</p><p> %s</p>", image_tag('/images/ico-type-votazione-user.png', array('alt' => 'voto')), $item_type, $link);
            }
            break;
        case 'nahoWikiRevision':
            return sprintf("<div class='ico-type float-left'>%s</div><p>%s ha modificato la descrizione wiki per %s</p><p> %s</p>", image_tag('/images/ico-type-descrizione.png', array('alt' => 'wiki!')), strtolower($news->getUsername()), $item_type, $link);
            break;
    }
}
 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));
     }
 }
<script src="/js/widget/panel_generator.js" type="text/javascript"></script>
<div class="row">
	<div class="ninecol">
		
		
		<dl class="tool_form bill_status">

	<p>Ecco il widget che hai selezionato. Se vuoi puoi configurare i colori, poi semplicemente copia e incolla il codice HTML, che trovi in fondo alla pagina, nel tuo blog o sito.
	Le informazioni contenute verranno sempre aggiornate </p>
	            <dt><label><?php 
echo $atto->getOppTipoAtto()->getDescrizione();
?>
:</label></dt>
	            <dd style="font-size:1em;padding-top:3px;display:block;"><?php 
echo link_to($atto->getTipoAttoId() == 1 ? $atto->getRamo() . "." . $atto->getNumfase() . " " . $atto->getTitolo() : Text::denominazioneAtto($atto, 'list'), '/singolo_atto/' . $id);
?>
</dd>

	        <input id="panel_bill_id" name="panel[bill_id]" type="hidden" value="<?php 
echo $id;
?>
" />

	        <dt><label for="post_info_url">La tua posizione sull'atto:</label></dt>   
	        <dd><select id="panel_pos_select" name="panel[pos_select]" onChange="updateBillStatusFields('panel_pos');">
	        <option value="0" <?php 
echo $pos == 0 ? 'selected="selected"' : '';
?>
>non voglio visualizzare la mia posizione</option>  
	        <option value="1" <?php 
echo $pos == 1 ? 'selected="selected"' : '';
 /**
  * Executes show action
  *
  * @return void
  * @author Guglielmo Celata
  */
 public function executeShow()
 {
     $this->emendamento = OppEmendamentoPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->attoPortante = $this->emendamento->getAttoPortante();
     $this->relatedAttos = $this->emendamento->getOppAttoHasEmendamentosJoinOppAtto();
     //nel caso di sub-emedamento prendi l'emendamento portante
     if (substr_count($this->emendamento->getTitolo(), "/") == 1) {
         $em_portante = explode("/", $this->emendamento->getNumfase());
         $c = new Criteria();
         $c->addJoin(OppAttoHasEmendamentoPeer::EMENDAMENTO_ID, OppEmendamentoPeer::ID);
         $c->add(OppAttoHasEmendamentoPeer::ATTO_ID, $this->relatedAttos[0]->getAttoId());
         $c->add(OppEmendamentoPeer::NUMFASE, $em_portante[0]);
         $c->add(OppEmendamentoPeer::SEDE_ID, $this->emendamento->getSedeId());
         $this->em_portante = OppEmendamentoPeer::doSelect($c);
     } else {
         $this->em_portante = array();
     }
     // Contralla se emendaneto non abbia sb-emendamenti
     $c = new Criteria();
     $c->addJoin(OppAttoHasEmendamentoPeer::EMENDAMENTO_ID, OppEmendamentoPeer::ID);
     $c->add(OppAttoHasEmendamentoPeer::ATTO_ID, $this->relatedAttos[0]->getAttoId());
     $c->add(OppEmendamentoPeer::NUMFASE, $this->emendamento->getNumfase() . "/%", Criteria::LIKE);
     $c->add(OppEmendamentoPeer::SEDE_ID, $this->emendamento->getSedeId());
     $this->subEmendamenti = OppEmendamentoPeer::doSelect($c);
     $this->getResponse()->setTitle('Emendamento ' . $this->emendamento->getTitolo() . ' al ddl ' . $this->attoPortante->getRamo() . '.' . $this->attoPortante->getNumfase() . ' ' . Text::denominazioneAtto($this->attoPortante, 'index') . ' - ' . sfConfig::get('app_main_title'));
     $this->response->addMeta('description', 'Il testo e gli aggiornamenti emendamento ' . $this->emendamento->getTitolo() . ' al ddl ' . $this->attoPortante->getRamo() . '.' . $this->attoPortante->getNumfase() . ' ' . Text::denominazioneAtto($this->attoPortante, 'index'), true);
 }