Changeset 1449


Ignore:
Timestamp:
Sep 27, 2010, 1:40:13 AM (10 years ago)
Author:
teymour
Message:

Changement de nom du dossier

Location:
cpc/trunk/project
Files:
7 edited

Legend:

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

    r1395 r1449  
    1414  {
    1515   
     16  }
     17  public function executeDocument(sfWebRequest $request)
     18  {
     19    $class = $request->getParameter('class');
     20    $type = $request->getParameter('type');
     21    $id = $request->getParameter('id');
     22    $this->forward404Unless($class);
     23    $o = doctrine::getTable($class)->find($id);
     24    if ($class == 'Parlementaire') {
     25      return $this->redirect('api/parlementaire?slug='.$o->slug.'&type='.$type);
     26    }
     27    $slug = $class.'_'.$id;
     28    $date = $o->updated_at;
     29    $this->res = array();
     30    $this->res[strtolower($class)] = $o->toArray();
     31    $this->templatize($request, 'nosdeputes.fr_'.'_'.$slug.'_'.$date);
     32    $this->breakline = '';
    1633  }
    1734 /**
     
    125142    $this->multi['responsabilite'] = 1;
    126143    $this->res['depute']['site_web'] = $depute->site_web;
    127     $this->res['depute']['url_an'] = 'http://www.assembleenationale.fr/13/tribun/fiches_id/'.$depute->id_an.'.asp';
     144    $this->res['depute']['url_an'] = 'http://www.assembleenationale.fr/13/tribun/fiches_id/'.$depute->url_an.'.asp';
    128145    $this->res['depute']['emails'] = $this->array2hash(unserialize($depute->mails), 'email');
    129146    $this->multi['email'] = 1;
  • cpc/trunk/project/apps/frontend/modules/documents/templates/showSuccess.php

    r1421 r1449  
    11<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>
     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->id_dossier_an.'.asp">Dossier sur le site de l\'Assemblée</a>'; ?></div>
    33<h1><?php echo $doc->getShortTitre(); ?></h1>
    44<h2><?php echo preg_replace('/ - /', '<br/>- ', $doc->getDetailsTitre()); ?></h2>
  • cpc/trunk/project/apps/frontend/modules/section/actions/actions.class.php

    r1385 r1449  
    5656                                          'return' => 'value'));
    5757    $this->docs = array();
    58     if ($this->section->url_an || $lois) {
     58    if ($this->section->id_dossier_an || $lois) {
    5959      $qtextes = Doctrine_Query::create()
    6060        ->select('t.id, t.type, t.type_details, t.titre, t.signataires, t.nb_commentaires')
    6161        ->from('Texteloi t')
    6262        ->whereIn('t.numero', $lois);
    63       if ($this->section->url_an)
    64         $qtextes->orWhere('t.url_an = ?', $this->section->url_an);
     63      if ($this->section->id_dossier_an)
     64        $qtextes->orWhere('t.id_dossier_an = ?', $this->section->id_dossier_an);
    6565      $qtextes->orderBy('t.numero, t.annexe');
    6666      $textes = $qtextes->fetchArray();
  • cpc/trunk/project/apps/frontend/modules/section/templates/showSuccess.php

    r1421 r1449  
    1 <?php if ($section->url_an) echo '<span class="source">'.myTools::getLinkDossier($section->url_an)."</span>"; ?>
     1<?php if ($section->id_dossier_an) echo '<span class="source">'.myTools::getLinkDossier($section->id_dossier_an)."</span>"; ?>
    22<h1><?php
    33   $titre = '';
  • cpc/trunk/project/config/doctrine/schema.yml

    r1445 r1449  
    184184    timestamp: integer
    185185    nb_interventions: integer
    186     url_an: string(255)
     186    id_dossier_an: string(255)
    187187  inheritance:
    188188    extends: ObjectCommentable
     
    611611    type_details: string(512)
    612612    categorie: string(128)
    613     url_an: string(255)
     613    id_dossier_an: string(255)
    614614    titre: string(512)
    615615    date: date
     
    632632  indexes:
    633633    index_url:
    634       fields: [url_an]
     634      fields: [id_dossier_an]
    635635    index_alpha:
    636636      fields: [numero, annexe]
  • cpc/trunk/project/lib/model/doctrine/Intervention.class.php

    r1410 r1449  
    125125    if ($lois[0]) {
    126126      $urls = Doctrine_Query::create()
    127         ->select('distinct(t.url_an)')
     127        ->select('distinct(t.id_dossier_an)')
    128128        ->from('Texteloi t')
    129129        ->where('t.type = ? OR t.type = ? OR t.type = ? OR t.type = ?', array("Proposition de loi", "Proposition de résolution", "Projet de loi", "Texte de la commission"))
     
    132132      $ct = count($urls);
    133133      if ($ct == 0) $urls = Doctrine_Query::create()
    134         ->select('distinct(t.url_an)')
     134        ->select('distinct(t.id_dossier_an)')
    135135        ->from('Texteloi t')
    136136        ->where($loisstring)
     
    140140        $this->setSection(Doctrine::getTable('Section')->findOneByContexteOrCreateIt($contexte, $date, $timestamp));
    141141        if ($debug) {
    142           print "WARNING : Intervention $this->id has tags lois corresponding to multiple url_ans : ";
     142          print "WARNING : Intervention $this->id has tags lois corresponding to multiple id_dossier_ans : ";
    143143          foreach ($urls as $url)
    144144            print $url['distinct']." ; ";
  • cpc/trunk/project/lib/model/doctrine/Texteloi.class.php

    r1421 r1449  
    4949
    5050  public function getSection() {
    51     $section = Doctrine::getTable('Section')->findOneByUrlAn($this->url_an);
     51    $section = Doctrine::getTable('Section')->findOneByIdDossierAn($this->id_dossier_an);
    5252    if (!$section) $section = Doctrine_Query::create()
    5353      ->select('s.id')
     
    6363
    6464  public function setDossier($urldossier) {
    65     $this->url_an = $urldossier;
     65    $this->id_dossier_an = $urldossier;
    6666    $section = Doctrine::getTable('Section')->findOneByUrlAn($urldossier);
    6767    if ($section) {
     
    6969   #   $section->setMaxDate($this->date);
    7070   #   $section->save();
    71  #print "$section->id, $this->url_an\n";
     71 #print "$section->id, $this->id_dossier_an\n";
    7272      return true;
    7373    }
     
    8787    } else if ($res == 1) {
    8888      $section = Doctrine::getTable('Section')->find($sections[0]['id']);
    89       $section->url_an = $urldossier;
     89      $section->id_dossier_an = $urldossier;
    9090   # voir plus haut
    9191   #  $section->setMaxDate($this->date);
    9292      $section->save();
    93      #print "$section->id, $this->url_an\n";
     93     #print "$section->id, $this->id_dossier_an\n";
    9494      return true;
    9595    } else {
Note: See TracChangeset for help on using the changeset viewer.