Changeset 908
- Timestamp:
- Oct 24, 2009, 6:47:58 PM (11 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/amendement/actions/actions.class.php
r895 r908 164 164 $this->amendements_query = doctrine::getTable('Amendement')->createQuery('a') 165 165 ->whereIn('a.texteloi_id', $this->lois) 166 ->orderBy('a.texteloi_id , a.numero');166 ->orderBy('a.texteloi_id DESC, a.numero'); 167 167 } 168 168 } -
cpc/trunk/project/apps/frontend/modules/amendement/templates/_pagerAmendements.php
r895 r908 13 13 echo 'le projet de loi '; 14 14 echo 'N° '; 15 foreach ($lois as $loi) echo myTools::getLinkLoi($loi).' (liasse PDF dans l\'ordre du texte : '.myTools::getLiasseLoiAN($loi).' ) '; 16 } ?> 15 foreach ($lois as $loi) echo myTools::getLinkLoi($loi).' ('.myTools::getLiasseLoiImpr($loi).', '.myTools::getLiasseLoiAN($loi).') '; } ?> 17 16 </div> 18 17 <div class="interventions"> -
cpc/trunk/project/apps/frontend/modules/section/actions/actions.class.php
r895 r908 48 48 'key' => 'numero', 49 49 'return' => 'value')); 50 $amdmts_lois = Doctrine_Query::create()->select('distinct(a.texteloi_id)')->from('Amendement a')->whereIn('a.texteloi_id', $this->lois)->fetchArray(); 51 $this->lois_amendees = array(); 52 foreach($amdmts_lois as $loi) 53 array_push($this->lois_amendees, $loi['distinct']); 50 54 sort($this->lois); 51 55 sort($this->lois_amendees); 56 52 57 $inters = Doctrine_Query::create() 53 58 ->select('i.id') … … 88 93 public function executeList(sfWebRequest $request) 89 94 { 90 if (!($ order = $request->getParameter('order')))91 $ order = 'plus';95 if (!($this->order = $request->getParameter('order'))) 96 $this->order = 'plus'; 92 97 $query = doctrine::getTable('Section')->createQuery('s') 93 98 ->where('s.id = s.section_id') 94 99 ->andWhere('s.nb_interventions > 5'); 95 if ($ order == 'date') {100 if ($this->order == 'date') { 96 101 $query->orderBy('s.min_date DESC'); 97 102 $this->titre = 'Les derniers dossiers parlementaires'; 98 } else if ($ order == 'plus') {103 } else if ($this->order == 'plus') { 99 104 $query->orderBy('s.nb_interventions DESC'); 100 105 $this->titre = 'Les dossiers parlementaires les plus discutés'; -
cpc/trunk/project/apps/frontend/modules/section/templates/listSuccess.php
r691 r908 2 2 <h1><?php echo $titre; ?></h1> 3 3 <ul> 4 <?php foreach($sections as $s) if ($s->titre) { 5 if (preg_match('/(questions?\s|ordre\sdu\sjour|nomination|suspension\sde\séance|rappels?\sau\srèglement)/i', $s->titre)) continue; 6 echo '<li>'; 7 echo link_to(ucfirst($s->titre), '@section?id='.$s->id); 4 <?php if ($order == 'date') { echo '<li>'; $mois = ""; } 5 foreach($sections as $s) if ($s->titre) { 6 if (preg_match('/(questions?\s|ordre\sdu\sjour|nomination|suspension\sde\séance|rappels?\sau\srèglement)/i', $s->titre)) continue; 7 $moisactuel = myTools::displayDateMoisAnnee($s->min_date); 8 if ($order == 'date' && $mois != $moisactuel) { 9 if ($mois != "") echo '</ul></li><li>'; 10 $mois = $moisactuel; 11 echo '<h3>'.ucfirst($mois).' :</h3><ul>'; 12 } 13 echo '<li>'.link_to(ucfirst($s->titre), '@section?id='.$s->id); 8 14 echo ' ('.$s->nb_interventions.' intervention'; 9 15 if ($s->nb_interventions > 1) echo 's'; 16 if ($order == 'plus') echo ', '.$moisactuel; 10 17 echo ')</li>'; 11 } ?></ul> 12 </div> 18 } 19 if ($order == 'date') echo '</ul>'; ?> 20 </ul></div> -
cpc/trunk/project/apps/frontend/modules/section/templates/showSuccess.php
r895 r908 17 17 <?php foreach ($lois as $loi) echo myTools::getLinkLoi($loi).' '; ?> 18 18 <br/> 19 <?php echo link_to('Tous les amendements à ce dossier', '@find_amendements_by_loi_and_numero?loi='.urlencode(implode(',',$lois)).'&numero=all'); ?> 19 <?php echo link_to('Tous les amendements à ce dossier', '@find_amendements_by_loi_and_numero?loi='.urlencode(implode(',',$lois_amendees)).'&numero=all').' : '; 20 foreach ($lois_amendees as $loi) echo link_to('loi N°'.$loi, '@find_amendements_by_loi_and_numero?loi='.$loi.'&numero=all').' ('.myTools::getLiasseLoiImpr($loi).', '.myTools::getLiasseLoiAN($loi).') '; ?> 20 21 </span> 21 22 <?php } ?> … … 42 43 <?php foreach($section->getSubSections() as $subsection) : 43 44 if ($subsection->id != $section->id) : ?> 44 <li><?php echo link_to($subsection->titre, '@ section?id='.$subsection->id); ?></li>45 <li><?php echo link_to($subsection->titre, '@interventions_seance?seance='.$subsection->getFirstSeance().'#table_'.$subsection->id); ?></li> 45 46 <?php endif; endforeach;?> 46 47 </ul> -
cpc/trunk/project/lib/model/doctrine/Intervention.class.php
r897 r908 138 138 'namespace' => 'loi', 139 139 'key' => 'numero', 140 'return' 140 'return' => 'value'))); 141 141 for ($i = 0 ; $i < count($match[0]) ; $i++) { 142 142 $match_protected = preg_replace('/(\s*)(\d[\d\s\à]*rectifiés?|\d[\d\s\à]*)(,\s*|\s*et\s*)*/', '\1%\2%\3', $match[3][$i]); -
cpc/trunk/project/lib/model/doctrine/Section.class.php
r485 r908 25 25 return $q = doctrine::getTable('Section')->createQuery('s') 26 26 ->where('s.section_id = ?', $this->id) 27 ->orderBy('s.min_date ASC, s.timestamp ASC')->execute() 28 ; 27 ->orderBy('s.min_date ASC, s.timestamp ASC')->execute(); 28 } 29 public function getFirstSeance() { 30 $q = doctrine_query::create() 31 ->from('Seance s, Section st, Intervention i') 32 ->select('s.id') 33 ->where('i.seance_id = s.id') 34 ->andwhere('i.section_id = st.id') 35 ->andWhere('(st.section_id = ? OR i.section_id = ? )', array($this->id, $this->id)) 36 ->groupBy('s.id') 37 ->orderBy('st.min_date ASC, st.timestamp ASC')->fetchOne(); 38 return $q->id; 29 39 } 30 40 public function getSeances() { -
cpc/trunk/project/lib/model/doctrine/myTools.class.php
r895 r908 23 23 } else return $date; 24 24 } 25 25 26 public static function displayDateMoisAnnee($date) { 27 if (preg_match('/(\d{4})-(\d{2})-(\d{2})/', $date, $match)) { 28 return self::$num_mois[$match[2]].' '.$match[1]; 29 } else return $date; 30 } 31 26 32 public static function displayDateTime($d) { 27 33 $date = substr($d,8,2)."/"; // jour … … 37 43 38 44 public static function getLiasseLoiAN($id) { 39 return link_to(' AN', "http://recherche2.assemblee-nationale.fr/amendements/resultats.jsp?typeEcran=avance&chercherDateParNumero=non&NUM_INIT=".$id."&NUM_AMEND=&AUTEUR=&DESIGNATION_ARTICLE=&DESIGNATION_ALINEA=&SORT_EN_SEANCE=&DELIBERATION=&NUM_PARTIE=&DateDebut=&DateFin=&periode=&LEGISLATURE=13Amendements&QueryText=&Scope=TEXTEINTEGRAL&SortField=ORDRE_TEXTE&SortOrder=Asc&format=PDF&searchadvanced=Rechercher");45 return link_to('liasse Assemblée', "http://recherche2.assemblee-nationale.fr/amendements/resultats.jsp?typeEcran=avance&chercherDateParNumero=non&NUM_INIT=".$id."&NUM_AMEND=&AUTEUR=&DESIGNATION_ARTICLE=&DESIGNATION_ALINEA=&SORT_EN_SEANCE=&DELIBERATION=&NUM_PARTIE=&DateDebut=&DateFin=&periode=&LEGISLATURE=13Amendements&QueryText=&Scope=TEXTEINTEGRAL&SortField=ORDRE_TEXTE&SortOrder=Asc&format=PDF&searchadvanced=Rechercher"); 40 46 } 41 47 42 48 public static function getLiasseLoiImpr($id) { 43 return link_to(' imprimable', "/liasses/liasse_".$id.".pdf");49 return link_to('liasse imprimable', "/liasses/liasse_".$id.".pdf"); 44 50 } 45 51
Note: See TracChangeset
for help on using the changeset viewer.