844 lines
20 KiB
PHP
844 lines
20 KiB
PHP
<?php
|
|
class Menu
|
|
{
|
|
protected $menu = null;
|
|
protected $siret = null;
|
|
protected $id = 0;
|
|
|
|
/**
|
|
* Définition du menu avec ces groupes et pages
|
|
* Groupes
|
|
* => label : titre du menu
|
|
* => check : nom du controller
|
|
* => permission : code de la permission nécessaire pour l'affichage
|
|
* activateMenu : Définir controller/action pour activer le menu
|
|
* => controller : nom du controller
|
|
* => action : nom de l'action
|
|
* Pages
|
|
* => label : titre de la page
|
|
* => title : titre de l'infobulle
|
|
* => controller : nom du controller
|
|
* => action : nom de l'action
|
|
* => permission : code de la permission nécessaire pour l'affichage
|
|
* => forceVisible : boolean, affiche le menu en grisé même si l'utilisateur n'a pas la permission
|
|
* @var array
|
|
*/
|
|
protected $defineMenu = array(
|
|
array(
|
|
'label' => 'RECHERCHES',
|
|
'activateMenu' => array(
|
|
array('controller'=>'recherche', 'action'=>'liste'),
|
|
array('controller'=>'recherche', 'action'=>'list'),
|
|
array('controller'=>'recherche', 'action'=>'annonceliste'),
|
|
array('controller'=>'recherche', 'action'=>'enquete'),
|
|
array('controller'=>'recherche', 'action'=>'refclientliste'),
|
|
array('controller'=>'giant', 'action'=>'search'),
|
|
array('controller'=>'giant', 'action'=>'identite'),
|
|
array('controller'=>'giant', 'action'=>'commandes'),
|
|
array('controller'=>'giant', 'action'=>'rapport'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Rechercher une entreprise",
|
|
'title' => "Rechercher une entreprise",
|
|
'controller' => 'recherche',
|
|
'action' => 'entreprise',
|
|
),
|
|
array(
|
|
'label' => "Rechercher par dirigeant",
|
|
'controller' => 'recherche',
|
|
'action' => 'dirigeant',
|
|
),
|
|
array(
|
|
'label' => "Recherche Internationale",
|
|
'controller' => '',
|
|
'action' => '',
|
|
'permission' => 'INTERNATIONAL'
|
|
),
|
|
array( // idClient = 1 && idClient =
|
|
'label' => "Rechercher une annonce",
|
|
'controller' => 'recherche',
|
|
'action' => 'annonce',
|
|
),
|
|
array(
|
|
'label' => "Rechercher par actionnaire",
|
|
'controller' => 'recherche',
|
|
'action' => 'actionnaire'
|
|
),
|
|
array(
|
|
'label' => "Dernière recherche",
|
|
'controller' => 'recherche',
|
|
'action' => 'last',
|
|
),
|
|
array(
|
|
'label' => "Liste des dernières recherches",
|
|
'controller' => 'recherche',
|
|
'action' => 'list',
|
|
),
|
|
array(
|
|
'label' => "Centrale IparI",
|
|
'controller' => 'recherche',
|
|
'action' => 'ipari',
|
|
'permission' => 'ipari',
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'IDENTITE',
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Fiche d'identité",
|
|
'controller' => 'identite',
|
|
'action' => 'fiche',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Fiche Procédure Collective",
|
|
'controller' => 'identite',
|
|
'action' => 'fichepc',
|
|
'permission' => 'idprocol'
|
|
),
|
|
array(
|
|
'label' => "Liste des établissements",
|
|
'controller' => 'identite',
|
|
'action' => 'etablissements',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Liens inter-entreprise",
|
|
'controller' => 'identite',
|
|
'action' => 'liens',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Informations Groupe",
|
|
'controller' => 'identite',
|
|
'action' => 'groupe',
|
|
'permission' => 'groupe'
|
|
),
|
|
array(
|
|
'label' => "Modifications Insee",
|
|
'controller' => 'identite',
|
|
'action' => 'evenements',
|
|
'permission' => 'eveninsee',
|
|
'forceVisible' => true,
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'DIRIGEANTS',
|
|
'activateMenu' => array(
|
|
array('controller'=>'dirigeants', 'action'=>'op'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Liste des dirigeants",
|
|
'controller' => 'dirigeant',
|
|
'action' => 'liste',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Historique des dirigeants",
|
|
'controller' => 'dirigeant',
|
|
'action' => 'histo',
|
|
'forceVisible' => true,
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'ELEMENTS FINANCIERS',
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Synthèse",
|
|
'controller' => 'finance',
|
|
'action' => 'synthese',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Bilans, Compte de résultat",
|
|
'controller' => 'finance',
|
|
'action' => 'bilan',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Ratios",
|
|
'controller' => 'finance',
|
|
'action' => 'ratios',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Flux de trésorerie",
|
|
'controller' => 'finance',
|
|
'action' => 'flux',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Liasse fiscale",
|
|
'controller' => 'finance',
|
|
'action' => 'liasse',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Bourse & Cotations",
|
|
'controller' => 'finance',
|
|
'action' => 'bourse',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Relations bancaires",
|
|
'controller' => 'finance',
|
|
'action' => 'banque',
|
|
'forceVisible' => true,
|
|
),
|
|
),
|
|
|
|
),
|
|
array(
|
|
'label' => 'ELEMENTS JURIDIQUES',
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Annonces Légales",
|
|
'controller' => 'juridique',
|
|
'action' => 'annonces',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Information Réglementée",
|
|
'controller' => 'juridique',
|
|
'action' => 'infosreg',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Compétences Territoriales",
|
|
'controller' => 'juridique',
|
|
'action' => 'competences',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Conventions collectives",
|
|
'controller' => 'juridique',
|
|
'action' => 'conventions',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Marques déposées",
|
|
'controller' => 'juridique',
|
|
'action' => 'marques',
|
|
'permission' => array('marques'),
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'BANQUE DE FRANCE',
|
|
'permission' => 'BDF',
|
|
'activateMenu' => array(
|
|
array('controller'=>'bdf', 'action'=>'module'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "27. Panorama",
|
|
'controller' => 'bdf',
|
|
'action' => 'module27',
|
|
),
|
|
array(
|
|
'label' => "28. Concours Bancaires",
|
|
'controller' => 'bdf',
|
|
'action' => 'module28',
|
|
),
|
|
array(
|
|
'label' => "29. Impayés",
|
|
'controller' => 'bdf',
|
|
'action' => 'module29',
|
|
),
|
|
array(
|
|
'label' => "40. Relations Bancaires",
|
|
'controller' => 'bdf',
|
|
'action' => 'module40',
|
|
),
|
|
array(
|
|
'label' => "51. Dirigeants",
|
|
'controller' => 'bdf',
|
|
'action' => 'module51',
|
|
),
|
|
array(
|
|
'label' => "Autres",
|
|
'controller' => 'bdf',
|
|
'action' => 'index',
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'EVALUATION',
|
|
'activateMenu' => array(
|
|
array('controller'=>'evaluation', 'action'=> 'scoringcommande'),
|
|
array('controller'=>'evaluation', 'action'=> 'aviscredit'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "IndiScore",
|
|
'controller' => 'evaluation',
|
|
'action' => 'indiscore',
|
|
'permission' => array('indiscore', 'indiscorep'),
|
|
'pref' => array('demanderef'),
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Rapport de synthèse",
|
|
'controller' => 'evaluation',
|
|
'action' => 'indiscore2',
|
|
'permission' => array('indiscore2', 'indiscore2p'),
|
|
),
|
|
array(
|
|
'label' => "Rapport complet",
|
|
'controller' => 'evaluation',
|
|
'action' => 'indiscore3',
|
|
'permission' => array('indiscore3', 'indiscore3p'),
|
|
'pref' => array('demanderef'),
|
|
),
|
|
array(
|
|
'label' => "Scoring Credit Safe",
|
|
'controller' => 'evaluation',
|
|
'action' => 'scoring',
|
|
'permission' => 'scorecsf',
|
|
),
|
|
array(
|
|
'label' => "Enquête commerciale",
|
|
'controller' => 'evaluation',
|
|
'action' => 'enquetec',
|
|
'permission' => 'enquetec',
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'PIECES OFFICIELLES',
|
|
'activateMenu' => array(
|
|
array('controller'=> 'pieces', 'action'=>'cmdassociation'),
|
|
array('controller'=> 'pieces', 'action'=>'associationactes'),
|
|
array('controller'=> 'pieces', 'action'=>'associationbilans'),
|
|
array('controller'=> 'pieces', 'action'=>'cmdcourrier'),
|
|
array('controller'=> 'pieces', 'action'=>'kbis'),
|
|
array('controller'=> 'pieces', 'action'=>'kbispasserelle'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Commande de Pièces",
|
|
'controller' => 'pieces',
|
|
'action' => 'commande',
|
|
'permission' => array('kbis', 'privileges'),
|
|
),
|
|
array(
|
|
'label' => "Comptes annuels",
|
|
'controller' => 'pieces',
|
|
'action' => 'bilans',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Actes & Statuts",
|
|
'controller' => 'pieces',
|
|
'action' => 'actes',
|
|
'forceVisible' => true,
|
|
),
|
|
array(
|
|
'label' => "Suivi Privilèges",
|
|
'controller' => 'pieces',
|
|
'action' => 'privileges',
|
|
'permission' => 'survpriv',
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'OPTIONS',
|
|
'pages' => array(
|
|
array(
|
|
'label' => 'Nouveautés',
|
|
'controller' => 'aide',
|
|
'action' => 'newliste',
|
|
),
|
|
array(
|
|
'label' => "Mes options",
|
|
'controller' => 'user',
|
|
'action' => 'index',
|
|
'permission' => 'monprofil'
|
|
),
|
|
array(
|
|
'label' => "Mes surveillances",
|
|
'controller' => 'surveillance',
|
|
'action' => 'liste',
|
|
'permission' => 'survliste'
|
|
),
|
|
array(
|
|
'label' => "Surveillances fichier",
|
|
'controller' => 'surveillance',
|
|
'action' => 'fichier',
|
|
),
|
|
array(
|
|
'label' => "Mon portefeuille",
|
|
'controller' => 'surveillance',
|
|
'action' => 'portefeuille',
|
|
'permission' => array('portefeuille'),
|
|
),
|
|
array(
|
|
'label' => "Administration",
|
|
'controller' => 'user',
|
|
'action' => 'liste',
|
|
),
|
|
array(
|
|
'label' => "Surveillances",
|
|
'controller' => '',
|
|
'action' => '',
|
|
),
|
|
array(
|
|
'label' => "Se déconnecter",
|
|
'controller' => 'user',
|
|
'action' => 'logout',
|
|
),
|
|
),
|
|
),
|
|
array(
|
|
'label' => 'GESTION S&D',
|
|
'check' => 'dashboard',
|
|
'activateMenu' => array(
|
|
array('controller'=>'dashboard', 'action'=>'clients'),
|
|
array('controller'=>'dashboard', 'action'=>'client'),
|
|
array('controller'=>'dashboard', 'action'=>'users'),
|
|
array('controller'=>'dashboard', 'action'=>'user'),
|
|
array('controller'=>'dashboard', 'action'=>'commandes'),
|
|
array('controller'=>'dashboard', 'action'=>'prestations'),
|
|
array('controller'=>'dashboard', 'action'=>'prestation'),
|
|
array('controller'=>'dashboard', 'action'=>'services'),
|
|
array('controller'=>'dashboard', 'action'=>'service'),
|
|
array('controller'=>'dashboard', 'action'=>'tarifs'),
|
|
array('controller'=>'dashboard', 'action'=>'tarif'),
|
|
),
|
|
'pages' => array(
|
|
array(
|
|
'label' => "Gestion",
|
|
'controller' => 'dashboard',
|
|
'action' => 'index',
|
|
),
|
|
array(
|
|
'label' => "Saisie / Edition",
|
|
'controller' => 'saisie',
|
|
'action' => 'fiche',
|
|
),
|
|
),
|
|
),
|
|
);
|
|
|
|
|
|
/**
|
|
* Construit le menu en fonction du siret et de l'identifiant S&D
|
|
* @param string $siret
|
|
* @param integer $id
|
|
*/
|
|
public function __construct($siret = null, $id = 0)
|
|
{
|
|
require_once 'Scores/SessionEntreprise.php';
|
|
|
|
$this->siret = $siret;
|
|
$this->id = $id;
|
|
$this->menu = new Zend_Navigation();
|
|
$this->computeMenu();
|
|
}
|
|
|
|
/**
|
|
* Retourne le menu généré
|
|
*/
|
|
public function getMenu()
|
|
{
|
|
return $this->menu;
|
|
}
|
|
|
|
/**
|
|
* Retourne la position du groupe à activé
|
|
* @param unknown_type $controller
|
|
* @param unknown_type $action
|
|
*/
|
|
public function getIdMenu($controller, $action)
|
|
{
|
|
$i = 0;
|
|
$stop = false;
|
|
foreach($this->defineMenu as $menu){
|
|
$perm = true;
|
|
if (array_key_exists('permission', $menu)){
|
|
$perm = $this->checkPermission($menu['permission']);
|
|
}
|
|
$visible = true;
|
|
if (array_key_exists('check', $menu)){
|
|
$visible = $this->checkMenu($menu['check']);
|
|
}
|
|
foreach($menu['pages'] as $item){
|
|
if($controller == $item['controller'] && $action == $item['action']){
|
|
$stop = true;
|
|
break;
|
|
}
|
|
}
|
|
if (array_key_exists('activateMenu', $menu)){
|
|
foreach($menu['activateMenu'] as $item){
|
|
if($controller == $item['controller'] && $action == $item['action']){
|
|
$stop = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if ($stop === true) break;
|
|
if ($perm && $visible){
|
|
$i++;
|
|
}
|
|
}
|
|
return $i;
|
|
}
|
|
|
|
/**
|
|
* Parcours la définition du menu en gérant les permissions et autres
|
|
* particularités
|
|
*/
|
|
protected function computeMenu()
|
|
{
|
|
foreach($this->defineMenu as $element){
|
|
$perm = true;
|
|
if (array_key_exists('permission', $element)){
|
|
$perm = $this->checkPermission($element['permission']);
|
|
}
|
|
$visible = true;
|
|
if (array_key_exists('check', $element)){
|
|
$visible = $this->checkMenu($element['check']);
|
|
}
|
|
if ($perm && $visible){
|
|
$menu = array();
|
|
$menu['label'] = $element['label'];
|
|
$menu['uri'] = '#';
|
|
$menu['class'] = 'header';
|
|
if (array_key_exists('pages', $element)){
|
|
$menu['pages'] = $this->computePage($element['pages']);
|
|
}
|
|
$this->menu->addPage($menu);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Parcours les pages d'un groupe du menu pour vérifier les permissions
|
|
* et autres particularités
|
|
* @param array $pages
|
|
*/
|
|
protected function computePage($pages)
|
|
{
|
|
$computePages = array();
|
|
foreach($pages as $page){
|
|
$visible = false;
|
|
if (array_key_exists('forceVisible', $page)){
|
|
$visible = $page['forceVisible'];
|
|
}
|
|
$perm = true;
|
|
if (array_key_exists('permission', $page)){
|
|
$perm = $this->checkPermission($page['permission']);
|
|
}
|
|
|
|
//Label spécial utilisateur
|
|
$user = new Scores_Utilisateur();
|
|
if ($user->getIdClient()==60 && $page['controller']=='identite' && $page['action']=='fichepc') {
|
|
$page['label'] = 'Fiche AGS';
|
|
}
|
|
if (!$perm && $visible){
|
|
$computePage = array();
|
|
$computePage['label'] = $page['label'];
|
|
$computePage['class'] = 'inactif';
|
|
$computePage['uri'] = '#';
|
|
$computePages[] = $computePage;
|
|
} elseif ($perm){
|
|
if ($this->checkParams($page['controller'], $page['action'])){
|
|
$computePage = array();
|
|
$computePage = $page;
|
|
$computePage['params'] = $this->setParams($page['controller'], $page['action']);
|
|
|
|
if (array_key_exists('pref', $page)){
|
|
if ($this->hasPref('demanderef') && in_array('demanderef', $page['pref']) ){ // @todo: Erreur data
|
|
$computePage['class'] = 'demanderef';
|
|
}
|
|
}
|
|
|
|
$computePages[] = $computePage;
|
|
} elseif ($visible) {
|
|
$computePage = array();
|
|
$computePage['label'] = $page['label'];
|
|
$computePage['class'] = 'inactif';
|
|
$computePage['uri'] = '#';
|
|
$computePages[] = $computePage;
|
|
}
|
|
}
|
|
}
|
|
return $computePages;
|
|
}
|
|
|
|
/**
|
|
* Vérifie les permissions de l'utilisateur
|
|
* Enter description here ...
|
|
* @param unknown_type $perm
|
|
*/
|
|
protected function checkPermission($perm)
|
|
{
|
|
$hasPerm = false;
|
|
if (is_array($perm)){
|
|
$list = $perm;
|
|
} else if (is_string($perm)){
|
|
$list = (array)$perm;
|
|
}
|
|
$user = new Scores_Utilisateur();
|
|
foreach($list as $permission){
|
|
if ($user->checkPerm($permission)){
|
|
$hasPerm = true;
|
|
break;
|
|
}
|
|
}
|
|
return $hasPerm;
|
|
}
|
|
|
|
/**
|
|
* Vérifie préférence utilisateur
|
|
* @param string $pref
|
|
*/
|
|
public function hasPref($pref)
|
|
{
|
|
$user = new Scores_Utilisateur();
|
|
if ($user->checkPref($pref)){
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Permet d'effectuer une vérification pour la visibilité d'un menu (Groupe)
|
|
* @param string $controller
|
|
*/
|
|
protected function checkMenu($controller)
|
|
{
|
|
switch($controller) {
|
|
case 'dashboard':
|
|
$user = new Scores_Utilisateur();
|
|
if ($user->checkModeEdition() && $user->getIdClient()==1){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Vérifie les paramètres pour un controller et/ou une action
|
|
* @param string $controller
|
|
* @param string $action
|
|
*/
|
|
protected function checkParams($controller, $action = '')
|
|
{
|
|
switch($controller) {
|
|
case 'bdf':
|
|
return true;
|
|
break;
|
|
case 'dashboard':
|
|
return true;
|
|
break;
|
|
case 'recherche':
|
|
switch($action) {
|
|
case 'last':
|
|
case 'list':
|
|
//Vérifier la présence d'au moins une recherche
|
|
require_once 'Scores/RechercheHistorique.php';
|
|
$recherches = new RechercheHistorique();
|
|
if (count($recherches->liste()>0)){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'annonce':
|
|
$user = new Scores_Utilisateur();
|
|
if($user->checkPerm('histobodacc')){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
}
|
|
return true;
|
|
break;
|
|
case 'user':
|
|
switch($action){
|
|
case 'liste':
|
|
$user = new Scores_Utilisateur();
|
|
if ($user->isAdmin() || $user->isSuperAdmin()){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
}
|
|
return true;
|
|
break;
|
|
case 'surveillance':
|
|
switch($action) {
|
|
case 'fichier':
|
|
$user = new Scores_Utilisateur();
|
|
if (substr($user->getLogin(),0,6)=='cnasea'
|
|
|| strtolower($user->getLogin())=='omni04'
|
|
|| strtolower($user->getLogin())=='bodacca3m'
|
|
|| strtolower($user->getLogin())=='bodaccomni'
|
|
|| strtolower($user->getLogin())=='bodacccrr'
|
|
|| strtolower($user->getLogin())=='cpcambr13'
|
|
|| strtolower($user->getLogin())=='cpcambr14'
|
|
|| $user->getIdClient()==32
|
|
|| $user->getIdClient()==82 ) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
break;
|
|
}
|
|
return true;
|
|
break;
|
|
case 'identite':
|
|
switch($action) {
|
|
case 'fiche':
|
|
case 'fichepc':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
if ( !empty($this->id) && intval($this->id)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'groupe':
|
|
case 'etablissements':
|
|
case 'liens':
|
|
case 'evenements':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
}
|
|
break;
|
|
case 'dirigeant':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'finance':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'juridique':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
switch($action){
|
|
case 'annonces':
|
|
if ( !empty($this->id) && intval($this->id)!=0 ){
|
|
return true;
|
|
}
|
|
break;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'evaluation':
|
|
switch($action){
|
|
case 'indiscore':
|
|
$siretSiege = substr($this->siret, 0,9);
|
|
if (!empty($siretSiege) && intval($siretSiege)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
}
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'pieces':
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
|
return true;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'saisie':
|
|
switch($action){
|
|
case 'fiche':
|
|
if ( !empty($this->id) && intval($this->id)!=0 ){
|
|
return true;
|
|
}
|
|
break;
|
|
}
|
|
return false;
|
|
break;
|
|
case 'aide':
|
|
return true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Définit les paramètres nécessaire pour les liens des pages
|
|
* @param string $controller
|
|
* @param string $action
|
|
*/
|
|
protected function setParams($controller, $action)
|
|
{
|
|
$params = array();
|
|
/**
|
|
* Réinitialiser la route pour avoir toujours les liens du menu propre
|
|
*/
|
|
$params['route'] = null;
|
|
|
|
switch($controller) {
|
|
case 'recherche':
|
|
switch($action){
|
|
case 'ipari':
|
|
if (!empty($this->siret)) { $params['siret'] = $this->siret; }
|
|
break;
|
|
}
|
|
break;
|
|
case 'evaluation':
|
|
if (!empty($this->siret)) { $params['siret'] = $this->siret; }
|
|
if (!empty($this->id)) { $params['id'] = $this->id; }
|
|
switch($action){
|
|
case 'indiscore':
|
|
$session = new SessionEntreprise(null);
|
|
$params['siret'] = $session->getSiren();
|
|
break;
|
|
}
|
|
break;
|
|
case 'pieces':
|
|
case 'identite':
|
|
case 'finance':
|
|
case 'dirigeant':
|
|
if (!empty($this->siret)) { $params['siret'] = $this->siret; }
|
|
if (!empty($this->id)) { $params['id'] = $this->id; }
|
|
break;
|
|
case 'juridique':
|
|
if (!empty($this->siret)) { $params['siret'] = $this->siret; }
|
|
if (!empty($this->id)) { $params['id'] = $this->id; }
|
|
break;
|
|
case 'saisie':
|
|
switch($action){
|
|
case 'fiche':
|
|
if (!empty($this->siret)) {
|
|
$params['siret'] = $this->siret;
|
|
}
|
|
if (!empty($this->id)) {
|
|
$params['id'] = $this->id;
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
case 'bdf':
|
|
if (!empty($this->siret)) {
|
|
$params['siret'] = $this->siret;
|
|
}
|
|
break;
|
|
}
|
|
return $params;
|
|
}
|
|
}
|