Changeset 1367
- Timestamp:
- Sep 12, 2010, 12:21:27 PM (10 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 9 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/config/routing.yml
r1365 r1367 3 3 recherche_solr: 4 4 url: /solr/:query 5 param: {module: solr, action: search, query: ''} 6 5 param: {module: solr, action: search, query: ""} 6 7 document: 8 url: /document/:id 9 param: {module: documents, action: show} 7 10 8 11 loi_redirect_article: -
cpc/trunk/project/apps/frontend/modules/amendement/actions/actions.class.php
r1274 r1367 48 48 ->fetchArray(); 49 49 50 $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($this->amendement->texteloi_id); 50 $this->titreloi = Doctrine::getTable('TitreLoi')->findLightLoi($this->amendement->texteloi_id); 51 $this->loi = Doctrine::getTable('Texteloi')->findLoi($this->amendement->texteloi_id); 51 52 } 52 53 … … 147 148 $this->lois = split(',', $request->getParameter('loi')); 148 149 $amdt = $request->getParameter('numero'); 150 $this->forward404Unless(count($this->lois) && $amdt); 149 151 if ($amdt == 'all' || $amdt == 'new' ) { 150 if (count($this->lois) == 1) 152 if (count($this->lois) == 1) { 151 153 $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($this->lois[0]); 154 if (!$this->loi) 155 $this->loi = Doctrine::getTable('Texteloi')->findLoi($this->lois[0]); 156 } 152 157 $this->amendements_query = Doctrine::getTable('Amendement') 153 158 ->createQuery('a') 154 ->whereIn('a.texteloi_id', $this->lois) 155 ->andWhere('a.sort <> ?', 'Rectifié'); 159 ->where('a.sort <> ?', 'Rectifié'); 160 for ($ct=0;$ct<count($this->lois);$ct++) 161 $this->amendements_query->andWhere('a.texteloi_id = ?', $this->lois[$ct]); 156 162 if ($amdt == 'new') 157 163 $this->amendements_query->orderBy('a.texteloi_id DESC, a.created_at DESC, a.source'); -
cpc/trunk/project/apps/frontend/modules/amendement/templates/_pagerAmendements.php
r1177 r1367 7 7 <p> pour la recherche sur <em>"<?php echo strip_tags($mots); ?>"</em></p> 8 8 <?php } } 9 else if (isset($loi)) {10 echo ' sur '.link_to( preg_replace('/(Simplifions la loi 2\.0 : )?(.*)\s*<br.*$/', '\2', $loi->titre), '@loi?loi='.$loi->texteloi_id).' ('.myTools::getLiasseLoiAN($loi->texteloi_id).', '.myTools::getLiasseLoiImpr($loi->texteloi_id).')';11 }else if (isset($lois)) {9 else if (isset($loi)) 10 echo ' sur '.link_to($loi->getTitre(), "@document?id=".$loi->id).' ('.myTools::getLiasseLoiAN($loi->id).')'; 11 else if (isset($lois)) { 12 12 echo ' portant sur '; 13 13 if (count($lois) > 1) echo 'les projets de loi '; … … 15 15 echo 'le projet de loi '; 16 16 echo 'N° '; 17 foreach ($lois as $loi) echo myTools::getLinkLoi($loi).' ('.myTools::getLiasseLoiAN($loi).') '; } ?>17 foreach ($lois as $loi) echo link_to($loi, '@document?id='.$loi).' ('.myTools::getLiasseLoiAN($loi).') '; } ?> 18 18 </div> 19 19 <?php if ($pager->haveToPaginate()) { … … 35 35 if (isset($highlight)) 36 36 $args['highlight'] = $highlight; 37 if (isset($loi ->titre)) $args['loi'] = $loi->titre;37 if (isset($loi)) $args['loi'] = $loi->getTitre(); 38 38 echo include_component('amendement', 'parlementaireAmendement', $args); 39 39 } -
cpc/trunk/project/apps/frontend/modules/amendement/templates/_parlementaireAmendement.php
r1188 r1367 2 2 $titre = $amendement->getTitre(); 3 3 if (isset($loi)) { 4 $loi = preg_replace('/(Simplifions la loi 2\.0 : )?(.*)\s*<br.*$/', '\2', $loi);5 4 $titre = str_replace('Projet de loi N° '.$amendement->texteloi_id, $loi, $titre); 6 5 } ?> -
cpc/trunk/project/apps/frontend/modules/amendement/templates/findSuccess.php
r1125 r1367 28 28 <?php foreach($amendements as $a) :?> 29 29 <li><?php 30 echo link_to('Amendement n°'.$a->numero.' portant sur le texte de loin°'.$a->texteloi_id.', '.$a->sujet, '@amendement?loi='.$a->texteloi_id.'&numero='.$a->numero); ?></li>30 echo link_to('Amendement n°'.$a->numero.' portant sur le texte n°'.$a->texteloi_id.', '.$a->sujet, '@amendement?loi='.$a->texteloi_id.'&numero='.$a->numero); ?></li> 31 31 <?php endforeach; ?> 32 32 </ul> -
cpc/trunk/project/apps/frontend/modules/amendement/templates/showSuccess.php
r1186 r1367 26 26 echo link_to($sous['numero'], '@amendement?loi='.$sous['texteloi_id'].'&numero='.$sous['numero']).' '; ?></p> 27 27 <?php } ?> 28 <p>Déposé le <?php echo myTools::displayDate($amendement->date); ?> par : <?php echo $amendement->getSignataires(1); ?>.</p> 28 29 <div class="signataires"> 29 <p>Déposé le <?php echo myTools::displayDate($amendement->date); ?> par : <?php echo $amendement->getSignataires(1); ?>.</p>30 <?php31 $deputes = $amendement->getParlementaires(); ?>32 30 <div class="photos"><p> 33 <?php $n_auteurs = count($deputes); $line = floor($n_auteurs/(floor($n_auteurs/16)+1)); $ct = 0; foreach ($deputes as $depute) { 34 $titre = $depute->nom.', '.$depute->groupe_acronyme; 35 if ($ct != 0 && $ct != $n_auteurs-1 && !($ct % $line)) echo '<br/>'; $ct++; 36 echo '<a href="'.url_for($depute->getPageLink()).'"><img width="50" height="64" title="'.$titre.'" alt="'.$titre.'" src="'.url_for('@resized_photo_parlementaire?height=70&slug='.$depute->slug).'" /></a> '; 37 } ?></p></div> 31 <?php $deputes = $amendement->Parlementaires; 32 include_partial('parlementaire/photos', array("deputes" => $deputes)); ?> 33 </p></div> 38 34 </div> 39 35 <div class="sujet"> 40 36 <h3><?php $sujet = $amendement->getSujet(); 41 if ($ loi && preg_match('/^(.*)?(article\s*)((\d+|premier).*)$/i', $sujet, $match)) {37 if ($titreloi && preg_match('/^(.*)?(article\s*)((\d+|premier).*)$/i', $sujet, $match)) { 42 38 $art = preg_replace('/premier/i', '1er', $match[3]); 43 39 $art = preg_replace('/\s+/', '-', $art); … … 45 41 } 46 42 echo $sujet.' '; 47 if ($ loi) echo '— '.link_to(preg_replace('/(Simplifions la loi 2\.0 : )?(.*)\s*<br.*$/', '\2', $loi->titre), '@loi?loi='.$loi->texteloi_id);48 else echo 'de la loi N° '.myTools::getLinkLoi($amendement->texteloi_id);43 if ($titreloi) echo '— '.link_to(preg_replace('/(Simplifions la loi 2\.0 : )?(.*)\s*<br.*$/', '\2', $loi->titre), '@loi?loi='.$loi->texteloi_id); 44 else if ($loi) echo 'du '.link_to($loi->getTitre(), '@document?id='.$loi->id); 49 45 if ($l = $amendement->getLettreLoi()) echo "($l)"; ?></h3> 50 46 </div> … … 70 66 <div class="commentaires" id="commentaires"> 71 67 <?php if ($amendement->nb_commentaires == 0) 72 echo '<h3 >Aucun commentaire n\'a encore été formulé sur cet amendement</h3>';68 echo '<h3 class="list_com">Aucun commentaire n\'a encore été formulé sur cet amendement</h3>'; 73 69 else echo include_component('commentaire', 'showAll', array('object' => $amendement)); 74 70 echo include_component('commentaire', 'form', array('object' => $amendement)); ?> -
cpc/trunk/project/apps/frontend/modules/commentaire/actions/actions.class.php
r1294 r1367 14 14 public function executePost(sfWebRequest $request) 15 15 { 16 $redirect_url = array('Intervention' => '@intervention?id=', 'Amendement' => '@amendement_id?id=', 'QuestionEcrite' => '@question_id?id=', 'ArticleLoi' => '@loi_article_id?id=', 'Alinea' => '@loi_alinea?id=');16 $redirect_url = array('Intervention' => '@intervention?id=', 'Amendement' => '@amendement_id?id=', 'QuestionEcrite' => '@question_id?id=', 'ArticleLoi' => '@loi_article_id?id=', 'Alinea' => '@loi_alinea?id=', 'Texteloi' => '@document?id='); 17 17 $about = array('Intervention' => "Suite aux propos d", 'Amendement' => "Au sujet d'un amendement déposé", 'QuestionEcrite' => "A propos d'une question écrite d"); 18 18 … … 104 104 $commentaire->lien = $redirect_url[$this->type].$this->id; 105 105 $object = Doctrine::getTable($this->type)->find($this->id); 106 if (isset($object->texteloi_id)) { 107 $loi = Doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id); 106 if ($this->type === 'Texteloi') 107 $present = $object->getShortTitre(); 108 else if (isset($object->texteloi_id)) { 109 $titreloi = Doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id); 110 $loi = Doctrine::getTable('Texteloi')->findLoi($object->texteloi_id); 108 111 if ($this->type != 'Amendement') { 109 $present = preg_replace('/<br\/>.*$/', '', $loi['titre']).' - A propos de l\'article '; 112 if ($titreloi) 113 $present = preg_replace('/<br\/>.*$/', '', $titreloi['titre']).' - A propos de l\'article '; 114 else if($loi) 115 $present = $loi->getTitre().' - A propos de l\'article n°'.$object->numero; 110 116 if ($this->type == 'Alinea') { 111 117 $article = Doctrine::getTable('ArticleLoi')->createQuery('a') … … 117 123 } else $present .= $object->titre; 118 124 } else { 119 if ($loi) 120 $present = preg_replace('/<br\/>.*$/', '', $loi['titre']).' - A propos de l\'amendement n°'.$object->numero; 125 if ($titreloi) 126 $present = preg_replace('/<br\/>.*$/', '', $titreloi['titre']).' - A propos de l\'amendement n°'.$object->numero; 127 else if ($loi) 128 $present = $loi->getShortTitre().' - A propos de l\'amendement n°'.$object->numero; 121 129 else $present = $about[$this->type].' le '.date('d/m/Y', strtotime($object->date)); 122 130 } … … 156 164 if ($object->parlementaire_id) 157 165 $commentaire->addObject('Parlementaire', $object->parlementaire_id); 158 } else if ($this->type == 'Amendement') {166 } else if ($this->type === 'Amendement' || $this->type === 'Texteloi') { 159 167 $object->Parlementaires; 160 168 if (isset($object->Parlementaires)) foreach($object->Parlementaires as $p) … … 162 170 if ($section = $object->getSection()) 163 171 $commentaire->addObject('Section', $section->getSection(1)->id); 164 if ( !($seance = $object->getIntervention($object->numero))) {172 if ($this->type === 'Amendement' && !($seance = $object->getIntervention($object->numero))) { 165 173 $identiques = Doctrine::getTable('Amendement')->createQuery('a') 166 174 ->where('content_md5 = ?', $object->content_md5) … … 169 177 if ($seance) break; 170 178 $seance = $object->getIntervention($a->numero); 171 } 172 } 173 if ( $seance)179 } 180 } 181 if (isset($seance)) 174 182 $commentaire->addObject('Seance', $seance['seance_id']); 175 if ( $loi) {183 if (isset($titreloi)) { 176 184 if (preg_match('/^Article\s+(.*)$/', $object->sujet, $match)) { 177 185 $art = preg_replace('/premier/i', '1er', $match[1]); 178 186 if ($art_obj = Doctrine::getTable('ArticleLoi')->findOneByLoiTitre($object->texteloi_id,$art)) 179 187 $commentaire->addObject('ArticleLoi', $art_obj->id); 180 } else $commentaire->addObject('TitreLoi', $loi->id); 188 } else $commentaire->addObject('TitreLoi', $titreloi->id); 189 $commentaire->addObject('Texteloi', $titreloi->texteloi_id); 181 190 } 182 191 } … … 197 206 $commentaire->addObject('TitreLoi', $object->titre_loi_id); 198 207 } 208 if (isset($object->texteloi_id)) { 209 if ($object->texteloi_id) 210 $commentaire->addObject('Texteloi', $object->texteloi_id); 211 } 212 199 213 200 214 $pas_confirme_mail = ''; -
cpc/trunk/project/apps/frontend/modules/commentaire/actions/components.class.php
r1294 r1367 22 22 $query = Doctrine::getTable('Commentaire') 23 23 ->createQuery('c'); 24 if ($type == 'ArticleLoi')24 if ($type === 'ArticleLoi' || $type === 'Texteloi') 25 25 $query->leftJoin('c.Objects co') 26 ->where('(c.object_type = ? AND c.object_id = ?) OR (co.object_type = "ArticleLoi" AND co.object_id = ?)', array($type, $id, $id));26 ->where('(c.object_type = ? AND c.object_id = ?) OR (co.object_type = "'.$type.'" AND co.object_id = ?)', array($type, $id, $id)); 27 27 else $query->where('(c.object_type = ? AND c.object_id = ?)', array($type, $id)); 28 28 if ($citid = $this->getUser()->getAttribute('user_id')) -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/_showAll.php
r964 r1367 1 <h3 id="commentaires" ><?php echo $object->nb_commentaires.' commentaire';1 <h3 id="commentaires" class="list_com"><?php echo $object->nb_commentaires.' commentaire'; 2 2 if ($object->nb_commentaires > 1) echo 's'; ?> :</h3> 3 3 <?php foreach($commentaires as $c) : -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/_showAllCitoyen.php
r1275 r1367 1 <h2 ><?php $comments = count($commentaires);1 <h2 class="list_com"><?php $comments = count($commentaires); 2 2 if ($comments == 0) echo "Aucun commentaire"; 3 3 else echo '<span class="list_com">'.$comments." commentaire".($comments > 1 ? 's' : '').'</span>'; -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/_showCommentaire.php
r1102 r1367 7 7 <div class="commentaire_avatar"><?php include_component('citoyen','avatarCitoyen', array('citoyen_id'=>$c->citoyen_id)); ?></div> 8 8 <p><?php echo $c->commentaire; ?></p> 9 <?php 10 if(!$c->is_public) 11 echo "<p><strong>Attention, ce commentaire est en attente de 12 validation par email. Les autres utilisateurs ne peuvent pas le 13 voir.</strong></p>"; 9 <?php if(!$c->is_public) 10 echo "<p><strong>Attention, ce commentaire est en attente de validation par email. Les autres utilisateurs ne peuvent pas le voir.</strong></p>"; 14 11 ?> 15 <p class="clear" align="right">Vous trouvez ce commentaire constructif 12 <p class="clear" align="right">Vous trouvez ce commentaire constructif : <?php include_component('rate', 'show', array('object' => $c)); ?> </p> 16 13 </div> -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/listSuccess.php
r1255 r1367 5 5 <?php } ?> 6 6 <div class="last_commentaires"> 7 <p ><?php if (isset($object)) {7 <p class="list_com"><?php if (isset($object)) { 8 8 if ($object->nb_commentaires > 0) { 9 9 echo $object->nb_commentaires.' commentaire'; -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/showAjaxSuccess.php
r1076 r1367 1 1 <div class="com_ajax" id='com_ajax_<?php echo $id; ?>' style="display: none"><?php if ($ct = count($comments)) { ?> 2 <div><h4 ><?php if (isset($limit)) echo 'Les derniers commentaires';2 <div><h4 class="list_com"><?php if (isset($limit)) echo 'Les derniers commentaires</span>'; 3 3 else { 4 4 echo $ct.' commentaire'; -
cpc/trunk/project/apps/frontend/modules/intervention/templates/_parlementaireIntervention.php
r1349 r1367 69 69 if ($intervention->nb_commentaires == 1) $commenttitre = 'Voir le commentaire'; 70 70 else $commenttitre = 'Voir les commentaires'; 71 echo ' — '.link_to($commenttitre, '/intervention/'.$intervention->id.'#commentaires'); } ?></p>71 echo ' — <span class="list_com">'.link_to($commenttitre, '/intervention/'.$intervention->id.'#commentaires').'</span>'; } ?></p> 72 72 </div> 73 73 <?php if (isset($complete)) { ?> 74 74 <div id="commentaires"> 75 75 <?php if ($intervention->nb_commentaires == 0) 76 echo '<h3 >Aucun commentaire n\'a encore été formulé sur cette intervention</h3>';76 echo '<h3 class="list_com">Aucun commentaire n\'a encore été formulé sur cette intervention</h3>'; 77 77 else echo include_component('commentaire', 'showAll', array('object'=>$intervention)); 78 78 echo include_component('commentaire', 'form', array('object'=>$intervention)); ?> -
cpc/trunk/project/apps/frontend/modules/intervention/templates/seanceSuccess.php
r1109 r1367 39 39 <div class="interventions"> 40 40 <?php if (!count($interventions)) { ?> 41 <p><em> Nous n'avons pas encore pu récupérer le contenu de cette séance, veuillez nous en excuser</em></p>41 <p><em>Le contenu de cette séance n'a pas encore été rendu public par les services de l'Assemblée nationale.</em></p> 42 42 <?php } else { $table = ''; $titre = 0; $source_displayed = 0; 43 43 foreach($interventions as $intervention) : … … 104 104 <?php if (!$didascalie) : ?> 105 105 <div class="commentaires" id='com_<?php echo $intervention->id; ?>' style="clear: both;"> 106 <span class="com_link " id="com_link_<?php echo $intervention->id; ?>"><a href="<?php echo url_for('@intervention?id='.$intervention->id); ?>#commentaires">Voir tous les commentaires</a> - </span><span><a href="<?php echo url_for('@intervention?id='.$intervention->id); ?>#ecrire">Laisser un commentaire</a></span>106 <span class="com_link list_com" id="com_link_<?php echo $intervention->id; ?>"><a href="<?php echo url_for('@intervention?id='.$intervention->id); ?>#commentaires">Voir tous les commentaires</a> - </span><span class="list_com"><a href="<?php echo url_for('@intervention?id='.$intervention->id); ?>#ecrire">Laisser un commentaire</a></span> 107 107 </div> 108 108 <?php endif; ?> -
cpc/trunk/project/apps/frontend/modules/loi/actions/actions.class.php
r1274 r1367 59 59 ->andWhere('a.sort <> ?', 'Rectifié') 60 60 ->execute()); 61 61 $this->dossier = Doctrine_Query::create() 62 ->select('s.id') 63 ->from('Section s, Tagging ta, Tag t') 64 ->where('s.section_id = s.id') 65 ->andWhere('ta.taggable_id = s.id') 66 ->andWhere('ta.tag_id = t.id') 67 ->andWhere('ta.taggable_model = ?', "Section") 68 ->andWhere('t.name = ?', "loi:numero=".preg_replace('/^(\d+)-.*/', '\\1', $loi_id)) 69 ->fetchOne(); 70 62 71 $this->response->setTitle(strip_tags($this->loi->titre).' - NosDéputés.fr'); 63 72 $request->setParameter('rss', array(array('link' => '@loi_rss_commentaires?loi='.$loi_id, 'title'=>'Les commentaires sur '.$this->loi->titre))); -
cpc/trunk/project/apps/frontend/modules/loi/templates/alineaSuccess.php
r1066 r1367 12 12 <div class="commentaires" id="commentaires"> 13 13 <?php if ($alinea->nb_commentaires == 0) 14 echo '<h3 >Aucun commentaire n\'a encore été formulé sur cet alinéa</h3>';14 echo '<h3 class="list_com">Aucun commentaire n\'a encore été formulé sur cet alinéa</h3>'; 15 15 else echo include_component('commentaire', 'showAll', array('object' => $alinea)); 16 16 echo include_component('commentaire', 'form', array('object' => $alinea)); -
cpc/trunk/project/apps/frontend/modules/loi/templates/articleSuccess.php
r1150 r1367 27 27 echo '</p>'; 28 28 } 29 if (isset($expose)) echo $expose.'<div class="suivant "><a href="#commentaires">Commenter</a></div>'; ?>29 if (isset($expose)) echo $expose.'<div class="suivant list_com"><a href="#commentaires">Commenter</a></div>'; ?> 30 30 <br/> 31 31 <table> … … 59 59 </div> 60 60 <div class="commentaires" id="commentaires"> 61 <h3 ><?php if ($article->nb_commentaires == 0)61 <h3 class="list_com"><?php if ($article->nb_commentaires == 0) 62 62 echo 'Aucun commentaire n\'a encore été formulé sur cet article</h3>'; 63 63 else echo include_component('commentaire', 'showAll', array('object' => $article, 'presentation' => 'noarticle')); -
cpc/trunk/project/apps/frontend/modules/loi/templates/loiSuccess.php
r1255 r1367 1 <?php if ($dossier) echo '<div class="source">'.link_to('Dossier relatif', '@section?id='.$dossier->id)."</div>"; ?> 1 2 <div class="loi"><h1><?php echo $loi->titre; ?></h1></div> 2 3 <?php if ($loi->source) echo '<p class="source"><a href="'.$loi->source.'" rel="nofollow">Source</a></p><div class="clear"></div>'; -
cpc/trunk/project/apps/frontend/modules/parlementaire/templates/tagSuccess.php
r1355 r1367 1 1 <?php if (!$tag) { 2 $titre = 'Trouver un député par mot s-clés prononcé'; ?>2 $titre = 'Trouver un député par mot-clé'; ?> 3 3 <h1><?php echo $titre; ?></h1> 4 4 <div class="liste_deputes_tags"> -
cpc/trunk/project/apps/frontend/modules/questions/templates/showSuccess.php
r1179 r1367 32 32 <div class="commentaires"> 33 33 <?php if ($question->nb_commentaires == 0) 34 echo '<h3 >Aucun commentaire n\'a encore été formulé sur cette question</h3>';34 echo '<h3 class="list_com">Aucun commentaire n\'a encore été formulé sur cette question</h3>'; 35 35 else echo include_component('commentaire', 'showAll', array('object' => $question)); 36 36 echo include_component('commentaire', 'form', array('object' => $question)); ?> -
cpc/trunk/project/apps/frontend/modules/section/actions/actions.class.php
r1355 r1367 58 58 if ($this->section->url_an || $lois) { 59 59 $qtextes = Doctrine_Query::create() 60 ->select('t.id, t.type, t.type_details, t.titre ')60 ->select('t.id, t.type, t.type_details, t.titre, t.signataires') 61 61 ->from('Texteloi t') 62 62 ->whereIn('t.numero', $lois); … … 67 67 68 68 $textes_loi = Doctrine_Query::create() 69 ->select('t.texteloi_id, t.titre ')69 ->select('t.texteloi_id, t.titre, t.nb_commentaires') 70 70 ->from('TitreLoi t') 71 71 ->whereIn('t.texteloi_id', $lois) … … 74 74 ->orderBy('t.texteloi_id') 75 75 ->fetchArray(); 76 77 foreach ($textes_loi as $doc) 78 $this->docs[$doc['texteloi_id']] = $doc; 76 79 77 foreach ($textes as $texte) 80 78 $this->docs[$texte['id']] = $texte; 81 foreach ($lois as $loi) { 82 $loi = sprintf("%04d", $loi); 79 foreach ($textes_loi as $texte) 80 $this->docs[$texte['texteloi_id']] = $texte; 81 foreach ($lois as $loi) 83 82 if (!isset($this->docs["$loi"])) 84 $this->docs["$loi"] = null; 85 } 86 87 $amdmts_lois = Doctrine_Query::create()->select('distinct(a.texteloi_id)')->from('Amendement a')->whereIn('a.texteloi_id', $lois)->fetchArray(); 88 $this->lois_amendees = array(); 89 foreach($amdmts_lois as $loi) 90 array_push($this->lois_amendees, $loi['distinct']); 91 sort($this->lois_amendees); 83 $this->docs["$loi"] = 1; 92 84 } 93 85 -
cpc/trunk/project/apps/frontend/modules/section/templates/listSuccess.php
r1355 r1367 21 21 if ($s->nb_commentaires > 1) echo 's'; 22 22 if ($s->nb_commentaires > 0) echo '</span>'; 23 if ($order == 'plus') echo ', '.$moisactuel;23 if ($order != 'date') echo ', '.$moisactuel; 24 24 echo ')'; 25 25 } -
cpc/trunk/project/apps/frontend/modules/section/templates/showSuccess.php
r1355 r1367 12 12 else echo '</h1>'; 13 13 ?> 14 <div class="numeros_textes">15 14 <?php if ($section->nb_commentaires) { ?> 16 <div class="source"><span class="list_com"><a href="#commentaires">Voir le<?php if ($section->nb_commentaires > 1) echo 's '.$section->nb_commentaires; ?> commentaire<?php if ($section->nb_commentaires > 1) echo 's'; ?></a></span></div>15 <div class="source"><span class="list_com"><a href="#commentaires">Voir le<?php if ($section->nb_commentaires > 1) echo 's '.$section->nb_commentaires; ?> commentaire<?php if ($section->nb_commentaires > 1) echo 's'; ?></a></span></div><div class="clear"></div> 17 16 <?php } ?> 18 <p>19 <?php $curid = 0;20 if ($docs) foreach ($docs as $id => $doc) {21 $shortid = preg_replace('/^(\d{4}).*$/', '\\1', $id);22 if ($curid != $shortid) {23 $curid = $shortid;24 if (isset($doc['texteloi_id']))25 echo link_to(strip_tags($doc['titre']), '@loi?loi='.$doc['id']);26 else if (isset($doc['id']))27 echo $doc['type']." ".$doc['type_details']." ".$doc['titre']." (".$doc['id'].")";28 else29 echo 'Texte N° '.myTools::getLinkLoi($doc);30 echo "<br/>";31 }32 }33 if (isset($lois_amendees)) echo link_to('Tous les amendements à ce dossier', '@find_amendements_by_loi_and_numero?loi='.urlencode(implode(',',$lois_amendees)).'&numero=all')."</p>";34 ?>35 </div>36 17 <div class="resume"> 37 18 <div class="right"> 38 19 <div class="nuage_de_tags"> 39 20 <h3>Mots-clés de cette section</h3> 40 21 <?php echo include_component('tag', 'tagcloud', array('hide'=>1, 'tagquery' => $qtag, 'model' => 'Intervention', 'limit'=>40, 'route' => '@tag_section_interventions?section='.$section->id.'&')); ?> 41 22 </div> 42 23 </div> … … 47 28 </div> 48 29 </div> 49 <div class="clear" />30 <div class="clear"></div> 50 31 <?php $sommaire = $section->getSubSections(); 51 32 if (count($sommaire)) { ?> … … 57 38 <li><?php $subtitre = $subsection->titre; 58 39 if ($subsection->nb_commentaires > 0) { 59 $subtitre .= ' (<span class="list_com">'.$subsection->nb_commentaires.' 40 $subtitre .= ' (<span class="list_com">'.$subsection->nb_commentaires.' commentaire'; 60 41 if ($subsection->nb_commentaires > 1) $subtitre .= 's'; 61 42 $subtitre .= '</span>)'; … … 65 46 </ul> 66 47 </div> 48 <?php } ?> 67 49 <div class="left"> 68 <?php } else echo '<div>'; ?> 50 <?php if ($docs) { 51 echo '<div class="documents"><h2>Documents législatifs</h2><ul>'; 52 $curid = 0; 53 foreach ($docs as $id => $doc) { 54 $shortid = preg_replace('/-[at].*$/', '', $id); 55 if ($curid != $shortid) { 56 echo "<li>"; 57 $curid = $shortid; 58 if (isset($doc['texteloi_id'])) { 59 $doctitre = "N°$curid en débat sur NosDéputés.fr : ".strip_tags($doc['titre']); 60 if ($doc['nb_commentaires']) 61 $doctitre .= " (".$doc['nb_commentaires']." commentaire"; 62 if ($doc['nb_commentaires'] > 1) 63 $doctitre .= "s"; 64 if ($doc['nb_commentaires']) 65 $doctitre .= ")"; 66 echo '<span class="list_com">'.link_to($doctitre, '@loi?loi='.$doc['texteloi_id']).'</span>'; 67 } else if (isset($doc['id'])) { 68 $amendements = Texteloi::getAmdmts($doc['type'], $curid, 1); 69 $doctitre = $doc['type']." N° $curid"; 70 if (!preg_match('/^,/', $doc['type_details'])) 71 $doctitre .= " "; 72 $doctitre .= $doc['type_details']; 73 if (preg_match('/mixte paritaire/', $doc['signataires'])) 74 $doctitre .= " de la Commission mixte paritaire"; 75 if ($doc->nb_commentaires) 76 $doctitre .= ' (<span class="list_com">'.$doc->nb_commentaires.' commentaire'; 77 if ($doc->nb_commentaires > 1) 78 $doctitre .= "s"; 79 if ($doc->nb_commentaires) { 80 $doctitre .= "</span>"; 81 if ($amendements) 82 $doctitre .= ", "; 83 else $doctitre .= ")"; 84 } else if ($amendements) 85 $doctitre .= " ("; 86 if ($amendements) 87 $doctitre .= $amendements.' amendement'; 88 if ($amendements > 1) 89 $doctitre .= "s"; 90 if ($amendements) 91 $doctitre .= ")"; 92 echo link_to($doctitre, '@document?id='.$curid); 93 } else 94 echo 'Texte N° '.myTools::getLinkLoi($doc); 95 echo '</li>'; 96 } 97 } 98 echo '</ul></div>'; 99 } ?> 69 100 <div class="seances_dossier"> 70 101 <h2>Toutes les séances consacrées à ce dossier</h2> -
cpc/trunk/project/apps/frontend/modules/tag/actions/components.class.php
r1152 r1367 59 59 $cpt++; 60 60 $this->tags[$tag]['tag'] = $tag; 61 $this->tags[$tag]['class'] = $class[$count]; 61 if (isset($this->fixlevel)) 62 $this->tags[$tag]['class'] = 3; 63 else $this->tags[$tag]['class'] = $class[$count]; 62 64 $this->tags[$tag]['related'] = implode('|', $related); 63 65 } -
cpc/trunk/project/apps/frontend/modules/tag/templates/_tagcloud.php
r1355 r1367 1 1 <div class="internal_tag_cloud"> 2 <?php $ keys = array_keys($tags);2 <?php $ct = 1; $keys = array_keys($tags); 3 3 if (count($keys)) { foreach($keys as $tag) : ?> 4 <span class="tag_level_<?php echo $tags[$tag]['class']; ?>"><a href="<?php 4 <span class="tag_level_<?php echo $tags[$tag]['class']; ?>"><?php if (isset($route)) { 5 echo '<a href="'; 5 6 $rel = $tags[$tag]['related']; 6 7 //$rel = preg_replace('/\s+/', ' ', $rel); … … 10 11 $rel = preg_replace('/^iZ/', 'î', $rel); 11 12 $rel = preg_replace('/^IZ/', 'Î', $rel); 12 echo url_for($route.'tags='.$rel); ?>" title="<?php echo $tags[$tag]['count']; ?>"><?php 13 echo url_for($route.'tags='.$rel); ?>" title="<?php echo $tags[$tag]['count']; ?>"><? 14 } else if ($ct % 2 == 0) echo '<br/>'; 13 15 $nom = preg_replace('/\s+/', ' ', $tags[$tag]['tag']); 14 16 $nom = preg_replace('/^aZ/', 'â', $nom); … … 17 19 $nom = preg_replace('/^iZ/', 'î', $nom); 18 20 $nom = preg_replace('/^IZ/', 'Î', $nom); 19 echo $nom; ?></a> <?php 20 ?></span><?php endforeach; 21 echo $nom; 22 if (isset($route)) { ?></a> <?php } 23 ?></span><?php $ct++; endforeach; 21 24 } else { ?> 22 <span><em> Désolé, aucun mot-clé pertinenttrouvé</em></span>25 <span><em>Aucun mot-clé trouvé</em></span> 23 26 <?php } ?></div> -
cpc/trunk/project/apps/frontend/templates/layout.php
r1363 r1367 78 78 <div id="item5"><a href="<?php echo url_for('@faq')?>"><span class="gris">FAQ</span></a></div> 79 79 </div> 80 <?php $search = strip_tags($sf_request->getParameter('search')); ?>80 <?php $search = strip_tags($sf_request->getParameter('search')); if (!$search) $search = "Rechercher..."; ?> 81 81 <div class="menu_recherche"> 82 82 <form action="<?php echo url_for('@recherche_solr'); ?>" method="get"> 83 83 <p> 84 <input class="rechercher" name="search" type="text" size=" 15" value="<?php echo $search; ?>"/>84 <input class="rechercher" name="search" type="text" size="25" value="<?php echo $search; ?>"/> 85 85 <input class="bouton_ok" value="" type="submit"/> 86 86 </p> -
cpc/trunk/project/bin/updateDB3.sh
r1355 r1367 7 7 #cat bin/updateDB3.model.sql | mysql $MYSQLID $DBNAME 8 8 php symfony doctrine:build --all --no-confirmation 9 zcat data/sql/dumps/nosdeputes_prod.10091 0.sql.gz | mysql --default-character-set=utf8 $MYSQLID $DBNAME9 zcat data/sql/dumps/nosdeputes_prod.100911.sql.gz | mysql --default-character-set=utf8 $MYSQLID $DBNAME 10 10 11 11 cat bin/updateDB3.1.sql | mysql $MYSQLID $DBNAME -
cpc/trunk/project/config/doctrine/schema.yml
r1366 r1367 387 387 rate: integer 388 388 object_type: string(64) 389 object_id: integer389 object_id: string(16) 390 390 lien: string(128) 391 391 presentation: string(512) -
cpc/trunk/project/lib/model/doctrine/Commentaire.class.php
r1330 r1367 72 72 } else if ($object_type == 'ArticleLoi' && $object->titre_loi_id) 73 73 $this->addObject('TitreLoi', $object->titre_loi_id); 74 else if ($object_type == 'Texteloi' && $section = $object->getSection()) 75 $this->addObject('Section', $section->id); 74 76 } 75 77 } -
cpc/trunk/project/lib/model/doctrine/Intervention.class.php
r1361 r1367 12 12 13 13 public function getPersonne() { 14 sfProjectConfiguration::getActive()->loadHelpers(array('Url'));15 14 return $this->getIntervenant()->getNom(); 16 15 } … … 225 224 } 226 225 } 226 if (preg_match('/<i>n[°os\s]*([\d,\set]+)<\/i>/', $inter, $match)) { 227 sfProjectConfiguration::getActive()->loadHelpers(array('Url')); 228 foreach (explode(',', preg_replace('/\s+/', '', $match[1])) as $loi) 229 $inter = preg_replace('/'.$loi.'/', '<a href="'.url_for('@document?id='.$loi).'">'.$loi.'</a>', $inter); 230 } 227 231 } 228 232 return $inter; -
cpc/trunk/project/lib/model/doctrine/OrganismeTable.class.php
r1334 r1367 12 12 if (isset($commissions[$nom]) && $org = $this->findOneByNom($commissions[$nom])) 13 13 return $org; 14 $comcor = str_replace('’', '\'', $nom); 15 if (isset($commissions[$comcor]) && $org = $this->findOneByNom($commissions[$comcor])) 16 return $org; 17 $comcor = str_replace('\'', '’', $nom); 18 if (isset($commissions[$comcor]) && $org = $this->findOneByNom($commissions[$comcor])) 19 return $org; 14 20 } 15 21 … … 23 29 24 30 if ($org) { 25 // echo $org->nom."- $nom (trouve)\n"; 26 31 // echo $org->nom."- $nom (trouve)\n"; 27 32 if (strlen($nom) > strlen($org->nom)) { 28 33 $org->nom = $nom; … … 31 36 return $org; 32 37 } 33 //echo "- $nom (pas trouve)\n";38 // echo "- $nom (pas trouve)\n"; 34 39 35 40 … … 38 43 $res = similar_text($o->nom, $nom, $pc); 39 44 if ($pc > 95) { 40 //echo "$nom $pc\n".$o->nom."\n";45 // echo "$nom $pc\n".$o->nom."\n"; 41 46 $org = $o; 42 47 break; -
cpc/trunk/project/lib/model/doctrine/ParlementaireTexteloi.class.php
r1333 r1367 2 2 3 3 /** 4 * ParlementaireTexte Loi4 * ParlementaireTexteloi 5 5 * 6 6 * This class has been auto-generated by the Doctrine ORM Framework … … 11 11 * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ 12 12 */ 13 class ParlementaireTexte Loi extends BaseParlementaireTexteLoi13 class ParlementaireTexteloi extends BaseParlementaireTexteloi 14 14 { 15 15 } -
cpc/trunk/project/lib/model/doctrine/ParlementaireTexteloiTable.class.php
r1333 r1367 2 2 3 3 4 class ParlementaireTexte LoiTable extends Doctrine_Table4 class ParlementaireTexteloiTable extends Doctrine_Table 5 5 { 6 6 7 7 public static function getInstance() 8 8 { 9 return Doctrine_Core::getTable('ParlementaireTexte Loi');9 return Doctrine_Core::getTable('ParlementaireTexteloi'); 10 10 } 11 11 } -
cpc/trunk/project/lib/model/doctrine/Texteloi.class.php
r1366 r1367 2 2 3 3 /** 4 * Texte Loi4 * Texteloi 5 5 * 6 6 * This class has been auto-generated by the Doctrine ORM Framework … … 11 11 * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ 12 12 */ 13 class Texte Loi extends BaseTexteLoi13 class Texteloi extends BaseTexteloi 14 14 { 15 15 16 public function getAmendements() { 17 if (!preg_match('/(Projet de loi|Proposition de loi|Proposition de résolution|Texte de la commission)/', $this->type)) 16 public function getLink() { 17 sfProjectConfiguration::getActive()->loadHelpers(array('Url')); 18 return url_for('@document?id='.$this->id); 19 } 20 21 public function getPersonne() { 22 $auteurs = $this->getAuteurs(); 23 if (!$auteurs) return ""; 24 return $auteurs[0]['nom']; 25 } 26 27 public function getAmendements($help = 0) { 28 return self::getAmdmts($this->type, $this->numero, $help); 29 } 30 31 public static function getAmdmts($type, $numero, $help = 0) { 32 if (!($type === "Rapport" && $help) && !preg_match('/(Projet de loi|Proposition de loi|Proposition de résolution|Texte de la commission)/', $type)) 18 33 return 0; 19 34 $res = count(Doctrine::getTable('Amendement')->createQuery('a') 20 ->where('texteloi_id = ?', $ this->numero)35 ->where('texteloi_id = ?', $numero) 21 36 ->fetchArray()); 22 37 return $res; 23 38 } 24 39 25 public function get Dossier() {40 public function getSection() { 26 41 $section = Doctrine::getTable('Section')->findOneByUrlAn($this->url_an); 27 42 if (!$section) $section = Doctrine_Query::create() … … 90 105 $organisme = Doctrine::getTable('Organisme')->findOneByNomType($orga, 'parlementaire'); 91 106 if ($organisme) { 92 $this->set('Organisme', $organisme); 107 $this->setOrganisme($organisme); 108 if (!($this->type_details)) { 109 $this->type_details = "de l"; 110 if (preg_match('/^[aeiouyh]/i', $organisme->nom)) 111 $this->type_details .= "'"; 112 else if (preg_match('/^comit/i', $organisme)) 113 $this->type_details .= "e "; 114 else $this->type_details .= "a "; 115 $this->type_details .= $organisme->nom; 116 } 93 117 $orga = $organisme->nom; 94 118 } else { 95 119 $groupe = Doctrine::getTable('Organisme')->findOneByNomType($orga, 'groupe'); 96 120 if ($groupe) { 97 $this->set ('Organisme',$groupe);121 $this->setOrganisme($groupe); 98 122 $orga = " pour le groupe ".$orga; 99 123 } 100 124 } 125 $this->save(); 101 126 break; 102 127 } … … 162 187 public function getTypeString() { 163 188 $str = "ce"; 164 if (preg_match('/(propos|lettre)/ ', $this->type))189 if (preg_match('/(propos|lettre)/i', $this->type)) 165 190 $str .= "tte"; 191 else if ($this->type === "Avis") 192 $str .= "t"; 166 193 $str .= " ".strtolower($this->type); 167 194 return $str; 168 195 } 169 196 170 171 public function getAuteursString() { 172 if ($this->type === "Texte de la commission") 173 return $this->signataires; 174 return $this->signataires; 197 public function getAuteurs() { 198 return Doctrine_Query::create() 199 ->select('p.*, pt.fonction') 200 ->from('Parlementaire p') 201 ->leftJoin('p.ParlementaireTexteloi pt') 202 ->where('pt.importance < 4') 203 ->andWhere('pt.texteloi_id = ?', $this->id) 204 ->orderBy('pt.importance, p.sexe, p.nom') 205 ->fetchArray(); 206 } 207 208 public function getCosignataires() { 209 return Doctrine_Query::create() 210 ->select('p.*, pt.fonction') 211 ->from('Parlementaire p') 212 ->leftJoin('p.ParlementaireTexteloi pt') 213 ->where('pt.importance >= 4') 214 ->andWhere('pt.texteloi_id = ?', $this->id) 215 ->orderBy('pt.importance, p.sexe, p.nom') 216 ->fetchArray(); 217 } 218 219 public function getSignatairesString() { 220 $str = preg_replace('/ (Cosignataire|Auteur|Rapporteur)/', '', $this->signataires); 221 return $str; 175 222 } 176 223 … … 183 230 } 184 231 185 public function get TitreComplet() {232 public function getShortTitre() { 186 233 $str = ""; 187 234 if ($this->annexe && preg_match('/a/', $this->id)) { 188 $str .= "Annexe N° ".$annexe." ";235 $str .= "Annexe N° ".$this->annexe." "; 189 236 if ($this->type === "Avis") 190 237 $str .= "à l'"; 191 238 else $str .= "au "; 192 239 } 193 $str .= $this->type; 240 $str .= $this->type." N° ".$this->numero; 241 return $str; 242 } 243 244 public function getTitre() { 245 $str = $this->getShortTitre(); 194 246 if (!preg_match('/^,/', $this->type_details)) 195 247 $str .= " "; 196 248 $str .= $this->type_details; 197 if (!preg_match('/^,/', $this-> titre))249 if (!preg_match('/^,/', $this->_get('titre'))) 198 250 $str .= " "; 199 $str .= $this-> titre;251 $str .= $this->_get('titre'); 200 252 if ($this->annexe && preg_match('/t/', $this->id)) 201 $str .= " (Tome $annexe)";253 $str .= " (Tome ".$this->annexe.")"; 202 254 return $str; 203 255 } … … 212 264 } 213 265 214 public function getLink() {215 sfProjectConfiguration::getActive()->loadHelpers(array('Url'));216 return url_for('@homepage');217 }218 219 public function getPersonne() {220 return '';221 }222 266 } -
cpc/trunk/project/lib/model/doctrine/TexteloiTable.class.php
r1361 r1367 2 2 3 3 4 class Texte LoiTable extends ObjectCommentableTable {4 class TexteloiTable extends ObjectCommentableTable { 5 5 6 6 public static function getInstance() { 7 return Doctrine_Core::getTable('Texte Loi');7 return Doctrine_Core::getTable('Texteloi'); 8 8 } 9 9 10 10 public function findLoi($num) { 11 11 $doc = $this->createQuery('t') 12 ->where('id in ? or id like ?', array(array($num, $num."-a0"), $num."-t%"))13 ->andWhere('type in?', array('Projet de loi', 'Proposition de loi', 'Proposition de résolution', 'Texte de la commission'))12 ->where('id = ? or id = ? or id like ?', array($num, $num."-a0", $num."-t%")) 13 ->andWhere('type = ? or type = ? or type = ? or type = ?', array('Projet de loi', 'Proposition de loi', 'Proposition de résolution', 'Texte de la commission')) 14 14 ->orderBy('numero, annexe') 15 15 ->fetchOne(); -
cpc/trunk/project/lib/task/loadDocumentsTask.class.php
r1366 r1367 18 18 while (($file = readdir($dh)) != false) { 19 19 if ($file == ".." || $file == "." || $file == ".svn") continue; 20 //print $file."\n";21 20 foreach(file($dir.$file) as $line) { 22 21 $json = json_decode($line); … … 27 26 } 28 27 if (!$json->source) 29 {echo " source missing\n"; continue;}28 {echo "ERROR source : $dir$file\n"; continue;} 30 29 if (!$json->legislature) 31 {echo " legislature missing\n"; continue;}30 {echo "ERROR legislature : $dir$file\n"; continue;} 32 31 if (!$json->id) 33 {echo " source id\n"; continue;}32 {echo "ERROR id : $dir$file\n"; continue;} 34 33 if (!$json->numero) 35 {echo " source numero\n"; continue;}34 {echo "ERROR numero : $dir$file\n"; continue;} 36 35 if(!$json->date_depot) 37 {echo " source date_depot\n"; continue;}36 {echo "ERROR date_depot : $dir$file\n"; continue;} 38 37 if (!$json->dossier) 39 {echo " source dossier\n"; continue;}38 {echo "ERROR dossier : $dir$file\n"; continue;} 40 39 if (!$json->type) 41 {echo " source type\n"; continue;}42 $doc = Doctrine::getTable('Texte Loi')->find($json->id);40 {echo "ERROR type : $dir$file\n"; continue;} 41 $doc = Doctrine::getTable('Texteloi')->find($json->id); 43 42 if (!$doc) { 44 $doc = new Texte Loi();43 $doc = new Texteloi(); 45 44 $doc->id = $json->id; 46 45 $doc->source = $json->source; … … 61 60 $doc->titre = $json->titre; 62 61 if ($json->categorie) 63 $doc->categorie = strtolower($json->categorie);62 $doc->categorie = $json->categorie; 64 63 if ($json->auteurs) 65 64 $doc->setAuteurs($json->auteurs); 66 65 if ($json->motscles) 67 66 foreach (explode('.', $json->motscles) as $tag) 68 $doc->addTag($tag); 67 if (strlen($tag) < 100) 68 $doc->addTag($tag); 69 69 if ($json->contenu) 70 70 $doc->setContenu($json->contenu); … … 73 73 echo "$dir$file DONE\n"; 74 74 } 75 //unlink($dir.$file);75 unlink($dir.$file); 76 76 } 77 77 closedir($dh); -
cpc/trunk/project/web/css/xneth/style.css
r1363 r1367 56 56 .tag_level_3 {font-size: 1.5em;} 57 57 .tag_level_4 {font-size: 1.7em;} 58 .tag_level_3 {color: #D4963E;} 58 59 59 60 .internal_tag_cloud { … … 723 724 } 724 725 .photos { 725 text-align: center 726 text-align: center; 727 } 728 .photos img{ 729 padding: 2px; 726 730 } 727 731 .image_map { … … 1254 1258 padding-right: 300px; 1255 1259 } 1256 .nuage_de_tags p{ 1257 background-color:#dbd5c8; 1258 } 1259 1260 .orga_dossier { 1261 padding-top:20px; 1260 .nuage_de_tags p { 1261 background-color: #dbd5c8; 1262 } 1263 1264 .document { 1265 padding: 10px; 1266 } 1267 1268 .documents, .orga_dossier { 1269 padding-top: 20px; 1262 1270 } 1263 1271
Note: See TracChangeset
for help on using the changeset viewer.