Changeset 2625


Ignore:
Timestamp:
Jan 31, 2012, 3:34:48 PM (9 years ago)
Author:
goya
Message:

fix backend fuse commissions

Location:
cpc/trunk/project
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/backend/config/routing.yml

    r2386 r2625  
    126126
    127127fuse_seances:
    128   url: /commission/seance/:id/fuse/:bad/:good
     128  url: /commission/seance/:id/fuse_commissions
    129129  param: {module: organisme, action: fuse, type: 'seance', ok: 1}
    130130
     
    150150
    151151fuse_commissions:
    152   url: /commissions/fuse/:bad/:good
     152  url: /commissions/fuse_commissions
    153153  param: {module: organisme, action: fuse, type: 'commission', ok: 1}
    154154
  • cpc/trunk/project/apps/backend/modules/organisme/actions/actions.class.php

    r1094 r2625  
    112112    $this->type = $request->getParameter('type');
    113113    $this->forward404Unless($this->type && preg_match('/^(commission|seance)$/', $this->type));
    114     $this->bads = $request->getParameter('bad');
    115     $this->goods = $request->getParameter('good');
     114    $this->bads = $request->getParameter('bad', $_SESSION["hack_fuse_bad"]);
     115    $this->goods = $request->getParameter('good', $_SESSION["hack_fuse_good"]);
    116116    $this->forward404Unless($this->bads && $this->goods && ($this->bads != $this->goods));
     117    unset($_SESSION["hack_fuse_bad"]);
     118    unset($_SESSION["hack_fuse_good"]);
    117119
    118120    if ($this->type == "seance") {
     
    200202          } 
    201203        }
    202         if ($doublons_bad != "" && $doublons_good != "" && ($doublons_bad != $doublons_good))
    203           $this->redirect('@fuse?type=seance&id='.$this->bad.','.$this->good.'&bad='.$doublons_bad.'&good='.$doublons_good.'&doublons=1');
     204        if ($doublons_bad != "" && $doublons_good != "" && ($doublons_bad != $doublons_good)) {
     205          $_SESSION["hack_fuse_bad"] = $doublons_bad;
     206          $_SESSION["hack_fuse_good"] = $doublons_good;
     207          $this->redirect('@fuse?type=seance&id='.$this->bad.','.$this->good.'&doublons=1');
     208        }
    204209      }
    205210      $query = Doctrine_Query::create()
  • cpc/trunk/project/apps/backend/modules/organisme/templates/fuseSuccess.php

    r1013 r2625  
    2020    </div>
    2121    <?php if (!(isset($doublons) && $doublons > 1)) {
    22       echo '<p id="fuse" style="text-align:center;"><a href="';
    23       if ($type == "commission") echo url_for('@fuse_commissions?bad='.$bad.'&good='.$good);
    24       else echo url_for('@fuse_seances?id='.$orga.'&bad='.$bads.'&good='.$goods);
    25       echo '">FUSIONNER</a></p>';
     22      echo '<form id="fuse" style="text-align:center;" action="';
     23      if ($type == "commission") {
     24        echo url_for('@fuse_commissions').'" method="post">';
     25        echo '<input type="hidden" name="bad" value="'.$bad.'" />';
     26        echo '<input type="hidden" name="good" value="'.$good.'" />';
     27      } else {
     28        echo url_for('@fuse_seances?id='.$orga).'" method="post">';
     29        echo '<input type="hidden" name="bad" value="'.$bads.'" />';
     30        echo '<input type="hidden" name="good" value="'.$goods.'" />';
     31      }
     32      echo '<input type="submit" value="Fusionner" /></div>';
    2633    } ?>
    2734  </div>
  • cpc/trunk/project/lib/task/fuseDossiersTask.class.php

    r2336 r2625  
    88    $this->addArgument('baddossier', sfCommandArgument::REQUIRED, 'Dossier à intégrer');
    99    $this->addArgument('gooddossier', sfCommandArgument::REQUIRED, 'Dossier d\'acccueil');
    10     $this->addArgument('seanceid', sfCommandArgument::REQUIRED, 'Optionnel : limite à cette séance');
     10    $this->addArgument('seanceid', sfCommandArgument::OPTIONAL, 'Optionnel : limite à cette séance');
    1111    $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'test');
    1212    $this->addOption('app', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'frontend');
Note: See TracChangeset for help on using the changeset viewer.