Changeset 2621


Ignore:
Timestamp:
Jan 31, 2012, 2:42:23 PM (8 years ago)
Author:
goya
Message:

fix bugs api deputes par id

File:
1 edited

Legend:

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

    r2580 r2621  
    144144  public function executeId(sfWebRequest $request)
    145145  {
     146    $format = $request->getParameter('format');
     147    if ($format)
     148        $format = '/'.$format;
    146149    $id = $request->getParameter('id');
    147     if (preg_match('/^s/', $id)) $this->redirect("http://www.nossenateurs.fr/id/$id");
     150    if (preg_match('/^s/', $id)) $this->redirect("http://www.nossenateurs.fr/id/$id".$format);
    148151    $id = preg_replace('/^d/', '', $id);
    149152    $p = Doctrine::getTable('Parlementaire')->find($id);
    150153    $this->forward404Unless($p);
    151     if ($type = $request->getParameter('type')) {
    152       return $this->redirect('api/parlementaire?type='.$type.'&slug='.$p->slug.'&textplain='.$request->getParameter('textplain'));
     154    if ($format = $request->getParameter('format')) {
     155      return $this->redirect('api/parlementaire?format='.$format.'&slug='.$p->slug.'&textplain='.$request->getParameter('textplain'));
    153156    }
    154157    return $this->redirect('@parlementaire?slug='.$p->slug);
Note: See TracChangeset for help on using the changeset viewer.