Changeset 3046


Ignore:
Timestamp:
Dec 16, 2012, 9:58:28 PM (8 years ago)
Author:
nosdeputes
Message:

fix député du jour legislature cloturee

Location:
cpc/trunk/project/apps/frontend/modules/parlementaire/actions
Files:
2 edited

Legend:

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

    r2992 r3046  
    121121  public function executeRandom(sfWebRequest $request)
    122122  {
    123     $p = Doctrine::getTable('Parlementaire')->createQuery('p')->where('fin_mandat IS NULL')->orderBy('rand()')->limit(1)->fetchOne();
     123    $query = Doctrine::getTable('Parlementaire')->createQuery('p');
     124    if (!myTools::isLegislatureCloturee()) {
     125      $query->where('fin_mandat IS NULL');
     126    }
     127    $p = $query->orderBy('rand()')->limit(1)->fetchOne();
    124128    return $this->redirect('@parlementaire?slug='.$p['slug']);
    125129  }
  • cpc/trunk/project/apps/frontend/modules/parlementaire/actions/components.class.php

    r2740 r3046  
    2323  public function executeDuJour()
    2424  {
    25     $this->parlementaire = Doctrine::getTable('Parlementaire')->createQuery('p')->where('fin_mandat IS NULL')->orderBy('rand()')->limit(1)->fetchOne();
     25    $query = Doctrine::getTable('Parlementaire')->createQuery('p');
     26    if (!myTools::isLegislatureCloturee()) {
     27      $query->where('fin_mandat IS NULL');
     28    }
     29    $this->parlementaire = $query->orderBy('rand()')->limit(1)->fetchOne();
    2630    return ;
    2731  }
Note: See TracChangeset for help on using the changeset viewer.