Affichage du lien de mise en surveillance uniquement lors que l'utilisateur à le droit

This commit is contained in:
Michael RICOIS 2012-02-08 15:32:32 +00:00
parent 42d9bc9cb4
commit 27dbe76a75
2 changed files with 9 additions and 0 deletions

View File

@ -162,6 +162,13 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('infos', $infos); $this->view->assign('infos', $infos);
$this->view->assign('siret', $infos->Siret); $this->view->assign('siret', $infos->Siret);
$survDroits = array('survannonce', 'survinsee', 'survbilan', 'survscore', 'survactes', 'survdirigeants', 'survpriv');
$countSurvDroits = 0;
foreach ( $survDroits as $item ) {
if ($user->checkPerm($item)) $countSurvDroits++;
}
$this->view->assign('surveillance', $countSurvDroits);
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage')); $this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
} }

View File

@ -86,9 +86,11 @@ echo $this->partial('identite/fiche-item.phtml', $this->dBlock['EffectifEtab']);
<?=$this->action('news', 'identite');?> <?=$this->action('news', 'identite');?>
<?php endif;?> <?php endif;?>
<?php if (!empty($this->surveillance)):?>
<div class="paragraph" style="clear:both;"> <div class="paragraph" style="clear:both;">
<?=$this->action('infos','surveillance', null, array('siret' => $this->siret))?> <?=$this->action('infos','surveillance', null, array('siret' => $this->siret))?>
</div> </div>
<?php endif;?>
<?php if (empty($this->AutrePage)):?> <?php if (empty($this->AutrePage)):?>
<?=$this->render('cgu.phtml', $this->cgu)?> <?=$this->render('cgu.phtml', $this->cgu)?>