2011-01-05 09:59:49 +00:00
|
|
|
<?php
|
|
|
|
class Menu
|
|
|
|
{
|
2011-01-05 15:14:23 +00:00
|
|
|
protected $menu = null;
|
2011-04-15 09:05:30 +00:00
|
|
|
protected $siret = null;
|
|
|
|
protected $id = 0;
|
2011-01-05 09:59:49 +00:00
|
|
|
protected $defineMenu = array(
|
|
|
|
array(
|
|
|
|
'label' => 'RECHERCHES',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Rechercher une entreprise",
|
2011-01-06 08:37:20 +00:00
|
|
|
'title' => "Rechercher une entreprise",
|
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'entreprise',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Rechercher par dirigeant",
|
2011-01-06 08:37:20 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'dirigeant',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Recherche Internationale",
|
|
|
|
'controller' => '',
|
|
|
|
'action' => '',
|
2011-04-15 10:25:46 +00:00
|
|
|
'permission' => 'INTERNATIONAL'
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-04-15 09:05:30 +00:00
|
|
|
array( // idClient = 1
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Rechercher une annonce",
|
2011-05-19 08:51:49 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'annonce',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-04-15 09:05:30 +00:00
|
|
|
array( // ModeEdition
|
|
|
|
'label' => "Rechercher par actionnaire",
|
2011-05-19 08:51:49 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'actionnaire'
|
2011-04-15 09:05:30 +00:00
|
|
|
),
|
|
|
|
array( // Vérifier la présence d'au moins une recherche
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Dernière recherche",
|
2011-01-06 08:37:20 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'last',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-04-15 09:05:30 +00:00
|
|
|
array( // Vérifier la présence d'au moins une recherche
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Liste des dernières recherches",
|
2011-01-06 08:37:20 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'list',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Centrale IparI",
|
2011-04-15 09:05:30 +00:00
|
|
|
'controller' => 'recherche',
|
|
|
|
'action' => 'ipari',
|
2011-01-05 15:14:23 +00:00
|
|
|
'permission' => 'ipari',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'IDENTITE',
|
|
|
|
'pages' => array(
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Fiche d'identité",
|
2011-04-15 09:05:30 +00:00
|
|
|
'controller' => 'identite',
|
|
|
|
'action' => 'fiche',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Fiche Procédure Collective",
|
2011-04-15 09:05:30 +00:00
|
|
|
'controller' => 'identite',
|
|
|
|
'action' => 'fichepc',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Liste des établissements",
|
2011-04-15 09:05:30 +00:00
|
|
|
'controller' => 'identite',
|
|
|
|
'action' => 'etablissements',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Liens inter-entreprise",
|
2011-04-18 15:25:26 +00:00
|
|
|
'controller' => 'identite',
|
|
|
|
'action' => 'liens',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Modifications Insee",
|
2011-04-18 15:25:26 +00:00
|
|
|
'controller' => 'identite',
|
2011-04-22 15:10:03 +00:00
|
|
|
'action' => 'evenements',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'DIRIGEANTS',
|
|
|
|
'pages' => array(
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Liste des dirigeants",
|
2011-04-19 06:23:20 +00:00
|
|
|
'controller' => 'dirigeant',
|
|
|
|
'action' => 'liste',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-05-03 15:58:48 +00:00
|
|
|
array(
|
2011-01-05 09:59:49 +00:00
|
|
|
'label' => "Historique des dirigeants",
|
2011-04-19 06:23:20 +00:00
|
|
|
'controller' => 'dirigeant',
|
|
|
|
'action' => 'histo',
|
2011-05-09 08:47:50 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'ELEMENTS FINANCIERS',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Synthèse",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'synthese',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Bilans, Compte de résultat",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'bilan',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Ratios",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'ratios',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Liasse fiscale",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'liasse',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Bourse & Cotations",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'bourse',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Relations bancaires",
|
2011-04-19 07:21:06 +00:00
|
|
|
'controller' => 'finance',
|
|
|
|
'action' => 'banque',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'ELEMENTS JURIDIQUES',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Annonces Légales",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'juridique',
|
|
|
|
'action' => 'annonces',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Information Réglementée",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'juridique',
|
|
|
|
'action' => 'infosreg',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Compétences Territoriales",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'juridique',
|
|
|
|
'action' => 'competences',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Conventions collectives",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'juridique',
|
|
|
|
'action' => 'conventions',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Marques déposées",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'juridique',
|
2011-05-02 13:38:52 +00:00
|
|
|
'action' => 'marques',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'BANQUE DE FRANCE',
|
2011-01-05 15:14:23 +00:00
|
|
|
'permission' => 'BDF',
|
2011-01-05 09:59:49 +00:00
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "27. Panorama",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "28. Concours Bancaires",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "29. Impayés",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "40. Relations Bancaires",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "51. Dirigeants",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Autres",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'bdf',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'EVALUATION',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "IndiScore",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'evaluation',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Rapport de synthèse",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'evaluation',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Rapport complet",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'evaluation',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Scoring Credit Safe",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'evaluation',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Enquête commerciale",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'evaluation',
|
2011-05-19 08:51:49 +00:00
|
|
|
'action' => 'enquetec',
|
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'PIECES OFFICIELLES',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Commande de Pièces",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'pieces',
|
2011-05-06 14:25:50 +00:00
|
|
|
'action' => 'commande',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Comptes annuels",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'pieces',
|
2011-05-06 14:25:50 +00:00
|
|
|
'action' => 'bilans',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Actes & Statuts",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'pieces',
|
2011-05-06 14:25:50 +00:00
|
|
|
'action' => 'actes',
|
2011-05-17 15:05:31 +00:00
|
|
|
'forceVisible' => true,
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Suivi Privilèges",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'pieces',
|
2011-05-06 14:25:50 +00:00
|
|
|
'action' => 'privileges',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => 'OPTIONS',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Mes options",
|
2011-01-07 17:16:07 +00:00
|
|
|
'controller' => 'user',
|
|
|
|
'action' => 'index',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Mes surveillances",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'surveillance',
|
|
|
|
'action' => 'liste',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
2011-05-24 06:25:58 +00:00
|
|
|
array(
|
|
|
|
'label' => "Surveillances fichier",
|
|
|
|
'controller' => 'surveillance',
|
|
|
|
'action' => 'fichier',
|
|
|
|
),
|
2011-01-05 09:59:49 +00:00
|
|
|
array(
|
|
|
|
'label' => "Mon portefeuille",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'surveillance',
|
|
|
|
'action' => 'portefeuille',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Administration",
|
2011-05-03 15:58:48 +00:00
|
|
|
'controller' => 'user',
|
|
|
|
'action' => 'liste',
|
2011-01-05 09:59:49 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Commandes Greffe",
|
2011-04-20 07:25:37 +00:00
|
|
|
'controller' => 'dashboard',
|
2011-01-05 09:59:49 +00:00
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Commandes International",
|
|
|
|
'controller' => '',
|
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Commandes Giant",
|
|
|
|
'controller' => '',
|
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Surveillances",
|
|
|
|
'controller' => '',
|
|
|
|
'action' => '',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'label' => "Se déconnecter",
|
|
|
|
'controller' => 'user',
|
|
|
|
'action' => 'logout',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2011-05-17 15:05:31 +00:00
|
|
|
array(
|
|
|
|
'label' => 'GESTION S&D',
|
|
|
|
'check' => 'dashboard',
|
|
|
|
'pages' => array(
|
|
|
|
array(
|
|
|
|
'label' => "Gestion",
|
|
|
|
'controller' => 'dashboard',
|
|
|
|
'action' => 'index',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2011-01-05 09:59:49 +00:00
|
|
|
);
|
|
|
|
|
2011-04-15 09:05:30 +00:00
|
|
|
public function __construct($siret = null, $id = 0){
|
|
|
|
$this->siret = $siret;
|
|
|
|
$this->id = $id;
|
2011-01-05 15:14:23 +00:00
|
|
|
$this->menu = new Zend_Navigation();
|
2011-01-05 09:59:49 +00:00
|
|
|
$this->computeMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMenu(){
|
|
|
|
return $this->menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function computeMenu(){
|
|
|
|
foreach($this->defineMenu as $element){
|
|
|
|
$perm = true;
|
2011-01-05 15:14:23 +00:00
|
|
|
if (array_key_exists('permission', $element)){
|
|
|
|
$perm = $this->checkPermission($element['permission']);
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
2011-05-17 15:05:31 +00:00
|
|
|
$visible = true;
|
|
|
|
if (array_key_exists('check', $element)){
|
|
|
|
$visible = $this->checkMenu($element['check']);
|
|
|
|
}
|
|
|
|
if ($perm && $visible){
|
2011-01-05 09:59:49 +00:00
|
|
|
$menu = array();
|
|
|
|
$menu['label'] = $element['label'];
|
2011-01-05 15:14:23 +00:00
|
|
|
$menu['uri'] = '#';
|
2011-04-01 12:14:40 +00:00
|
|
|
$menu['class'] = 'header';
|
2011-01-05 09:59:49 +00:00
|
|
|
if (array_key_exists('pages', $element)){
|
2011-01-05 15:14:23 +00:00
|
|
|
$menu['pages'] = $this->computePage($element['pages']);
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
2011-01-05 15:14:23 +00:00
|
|
|
$this->menu->addPage($menu);
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-15 09:05:30 +00:00
|
|
|
protected function computePage($pages) {
|
2011-01-05 15:14:23 +00:00
|
|
|
$computePages = array();
|
|
|
|
foreach($pages as $page){
|
|
|
|
$visible = false;
|
2011-05-03 15:58:48 +00:00
|
|
|
if (array_key_exists('forceVisible', $page)){
|
|
|
|
$visible = $page['forceVisible'];
|
2011-01-05 15:14:23 +00:00
|
|
|
}
|
2011-01-05 09:59:49 +00:00
|
|
|
$perm = true;
|
2011-01-05 15:14:23 +00:00
|
|
|
if (array_key_exists('permission', $page)){
|
|
|
|
$perm = $this->checkPermission($page['permission']);
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
2011-04-21 13:57:47 +00:00
|
|
|
if (!$perm && $visible){
|
2011-01-05 15:14:23 +00:00
|
|
|
$computePage = array();
|
|
|
|
$computePage['label'] = $page['label'];
|
2011-04-21 13:57:47 +00:00
|
|
|
$computePage['class'] = 'inactif';
|
2011-01-05 15:14:23 +00:00
|
|
|
$computePage['uri'] = '#';
|
|
|
|
$computePages[] = $computePage;
|
2011-04-21 13:57:47 +00:00
|
|
|
} elseif ($perm){
|
|
|
|
if ($this->checkParams($page['controller'], $page['action'])){
|
|
|
|
$computePage = array();
|
|
|
|
$computePage = $page;
|
|
|
|
$computePage['params'] = $this->setParams($page['controller'], $page['action']);
|
|
|
|
$computePages[] = $computePage;
|
2011-05-03 15:58:48 +00:00
|
|
|
} elseif ($visible) {
|
2011-04-21 13:57:47 +00:00
|
|
|
$computePage = array();
|
|
|
|
$computePage['label'] = $page['label'];
|
|
|
|
$computePage['class'] = 'inactif';
|
|
|
|
$computePage['uri'] = '#';
|
|
|
|
$computePages[] = $computePage;
|
|
|
|
}
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
|
|
|
}
|
2011-01-05 15:14:23 +00:00
|
|
|
return $computePages;
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
|
|
|
|
2011-04-15 09:05:30 +00:00
|
|
|
protected function checkPermission($perm) {
|
2011-01-05 09:59:49 +00:00
|
|
|
$hasPerm = false;
|
2011-01-05 15:14:23 +00:00
|
|
|
if (is_array($perm)){
|
|
|
|
$list = $perm;
|
|
|
|
} else if (is_string($perm)){
|
|
|
|
$list = (array)$perm;
|
|
|
|
}
|
2011-01-07 17:16:07 +00:00
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
$droits = $auth->getIdentity()->droits;
|
2011-01-05 15:14:23 +00:00
|
|
|
foreach($list as $permission){
|
2011-01-07 17:16:07 +00:00
|
|
|
if (preg_match('/\b'.$permission.'\b/i', $droits)){
|
2011-01-05 15:14:23 +00:00
|
|
|
$hasPerm = true;
|
|
|
|
break;
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $hasPerm;
|
|
|
|
}
|
|
|
|
|
2011-05-17 15:05:31 +00:00
|
|
|
protected function checkMenu($controller)
|
|
|
|
{
|
|
|
|
switch($controller) {
|
|
|
|
case 'dashboard':
|
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
if (in_array($auth->getIdentity()->profil, array('Administrateur', 'SuperAdministrateur'))
|
|
|
|
&& $auth->getIdentity()->modeEdition && $auth->getIdentity()->idClient==1 ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
2011-04-15 09:05:30 +00:00
|
|
|
}
|
|
|
|
|
2011-05-17 15:05:31 +00:00
|
|
|
protected function checkParams($controller, $action = '')
|
2011-04-21 13:57:47 +00:00
|
|
|
{
|
2011-04-21 14:06:08 +00:00
|
|
|
switch($controller) {
|
2011-05-17 15:05:31 +00:00
|
|
|
case 'dashboard':
|
|
|
|
return true;
|
|
|
|
break;
|
2011-05-03 15:58:48 +00:00
|
|
|
case 'administration':
|
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
if (in_array($auth->getIdentity()->profil,
|
|
|
|
array('Administrateur', 'SuperAdministrateur'))) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
2011-04-21 14:06:08 +00:00
|
|
|
case 'recherche':
|
|
|
|
return true;
|
|
|
|
break;
|
2011-04-21 14:21:12 +00:00
|
|
|
case 'user':
|
|
|
|
return true;
|
|
|
|
break;
|
|
|
|
case 'surveillance':
|
2011-05-24 06:25:58 +00:00
|
|
|
switch($action) {
|
|
|
|
case 'fichier':
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2011-04-21 14:21:12 +00:00
|
|
|
return true;
|
|
|
|
break;
|
2011-04-21 13:57:47 +00:00
|
|
|
case 'identite':
|
|
|
|
case 'dirigeant':
|
|
|
|
case 'finance':
|
2011-04-21 14:06:08 +00:00
|
|
|
case 'evaluation':
|
|
|
|
case 'juridique':
|
|
|
|
case 'pieces':
|
|
|
|
if ( !empty($this->siret) && intval($this->siret)!=0 )
|
|
|
|
return true;
|
|
|
|
if ( !empty($this->id) )
|
|
|
|
return true;
|
|
|
|
return false;
|
2011-04-21 13:57:47 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-15 09:05:30 +00:00
|
|
|
protected function setParams($controller, $action){
|
|
|
|
$params = array();
|
|
|
|
switch($controller) {
|
2011-04-15 10:25:46 +00:00
|
|
|
case 'recherche':
|
2011-04-21 14:06:08 +00:00
|
|
|
break;
|
2011-05-20 08:25:05 +00:00
|
|
|
case 'evaluation':
|
2011-05-06 14:25:50 +00:00
|
|
|
case 'pieces':
|
2011-05-02 07:20:13 +00:00
|
|
|
case 'juridique':
|
2011-04-15 09:05:30 +00:00
|
|
|
case 'identite':
|
2011-05-02 07:20:13 +00:00
|
|
|
case 'finance':
|
2011-04-19 06:23:20 +00:00
|
|
|
case 'dirigeant':
|
2011-04-19 07:21:06 +00:00
|
|
|
if (!empty($this->siret)) { $params['siret'] = $this->siret; }
|
|
|
|
if (!empty($this->id)) { $params['id'] = $this->id; }
|
2011-04-19 06:23:20 +00:00
|
|
|
break;
|
2011-04-15 09:05:30 +00:00
|
|
|
}
|
|
|
|
return $params;
|
|
|
|
}
|
2011-01-05 09:59:49 +00:00
|
|
|
}
|