Changeset 1421
- Timestamp:
- Sep 26, 2010, 5:38:28 AM (10 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/circonscription/templates/listSuccess.php
r1411 r1421 17 17 continue; 18 18 if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num); 19 echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.strtoupper($num).'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';19 echo '<p title="'.strtoupper($num).'" onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.strtoupper($num).'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>'; 20 20 if ($ct == $iter2) 21 21 break; -
cpc/trunk/project/apps/frontend/modules/commentaire/templates/_showTruncCommentaire.php
r1373 r1421 1 1 <?php use_helper('Text') ?> 2 2 <div id="commentaire_<?php echo $c->id; ?>" class="commentaire"> 3 <p><span class="titre_commentaire"><a href="<?php echo $c->lien; ?>#commentaire_<?php echo $c->id; ?>"><?php if (isset($presentation)) echo $c->getPresentation($presentation, 1); else echo $c->getPresentation().', ';3 <p><span class="titre_commentaire"><a href="<?php echo url_for($c->lien); ?>#commentaire_<?php echo $c->id; ?>"><?php if (isset($presentation)) echo $c->getPresentation($presentation, 1); else echo $c->getPresentation().', '; 4 4 include_component('citoyen', 'shortCitoyen', array('citoyen_id'=>$c->citoyen_id, 'nolink' => 1)); 5 5 ?> a dit le <?php echo date('d/m/Y', strtotime($c->created_at)); ?> :</a></span></p> 6 6 <div class="commentaire_avatar"><?php include_component('citoyen','avatarCitoyen', array('citoyen_id'=>$c->citoyen_id)); ?></div> 7 7 <p><?php echo truncate_text(strip_tags($c->commentaire), 300); ?></p> 8 <p><a href="<?php echo $c->lien; ?>#commentaire_<?php echo $c->id; ?>">Lire dans le contexte</a></p>8 <p><a href="<?php echo url_for($c->lien); ?>#commentaire_<?php echo $c->id; ?>">Lire dans le contexte</a></p> 9 9 </div> -
cpc/trunk/project/apps/frontend/modules/documents/actions/actions.class.php
r1378 r1421 17 17 $this->redirect('@loi?loi='.$id); 18 18 $this->doc = Doctrine::getTable('Texteloi')->find("$id"); 19 if (!$this->doc )19 if (!$this->doc && preg_match('/(\d+)/', $id, $match)) 20 20 $this->doc = Doctrine::getTable('Texteloi')->createQuery('t') 21 ->where('numero = ?', $ id)22 -> andWhere('annexe = 1')21 ->where('numero = ?', $match[1]) 22 ->orderBy('annexe') 23 23 ->fetchOne(); 24 24 $this->forward404Unless($this->doc); … … 30 30 ->where('tg.taggable_id = ?', $this->doc->id); 31 31 $this->section = $this->doc->getSection(); 32 $this->amendements = $this->doc->getAmendements( );32 $this->amendements = $this->doc->getAmendements(1); 33 33 $this->orga = $this->doc->getCommission(); 34 34 if (preg_match('/^(\d+)-[at]/', $id, $match)) -
cpc/trunk/project/apps/frontend/modules/documents/templates/showSuccess.php
r1392 r1421 1 <div class="source"><?php if ($section) echo link_to('Dossier relatif', '@section?id='.$section->id); else echo '<a href="'.$doc->url_an.'">Dossier sur le site de l\'Assemblée</a>'; ?></div> 2 <h1 class="orange"><?php echo preg_replace('/(N°\s\d+[,\s])/', '\\1<br/>', $doc->getTitre()); ?></h1> 3 <h3 class="aligncenter"><?php echo myTools::displayDate($doc->date); ?></h3> 1 <div class="precedent"><?php echo myTools::displayDate($doc->date); ?></div> 2 <div class="source"><?php if ($section) echo link_to('Dossier relatif', '@section?id='.$section->id); else echo '<a href="http://www.assemblee-nationale.fr/13/dossiers/'.$doc->url_an.'.asp">Dossier sur le site de l\'Assemblée</a>'; ?></div> 3 <h1><?php echo $doc->getShortTitre(); ?></h1> 4 <h2><?php echo preg_replace('/ - /', '<br/>- ', $doc->getDetailsTitre()); ?></h2> 4 5 <div class="document"> 5 6 <?php $feminin = ""; … … 29 30 </div> 30 31 <div class="document"> 32 <div class="left"> 33 <?php if ($txt = $doc->getExtract()) { ?> 34 <h3>Extrait</h3> 35 <p class="justify tabulation"><?php echo preg_replace('/([a-z])\. ([^"»])/', '\\1.</p><p class="justify tabulation">\\2', $doc->getExtract()); ?></p> 36 <?php } ?> 37 <h3><a href="<?php echo $doc->source; ?>">Consulter le document complet sur le site de l'Assemblée</a></h3> 38 <p class="aligncenter">(<?php echo link_to('version pdf', preg_replace('/asp$/', 'pdf', preg_replace('/13\//', '13/pdf/', $doc->source))); ?>)</p> 39 </div> 31 40 <div class="right"> 32 41 <div class="nuage_de_tags"> … … 34 43 <?php echo include_component('tag', 'tagcloud', array('tagquery' => $qtag, 'model' => 'Texteloi', 'limit' => 40, 'fixlevel' => 1)); ?> 35 44 </div> 36 </div>37 <div class="left">38 45 <?php if ((isset($texte) && $texte > 0) || count($annexes) || $amendements) { ?> 39 <h3>Documents associés</h3><ul> 40 <?php if (isset($texte) && $texte > 0) 41 echo '<li>'.link_to('Voir le rapport de la commission', '@document?id='.$doc->numero).'</li>'; 42 if (count($annexes)) { 43 foreach ($annexes as $annexe) if ($annexe['id'] != $doc->id) { 44 if (preg_match('/-a0/', $annexe['id'])) 46 <div class="annexes"> 47 <h3>Documents associés</h3><ul> 48 <?php if ($amendements) echo '<li>'.link_to("Voir les ".$amendements." amendement".($amendements > 1 ? "s" : "")." déposé".($amendements > 1 ? "s" : "")." sur ce texte", '@find_amendements_by_loi_and_numero?loi='.$doc->numero.'&numero=all').'</li>'; 49 if (isset($texte) && $texte > 0) 50 echo '<li>'.link_to('Voir le rapport de la commission', '@document?id='.$doc->numero).'</li>'; 51 if (count($annexes)) { 52 foreach ($annexes as $annexe) if ($annexe['id'] != $doc->id && preg_match('/-a0/', $annexe['id'])) 45 53 echo '<li>'.link_to('Voir le texte adopté par la commission', '@document?id='.$doc->numero.'-a0').'</li>'; 46 else{47 if (preg_match('/-a/', $annexe['id']))48 $titreannexe = "Annexe N° ";49 else $titreannexe = "Tome ";50 echo '<li>'.link_to($titreannexe .$annexe['annexe'], '@document?id='.$annexe['id']).'</li>';54 foreach ($annexes as $annexe) if ($annexe['id'] != $doc->id && preg_match('/t([\dIVX]+)/', $annexe['id'], $tom)) { 55 $titreannexe = "Tome ".$tom[1]; 56 if (preg_match('/v(\d+)/', $annexe['id'], $vol)) 57 $titreannexe .= " - volume ".$vol[1]; 58 echo '<li>'.link_to($titreannexe, '@document?id='.$annexe['id']).'</li>'; 51 59 } 52 }53 } 54 if ($amendements) echo '<li>'.link_to("Voir les ".$amendements." amendement".($amendements > 1 ? "s" : "")." déposé".($amendements > 1 ? "s" : "")." sur ".$doc->getTypeString(), '@find_amendements_by_loi_and_numero?loi='.$doc->numero.'&numero=all').'</li>'; 55 echo '</ul>';60 foreach ($annexes as $annexe) if ($annexe['id'] != $doc->id && preg_match('/-a([1-9]\d*)/', $annexe['id'], $ann)) 61 echo '<li>'.link_to("Annexe N° ".$ann[1], '@document?id='.$annexe['id']).'</li>'; 62 } 63 echo '</ul></div>'; 56 64 } ?> 57 <h3><a href="<?php echo $doc->source; ?>">Consulter le document complet sur le site de l'Assemblée</a></h3>58 <p class="aligncenter">(<?php echo link_to('version pdf', preg_replace('/asp$/', 'pdf', $doc->source)); ?>)</p>59 65 </div> 60 66 </div> -
cpc/trunk/project/apps/frontend/modules/section/templates/listSuccess.php
r1367 r1421 1 1 <div class="travaux_parlementaires"> 2 <h1 class="orange">Les dossiers parlementaires</h1>2 <h1>Les dossiers parlementaires</h1> 3 3 <?php include_component('section', 'simplifions', array()); ?> 4 4 <h2><?php echo $titre; ?></h2> … … 14 14 } 15 15 echo '<li>'.link_to(ucfirst($s->titre), '@section?id='.$s->id); 16 if ($s->nb_interventions > 0 || $s->nb_commentaires) { 17 echo ' (<span class="list_inter">'.$s->nb_interventions.' intervention'; 18 if ($s->nb_interventions > 1) echo 's'; 16 if ($order != 'date' || $s->nb_interventions > 0 || $s->nb_commentaires) 17 echo ' ('; 18 if ($s->nb_interventions > 0) 19 echo '<span class="list_inter">'.$s->nb_interventions.' intervention'; 20 if ($s->nb_interventions > 1) 21 echo 's'; 22 if ($s->nb_interventions > 0) 19 23 echo '</span>'; 20 if ($s->nb_commentaires > 0) echo ', <span class="list_com">'.$s->nb_commentaires.' commentaire'; 21 if ($s->nb_commentaires > 1) echo 's'; 22 if ($s->nb_commentaires > 0) echo '</span>'; 23 if ($order != 'date') echo ', '.$moisactuel; 24 if ($s->nb_interventions > 0 && $s->nb_commentaires) 25 echo ', '; 26 if ($s->nb_commentaires > 0) 27 echo '<span class="list_com">'.$s->nb_commentaires.' commentaire'; 28 if ($s->nb_commentaires > 1) 29 echo 's'; 30 if ($s->nb_commentaires > 0) 31 echo '</span>'; 32 if ($order != 'date') 33 echo ', '.$moisactuel; 34 if ($order != 'date' || $s->nb_interventions > 0 || $s->nb_commentaires) 24 35 echo ')'; 25 }26 36 echo '</li>'; 27 37 } -
cpc/trunk/project/apps/frontend/modules/section/templates/showSuccess.php
r1385 r1421 1 1 <?php if ($section->url_an) echo '<span class="source">'.myTools::getLinkDossier($section->url_an)."</span>"; ?> 2 <h1 class="orange"><?php2 <h1><?php 3 3 $titre = ''; 4 4 if ($section->getSection()) { … … 52 52 $curid = 0; 53 53 foreach ($docs as $id => $doc) { 54 $shortid = preg_replace('/-[at ].*$/', '', $id);54 $shortid = preg_replace('/-[atv].*$/', '', preg_replace('/[A-Z]/', '', $id)); 55 55 if ($curid != $shortid) { 56 56 echo "<li>"; -
cpc/trunk/project/batch/documents/parse_metas.pl
r1397 r1421 75 75 $string =~ s/\s+/ /g; 76 76 $string =~ s/"//g; 77 $string =~ s/Premier ministrePremier ministre/Premier ministre/g; 77 78 78 79 $keywords = ""; -
cpc/trunk/project/bin/updateDB3.sh
r1412 r1421 8 8 php symfony doctrine:build --all --no-confirmation 9 9 10 echo "ALTER TABLE `parlementaire` ADD `photo` LONGBLOB NULL AFTER `profession`;" | mysql $MYSQLID $DBNAME10 echo "ALTER TABLE parlementaire ADD photo LONGBLOB NULL AFTER profession" | mysql $MYSQLID $DBNAME 11 11 12 12 zcat data/sql/dumps/nosdeputes_prod.100925.sql.gz | mysql --default-character-set=utf8 $MYSQLID $DBNAME 13 13 14 echo "ALTER TABLE `parlementaire` DROP `photo`;" | mysql $MYSQLID $DBNAME14 echo "ALTER TABLE parlementaire DROP photo" | mysql $MYSQLID $DBNAME 15 15 16 16 cat bin/updateDB3.1.sql | mysql $MYSQLID $DBNAME 17 17 18 php symfony update:Deputes18 bash bin/load_deputes 19 19 20 20 cd batch/hemicycle -
cpc/trunk/project/lib/model/doctrine/Texteloi.class.php
r1377 r1421 22 22 23 23 public function __toString() { 24 $str = substr( strip_tags($this->contenu), 0, 250);24 $str = substr($this->getExtract(), 0, 250); 25 25 if (strlen($str) == 250) { 26 26 $str .= '...'; … … 243 243 public function getShortTitre() { 244 244 $str = ""; 245 if ($this->annexe && preg_match('/a /', $this->id)) {246 $str .= "Annexe N° ".$ this->annexe." ";245 if ($this->annexe && preg_match('/a([1-9]\d*)/', $this->id, $ann)) { 246 $str .= "Annexe N° ".$ann[1]." "; 247 247 if ($this->type === "Avis") 248 248 $str .= "à l'"; 249 249 else $str .= "au "; 250 250 } 251 $str .= $this->type." N° ".$this->numero; 251 $str .= $this->type; 252 if ($this->annexe && $this->annexe === "a00") 253 $str .= " annexé au Rapport"; 254 $str .= " N° ".$this->numero; 255 if ($this->annexe && preg_match('/t([\dIVX]+)/', $this->id, $tom)) { 256 $str .= " (Tome ".$tom[1]; 257 if ($this->annexe && preg_match('/v(\d+)/', $this->id, $vol)) 258 $str .= " - volume ".$vol[1]; 259 $str .= ")"; 260 } 252 261 return $str; 253 262 } 254 263 255 264 public function getTitre() { 256 $str = $this->getShortTitre(); 265 $str = $this->getDetailsTitre(); 266 if ($str) 267 return $this->getShortTitre()." ".$str; 268 return $this->getShortTitre(); 269 } 270 271 public function getDetailsTitre() { 272 $str = ""; 257 273 if ($this->type_details && !preg_match('/'.$this->type_details.'/', $this->_get('titre'))) 258 274 $str .= " ".$this->type_details; 259 275 if ($this->_get('titre')) 260 276 $str .= " ".$this->_get('titre'); 261 $str = preg_replace('/\s*,\s*/', ', ', $str); 262 if ($this->annexe && preg_match('/t/', $this->id)) 263 $str .= " (Tome ".$this->annexe.")"; 277 $str = preg_replace('/^,\s*/', '', preg_replace('/\s*,\s*/', ', ', $str)); 264 278 return $str; 265 279 } … … 273 287 return $this->_set('contenu', base64_encode(gzdeflate($c))); 274 288 } 289 290 public function getExtract() { 291 $sub = substr(strip_tags($this->contenu), 0, 30000); 292 $str = preg_replace('/^.*(mesdames)/i', '\\1', $sub); 293 if (!preg_match('/^mesdames/i', $str)) { 294 if (preg_match('/^.*introduction(.*)$/i', $sub, $match)) 295 $str = $match[1]; 296 else return null; 297 } 298 $str2 = substr($str, 0, 1000); 299 if (strlen($str) != 1000) { 300 $str2 .= '...'; 301 } else if (!$str) $str2 = ""; 302 return $str2; 303 } 304 275 305 } -
cpc/trunk/project/web/css/xneth/style.css
r1413 r1421 1179 1179 } 1180 1180 1181 .justify { 1182 text-align: justify; 1183 } 1184 1185 .tabulation:first-letter { 1186 padding-left: 20px; 1187 } 1188 1181 1189 .aligncenter { 1182 1190 text-align: center; … … 1223 1231 } 1224 1232 1225 .p agerloi .precedent {1233 .precedent { 1226 1234 float: left; 1227 1235 } … … 1379 1387 .document { 1380 1388 padding: 6px; 1389 } 1390 1391 .annexes { 1392 padding: 10px 5px 20px 40px; 1381 1393 } 1382 1394
Note: See TracChangeset
for help on using the changeset viewer.