Changeset 1526
- Timestamp:
- Oct 2, 2010, 8:38:54 PM (10 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/parlementaire/actions/actions.class.php
r1488 r1526 243 243 $this->forward404Unless($this->orga); 244 244 245 $query = Doctrine::getTable('Parlementaire')->createQuery('p') 246 ->select('p.*, po.fonction as fonction, po.importance as imp') 247 ->leftJoin('p.ParlementaireOrganisme po') 248 ->leftJoin('po.Organisme o') 249 ->where('o.slug = ?', $orga) 250 ->andWhere('p.fin_mandat IS NULL') 251 ->orderBy("po.importance DESC, p.nom_de_famille ASC"); 252 $this->parlementaires = array(); 253 $this->total = 0; 254 foreach ($query->execute() as $depute) { 255 $this->total++; 256 $imp = $depute->imp; 257 if (isset($this->parlementaires[$imp])) $this->parlementaires[$imp][] = $depute; 258 else $this->parlementaires[$imp] = array($depute); 259 } 260 $query2 = Doctrine::getTable('Seance')->createQuery('s') 261 ->leftJoin('s.Organisme o') 262 ->where('o.slug = ?', $orga) 263 ->orderBy('s.date DESC, s.moment ASC'); 264 $this->pagerSeances = Doctrine::getTable('Seance')->getPager($request, $query2); 245 $pageS = $request->getParameter('pages', 1); 246 $pageR = $request->getParameter('page', 1); 247 if ($pageS == 1) { 248 if ($pageR == 1) 249 $this->page = "home"; 250 else $this->page = "rapports"; 251 } else $this->page = "seances"; 252 if ($this->page === "home") { 253 $query = Doctrine::getTable('Parlementaire')->createQuery('p') 254 ->select('p.*, po.fonction as fonction, po.importance as imp') 255 ->leftJoin('p.ParlementaireOrganisme po') 256 ->leftJoin('po.Organisme o') 257 ->where('o.slug = ?', $orga) 258 ->andWhere('p.fin_mandat IS NULL') 259 ->orderBy("po.importance DESC, p.nom_de_famille ASC"); 260 $this->parlementaires = array(); 261 $this->total = 0; 262 foreach ($query->execute() as $depute) { 263 $this->total++; 264 $imp = $depute->imp; 265 if (isset($this->parlementaires[$imp])) $this->parlementaires[$imp][] = $depute; 266 else $this->parlementaires[$imp] = array($depute); 267 } 268 } 269 if ($this->page === "home" || $this->page === "seances") { 270 $query2 = Doctrine::getTable('Seance')->createQuery('s') 271 ->leftJoin('s.Organisme o') 272 ->where('o.slug = ?', $orga) 273 ->orderBy('s.date DESC, s.moment ASC'); 274 $this->pagerSeances = Doctrine::getTable('Seance')->getPager($request, $query2); 275 } 276 if ($this->page === "home" || $this->page === "rapports") { 277 $query3 = Doctrine::getTable('Texteloi')->createQuery('t') 278 ->leftJoin('t.Organisme o') 279 ->where('o.slug = ?', $orga) 280 ->orderBy('t.numero DESC, t.annexe ASC'); 281 $this->pagerRapports = new sfDoctrinePager('Texteloi',10); 282 $this->pagerRapports->setQuery($query3); 283 $this->pagerRapports->setPage($pageR); 284 $this->pagerRapports->init(); 285 } 265 286 } 266 287 -
cpc/trunk/project/apps/frontend/modules/parlementaire/templates/_table.php
r1514 r1526 2 2 $ct = 0; 3 3 if (isset($list)) { 4 if (!isset($colonnes)) 5 $colonnes = 3; 6 if (isset($imp)) 7 echo '<h3 class="aligncenter">'.ucfirst($deputes[0]->fonction).(count($deputes) > 1 ? 's' : '').'</h3>'; 4 8 echo '<table><tr>'; 5 9 $totaldep = count($deputes); 6 $div = floor($totaldep/ 3)+1;7 if ($div > 1 && $totaldep % 3== 0)10 $div = floor($totaldep/$colonnes)+1; 11 if ($div > 1 && $totaldep % $colonnes == 0) 8 12 $div--; 9 13 $td = 0; 10 14 if ($totaldep == 1) { 11 echo '<td/><td>'; 15 if ($colonnes == 2) 16 echo '<td class="list_td_small"/>'; 17 else echo '<td/>'; 12 18 $td++; 13 } else if ($ totaldep == 2 || $totaldep == 4)14 echo '<td class="list_td_small"/> <td>';15 e lse echo '<td>';19 } else if ($colonnes != 2 && ($totaldep == 2 || $totaldep == 4)) 20 echo '<td class="list_td_small"/>'; 21 echo '<td>'; 16 22 } 17 23 foreach($deputes as $depute) { … … 31 37 ?></a></span><br/> 32 38 <span class="list_left"> 33 <?php if (isset($imp)) { 34 echo ' '.$depute->fonction; 35 if (!isset($nogroupe)) 36 echo ' — <a href="'.url_for('@list_parlementaires_groupe?acro='.$depute->groupe_acronyme).'"><span class="couleur_'.strtolower($depute->getGroupeAcronyme()).'">'.$depute->getGroupeAcronyme().'</span></a>'; 37 } else 38 echo preg_replace('/\s([A-Z]+)$/', ' <a href="'.url_for('@list_parlementaires_groupe?acro='.$depute->groupe_acronyme).'"><span class="couleur_'.strtolower($depute->getGroupeAcronyme()).'">'."\\1</span></a>", $depute->getStatut()); ?> 39 <?php echo preg_replace('/\s([A-Z]+)$/', ' <a href="'.url_for('@list_parlementaires_groupe?acro='.$depute->groupe_acronyme).'"><span class="couleur_'.strtolower($depute->getGroupeAcronyme()).'">'."\\1</span></a>", $depute->getStatut()); ?> 39 40 </span> 40 41 <span class="list_right"><?php … … 56 57 if (isset($list)) { 57 58 echo '</td>'; 58 if ( $totaldep == 2 || $totaldep == 4)59 if (($colonnes == 2 && $totaldep == 1) || ($colonnes != 2 && ($totaldep == 2 || $totaldep == 4))) 59 60 echo '<td class="list_td_small"/>'; 60 else while ($td < 2) {61 else while ($td < $colonnes - 1) { 61 62 $td++; 62 63 echo '<td/>'; -
cpc/trunk/project/apps/frontend/modules/parlementaire/templates/listOrganismeSuccess.php
r1275 r1526 1 <?php use_helper('Text') ?> 1 2 <h1><?php echo $orga->getNom(); $sf_response->setTitle($orga->getNom()); ?></h1> 2 <?php include_component('article', 'show', array('categorie'=>'Organisme', 'object_id'=>$orga->id)); ?> 3 <?php if ($total && $pagerSeances->getPage() < 2) { 4 if ($orga->type == 'extra') : ?> 5 <h2>Organisme extra-parlementaire composé de <?php echo $total; ?> député<?php if ($total > 1) echo 's'; ?> :</h2> 6 <?php else : ?> 7 <h2><?php if (preg_match('/commission/i', $orga->getNom())) echo 'Comm'; else echo 'M'; ?>ission parlementaire composée de <?php echo $total; ?> député<?php if ($total > 1) echo 's'; ?> :</h2> 8 <?php endif; ?> 9 <div class="liste"> 10 <?php $listimp = array_keys($parlementaires); 11 foreach($listimp as $i) { 3 <?php $nrap = $pagerRapports->getNbResults(); 4 $nse = $pagerSeances->getNbResults(); 5 if ($page === "home") { 6 include_component('article', 'show', array('categorie'=>'Organisme', 'object_id'=>$orga->id)); 7 $divclass = ""; 8 $colonnes = 3; 9 if ($nse || $nrap) { 10 $divclass = '<div class="listeleft">'; 11 $colonnes = 2; 12 } 13 if ($total && $pagerSeances->getPage() == 1 && ($pagerRapports->getPage() == 1)) { 14 if ($orga->type == 'extra') 15 echo '<h2>Organisme extra-parlementaire composé de '.$total.' député'.($total > 1 ? 's' : '').' :</h2>'; 16 else echo '<h2>'.(preg_match('/commission/i', $orga->getNom()) ? 'Comm' : 'M').'ission parlementaire composée de '.$total.' député'.($total > 1 ? 's' : '').' :</h2>'; 17 } 18 echo $divclass.'<div class="liste">'; 19 $listimp = array_keys($parlementaires); 20 foreach ($listimp as $i) { 12 21 echo '<div class="list_table">'; 13 include_partial('parlementaire/table', array('deputes' => $parlementaires[$i], 'list' => 1, ' imp' => $i));22 include_partial('parlementaire/table', array('deputes' => $parlementaires[$i], 'list' => 1, 'colonnes' => $colonnes, 'imp' => $i)); 14 23 echo '</div>'; 15 } 24 } 16 25 echo '</div>'; 17 } 18 if ($pagerSeances->getNbResults()) : ?> 19 <div><h3>Les dernières réunions de la <?php if (preg_match('/commission/i', $orga->getNom())) echo 'Comm'; else echo 'M'; ?>ission</h3> 20 <ul> 21 <?php foreach($pagerSeances->getResults() as $seance) : ?> 22 <li><?php $subtitre = $seance->getTitre(); 23 if ($seance->nb_commentaires > 0) { 24 $subtitre .= ' ('.$seance->nb_commentaires.' commentaire'; 25 if ($seance->nb_commentaires > 1) $subtitre .= 's'; 26 $subtitre .= ')'; 26 } 27 if ($page === "home" && ($nse || $nrap)) 28 echo '</div><div class="listeright">'; 29 else echo '<div>'; 30 if ($page != "seances" && $nrap) { 31 echo '<h3>'; 32 if ($page === "home") 33 echo 'Ses derniers rapports'; 34 else echo 'Rapports de la '.(preg_match('/commission/i', $orga->getNom()) ? 'comm' : 'm').'ission'; 35 echo ' :</h3><ul>'; 36 $curid = 0; 37 foreach($pagerRapports->getResults() as $rap) { 38 $shortid = preg_replace('/-[atv].*$/', '', preg_replace('/[A-Z]/', '', $rap->id)); 39 if ($curid != $shortid) { 40 echo '<li>'; 41 $curid = $shortid; 42 $doctitre = preg_replace('/ (de|pour|par) l[ea\'\s]+ '.$orga->nom.'/i', '', $rap->getTitreCommission()); 43 if ($pagerRapports->getPage() == 1) $doctitre = truncate_text($doctitre, 120); 44 echo link_to($doctitre, '@document?id='.$curid).'</li>'; 45 } 27 46 } 28 echo link_to($subtitre, '@interventions_seance?seance='.$seance->id); ?></li> 29 <?php endforeach ; ?> 30 </ul> 31 <?php include_partial('intervention/paginate', array('pager'=>$pagerSeances, 'link'=>'@list_parlementaires_organisme?slug='.$orga->getSlug().'&')); ?> 47 echo '</ul>'; 48 include_partial('parlementaire/paginate', array('pager'=>$pagerRapports, 'link'=>'@list_parlementaires_organisme?slug='.$orga->getSlug().'&')); 49 } 50 if ($page != "rapports" && $nse) { 51 echo '<h3>'; 52 if ($page === "home") 53 echo 'Ses dernières réunions'; 54 else echo 'Réunions de la '.(preg_match('/commission/i', $orga->getNom()) ? 'comm' : 'm').'ission'; 55 echo ' :</h3><ul>'; 56 $curdate = ""; 57 foreach($pagerSeances->getResults() as $seance) { 58 $newdate = myTools::displayDate($seance->date); 59 if ($curdate != $newdate) { 60 if ($curdate != "") 61 echo '</li>'; 62 $curdate = $newdate; 63 echo '<li>'.$newdate.' : '; 64 } else echo ' — '; 65 $subtitre = $seance->getShortMoment(); 66 if ($seance->nb_commentaires > 0) { 67 $subtitre .= ' (<span class="list_com">'.$seance->nb_commentaires.' commentaire'; 68 if ($seance->nb_commentaires > 1) $subtitre .= 's'; 69 $subtitre .= '</span>)'; 70 } 71 echo link_to($subtitre, '@interventions_seance?seance='.$seance->id); 72 } 73 echo '</ul>'; 74 include_partial('intervention/paginate', array('pager'=>$pagerSeances, 'link'=>'@list_parlementaires_organisme?slug='.$orga->getSlug().'&')); 75 } ?> 32 76 </div> 33 <?php endif; ?> 34 <br/> 77 <?php if ($page != "home") echo '<h3 class="aligncenter">'.link_to('Voir la composition de la commission', '@list_parlementaires_organisme?slug='.$orga->slug).'</h3>'; ?> -
cpc/trunk/project/lib/model/doctrine/Seance.class.php
r1274 r1526 83 83 return $moment; 84 84 } 85 85 86 public function getShortMoment() { 87 return preg_replace('/^0/', '', str_replace('00', '', str_replace(':', 'h', $this->moment))); 88 } 89 86 90 public function setDate($date) { 87 91 if (!$this->_set('date', $date)) -
cpc/trunk/project/lib/model/doctrine/Texteloi.class.php
r1519 r1526 279 279 } 280 280 281 public function getTitreCommission() { 282 $str = $this->getShortTitre(); 283 if ($this->_get('titre')) 284 $str .= " ".$this->_get('titre'); 285 $str = preg_replace('/^,\s*/', '', preg_replace('/\s*,\s*/', ', ', $str)); 286 return $str; 287 } 288 281 289 public function getContenu() { 282 290 $c = $this->_get('contenu'); -
cpc/trunk/project/web/css/xneth/style.css
r1516 r1526 1567 1567 .synthese td, .synthese th { padding: 0px; margin: 0px; text-align: center} 1568 1568 .left { 1569 width: 48%; 1570 float: left; 1571 } 1572 .right{ 1573 float: right; 1574 width: 50%; 1569 width: 48%; 1570 float: left; 1571 } 1572 .right { 1573 float: right; 1574 width: 50%; 1575 } 1576 .listeleft { 1577 float: left; 1578 width: 64%; 1579 } 1580 .listeright { 1581 float: right; 1582 width: 35%; 1575 1583 } 1576 1584 … … 1766 1774 margin-bottom: 30px; 1767 1775 } 1776 .list_table h3 { 1777 margin-top: 0px; 1778 margin-bottom: 5px; 1779 } 1768 1780 .list_table table { 1769 1781 width: 100%;
Note: See TracChangeset
for help on using the changeset viewer.