Changeset 3085


Ignore:
Timestamp:
Jan 29, 2013, 12:46:03 AM (8 years ago)
Author:
roux
Message:

handle automatically which text to display when multiple ones for the same dossier

Location:
cpc/trunk/project/apps/frontend/modules/section
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/section/actions/components.class.php

    r3065 r3085  
    44{
    55  public function executeSimplifions() {
    6     $this->lois = Doctrine_Query::create()->select('l.texteloi_id, l.titre, l.nb_commentaires')->from('TitreLoi l')->where('l.leveltype = ?', 'loi')->orderBy('l.date DESC')->fetchArray(); //->andWhere('l.nb_commentaires >= 5')
     6    $this->lois = Doctrine_Query::create()->select('l.texteloi_id, l.titre, l.nb_commentaires, t.id_dossier_an')->from('TitreLoi l')->leftJoin('l.Texteloi t')->where('l.leveltype = ?', 'loi')->orderBy('l.date DESC')->fetchArray(); //->andWhere('l.nb_commentaires >= 5')
    77  }
    88
  • cpc/trunk/project/apps/frontend/modules/section/templates/_simplifions.php

    r2788 r3085  
    33<h2>Les dossiers en discussion sur "Simplifions la loi 2.0"</h2>
    44<ul>
    5 <?php foreach($lois as $l) : ?>
     5<?php $done = array(); foreach($lois as $l) if (!isset($done[$l['Texteloi']['id_dossier_an']])) : $done[$l['Texteloi']['id_dossier_an']] = 1; ?>
    66<li><?php echo link_to(strip_tags($l['titre']), "@loi?loi=".$l['texteloi_id']); if ($l['nb_commentaires'] > 0) { echo ' (<span class="list_com">'.$l['nb_commentaires'].' commentaire'; if ($l['nb_commentaires'] > 1) echo 's'; echo '</span>)'; } ?></li>
    7 <?php endforeach; ?>
     7<?php endif; ?>
    88</ul>
    99</div>
Note: See TracChangeset for help on using the changeset viewer.