Ne délivrer que les procoll sur cpcambr13, issue #0001049

This commit is contained in:
Michael RICOIS 2012-03-01 09:49:30 +00:00
parent 2200a7ba6d
commit c33fd0d6c5
2 changed files with 28 additions and 12 deletions

View File

@ -702,6 +702,20 @@ class SurveillanceController extends Zend_Controller_Action
//Lister les annonces
elseif (empty($getCSV))
{
$selectFiltre = array(
'procol' => array('lib'=> 'Procédures collectives', 'select'=>''),
'radiations' => array('lib'=> 'Radiations', 'select'=>''),
'ventes' => array('lib'=> 'Ventes/Cessions', 'select'=>''),
'mmd' => array('lib'=> 'Modifications diverses', 'select'=>''),
);
if (strtolower($user->getLogin())=='cpcambr13') {
$selectFiltre = array(
'procol' => array('lib'=> 'Procédures collectives', 'select'=>''),
);
$filtre = 'procol';
}
$filtre = $request->getParam('filtre', '');
if (!empty($filtre)) {
switch (trim(strtolower($filtre))) {
@ -714,7 +728,12 @@ class SurveillanceController extends Zend_Controller_Action
case 'bodacc': $filtre = 'bodacc'; break;
default: $filtre = ''; break;
}
if (array_key_exists($filtre, $selectFiltre)) {
$selectFiltre[$filtre]['select'] = ' selected';
}
}
$this->view->assign('selectFiltre', $selectFiltre);
//Récupération du fichier
$file = $path.'/'.$nomFic;
@ -799,7 +818,6 @@ class SurveillanceController extends Zend_Controller_Action
fclose($handle);
$this->view->assign('annonces', $tab);
$this->view->assign('filtre', $filtre);
$this->view->assign('nomFic', $nomFic);
$this->renderScript('surveillance/fichier-ann.phtml');
} else {

View File

@ -21,12 +21,10 @@
<input type="hidden" name="page" value="survlisteann" />
<input type="hidden" name="nomFic" value="<?=$this->$nomFic?>" />
<select name="filtre" onchange="document.form_filtre.submit()">
<option value="-" <?if ($this->filtre=='') echo 'selected';?>>-</option>
<option value="procol" <?if ($this->filtre=='procol') echo 'selected';?>>Proc&eacute;dures collectives</option>
<option value="radiations" <?if ($this->filtre=='radiations') echo 'selected';?>>Radiations</option>
<option value="ventes" <?if ($this->filtre=='ventes') echo 'selected';?>>Ventes/Cessions</option>
<option value="mmd" <?if ($this->filtre=='mmd') echo 'selected';?>>Modifications diverses</option>
<?php /* <option value="bodacc" <?if ($filtre=='bodacc') echo 'selected';?>>BODACC</option> */ ?>
<option value="-">-</option>
<?php foreach ( $this->selectFiltre as $key => $value ) {?>
<option value="<?=$key?>"<?=$value['select']?>><?=$value['lib']?></option>
<?php }?>
</select>
</form>
</td>