Changeset 1625


Ignore:
Timestamp:
Oct 4, 2010, 1:50:20 AM (10 years ago)
Author:
roux
Message:

correction plots session

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

Legend:

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

    r1476 r1625  
    2828      $this->drawAction = "draw";
    2929    $this->mapId = $request->getParameter('mapId');
    30     $this->forward404Unless($this->mapId);
     30    $this->forward404Unless($this->mapId && preg_match('/^Map_\d+\.map$/', $this->mapId));
     31    sfConfig::set('sf_web_debug', false);
    3132    $this->getResponse()->setHttpHeader('content-type', 'image/png');
    3233    $this->setLayout(false);
     
    3839      $this->drawAction = "draw";
    3940    $this->mapId = $request->getParameter('mapId');
    40     $this->forward404Unless($this->mapId);
     41    $this->forward404Unless($this->mapId && preg_match('/^Map_\d+\.map$/', $this->mapId));
    4142    $this->type = $request->getParameter('type');
    4243    $this->getResponse()->setHttpHeader('content-type', 'image/png');
  • cpc/trunk/project/apps/frontend/modules/plot/actions/components.class.php

    r1476 r1625  
    99    static $seuil_invective = 20;
    1010    $this->data = array();
    11     if (!isset($this->options)) $this->options = array();
    12     if (!isset($this->options['session'])) $this->options['session'] = 'lastyear';
    13     if ($this->options['session'] == 'lastyear') {
     11    if (!isset($this->session)) $this->session = 'lastyear';
     12    if ($this->session === 'lastyear') {
    1413      if (isset($this->parlementaire->fin_mandat) && $this->parlementaire->fin_mandat > $this->parlementaire->debut_mandat) {
    1514        $date = strtotime($this->parlementaire->fin_mandat);
     
    3029        ->select('s.annee, s.numero_semaine')
    3130        ->from('Seance s')
    32         ->where('s.session = ?', $this->options['session'])
     31        ->where('s.session = ?', $this->session)
    3332        ->orderBy('s.date ASC');
    3433      $date_debut = $query4->fetchOne();
     
    3837        ->select('s.annee, s.numero_semaine')
    3938        ->from('Seance s')
    40         ->where('s.session = ?', $this->options['session'])
     39        ->where('s.session = ?', $this->session)
    4140        ->orderBy('s.date DESC');
    4241      $date_fin = $query4->fetchOne();
     
    5352      ->where('p.parlementaire_id = ?', $this->parlementaire->id)
    5453      ->leftJoin('p.Seance s');
    55     if ($this->options['session'] == 'lastyear')
     54    if ($this->session === 'lastyear')
    5655      $query->andWhere('s.date > ?', $date_debut);
    57     else $query->andWhere('s.session = ?', $this->options['session']);
     56    else $query->andWhere('s.session = ?', $this->session);
    5857    $query->groupBy('s.type, s.annee, s.numero_semaine');
    5958    $presences = $query->fetchArray();
     
    7372      ->andWhere('i.nb_mots > ?', $seuil_invective)
    7473      ->leftJoin('i.Seance s');
    75     if ($this->options['session'] == 'lastyear')
     74    if ($this->session === 'lastyear')
    7675      $query2->andWhere('s.date > ?', $date_debut);
    77     else $query2->andWhere('s.session = ?', $this->options['session']);
     76    else $query2->andWhere('s.session = ?', $this->session);
    7877    $query2->groupBy('s.type, s.annee, s.numero_semaine');
    7978    $participations = $query2->fetchArray();
     
    10099      ->andWhere('i.nb_mots > ?', 2*$seuil_invective)
    101100      ->leftJoin('i.Seance s');
    102     if ($this->options['session'] == 'lastyear')
     101    if ($this->session === 'lastyear')
    103102      $query3->andWhere('s.date > ?', $date_debut);
    104     else $query3->andWhere('s.session = ?', $this->options['session']);
     103    else $query3->andWhere('s.session = ?', $this->session);
    105104    $query3->groupBy('s.annee, s.numero_semaine');
    106105    $questionsorales = $query3->fetchArray();
Note: See TracChangeset for help on using the changeset viewer.