Changeset 2714


Ignore:
Timestamp:
May 14, 2012, 1:20:43 PM (8 years ago)
Author:
goya
Message:

legislature au lieu de lastyear dans url

Location:
cpc/trunk/project/apps/frontend/modules
Files:
4 edited

Legend:

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

    r2705 r2714  
    325325    $slug = $request->getParameter('slug');
    326326    $this->session = $request->getParameter('time');
    327     $this->forward404Unless(preg_match('/^(lastyear|2\d{3}2\d{3})$/', $this->session));
     327    $this->forward404Unless(preg_match('/^(legislature|lastyear|2\d{3}2\d{3})$/', $this->session));
    328328    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($slug);
    329329    $this->forward404Unless($this->parlementaire);
  • cpc/trunk/project/apps/frontend/modules/plot/actions/actions.class.php

    r2695 r2714  
    1515    $this->time = $request->getParameter('time');
    1616    $this->forward404Unless(preg_match('/^(total|hemicycle|commission)$/', $this->type));
    17     $this->forward404Unless(preg_match('/^(lastyear|20\d{2}20\d{2})$/', $this->time));
     17    $this->forward404Unless(preg_match('/^(legislature|lastyear|20\d{2}20\d{2})$/', $this->time));
    1818    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    1919    $this->forward404Unless($this->parlementaire);
  • cpc/trunk/project/apps/frontend/modules/plot/actions/components.class.php

    r2708 r2714  
    1010    $this->data = array();
    1111    $this->data['fin'] = myTools::isFinLegislature();
    12     if (!isset($this->session)) $this->session = 'lastyear';
     12    if (!isset($this->session) || $this->session === 'legislature') $this->session = 'lastyear';
    1313    if ($this->session === 'lastyear') {
    1414      if (!$this->data['fin'] && isset($this->parlementaire->fin_mandat) && $this->parlementaire->fin_mandat > $this->parlementaire->debut_mandat) {
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_plotParlementaire.php

    r2706 r2714  
    1313$PictureID = "Map_".$parlementaire->slug.'_'.rand(1,10000).".map";
    1414if ($link === 'true') {
    15   echo '<a href="'.url_for('@parlementaire_plot?slug='.$parlementaire->slug.'&time=lastyear').'">';
     15  $time = 'lastyear';
     16  if (myTools::isFinLegislature()) $time = 'legislature';
     17  echo '<a href="'.url_for('@parlementaire_plot?slug='.$parlementaire->slug.'&time=legislature').'">';
    1618  $size = 'height:150px; width:800px';
    1719 } else echo '<div class="par_session">'; ?>
Note: See TracChangeset for help on using the changeset viewer.