/[openfoncier]/trunk/obj/utils.class.php
ViewVC logotype

Annotation of /trunk/obj/utils.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8477 - (hide annotations)
Fri Dec 14 10:14:10 2018 UTC (6 years, 1 month ago) by softime
File size: 152256 byte(s)
* Merge de la branche d'intégration 4.9.0-develop vers le trunk

1 mbroquet 3730 <?php
2     /**
3     * Ce fichier est destine a permettre la surcharge de certaines methodes de
4     * la classe om_application pour des besoins specifiques de l'application
5     *
6     * @package openmairie_exemple
7     * @version SVN : $Id: utils.class.php 6132 2016-03-09 09:18:18Z stimezouaght $
8     */
9    
10     /**
11     *
12     */
13 softime 8329 if (file_exists("../dyn/locales.inc.php") === true) {
14     require_once "../dyn/locales.inc.php";
15     }
16 mbroquet 3730
17     /**
18     *
19     */
20 softime 8329 if (file_exists("../dyn/include.inc.php") === true) {
21     require_once "../dyn/include.inc.php";
22     } else {
23     /**
24     * Définition de la constante représentant le chemin d'accès au framework
25     */
26     define("PATH_OPENMAIRIE", getcwd()."/../core/");
27    
28     /**
29     * Dépendances PHP du framework
30     * On modifie la valeur de la directive de configuration include_path en
31     * fonction pour y ajouter les chemins vers les librairies dont le framework
32     * dépend.
33     */
34     set_include_path(
35     get_include_path().PATH_SEPARATOR.implode(
36     PATH_SEPARATOR,
37     array(
38     getcwd()."/../php/pear",
39     getcwd()."/../php/db",
40     getcwd()."/../php/fpdf",
41     getcwd()."/../php/phpmailer",
42     getcwd()."/../php/tcpdf",
43     )
44     )
45     );
46 mbroquet 3730
47 softime 8329 /**
48     * Retourne l'URL de la racine d'openADS.
49     * Exemple : http://localhost/openads/
50     */
51     if (!function_exists("get_base_url")) {
52     function get_base_url() {
53     // Récupération du protocole
54     $protocol = 'http';
55     if (isset($_SERVER['HTTPS'])) {
56     $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
57     }
58     // Récupération du domaine
59     $domain = $_SERVER['HTTP_HOST'];
60     // Récupération du port
61     $port = $_SERVER['SERVER_PORT'];
62     $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
63     // Construction du chemin restant
64     $base_url = str_replace('app', '', rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
65     //
66     return $protocol."://".$domain.$disp_port.$base_url;
67     }
68     }
69     define("PATH_BASE_URL", get_base_url());
70     }
71    
72 mbroquet 3730 /**
73     *
74     */
75 softime 8329 if (file_exists("../dyn/debug.inc.php") === true) {
76     require_once "../dyn/debug.inc.php";
77     }
78 mbroquet 3730
79     /**
80     *
81     */
82     (defined("PATH_OPENMAIRIE") ? "" : define("PATH_OPENMAIRIE", ""));
83    
84     /**
85     *
86     */
87     require_once PATH_OPENMAIRIE."om_application.class.php";
88    
89     /**
90     *
91     */
92     class utils extends application {
93    
94 fmichon 4471 /**
95 softime 8329 * Gestion du nom de l'application.
96     *
97     * @var mixed Configuration niveau application.
98     */
99     protected $_application_name = "openADS";
100    
101     /**
102     * Titre HTML.
103     *
104     * @var mixed Configuration niveau application.
105     */
106     protected $html_head_title = ":: openMairie :: openADS";
107    
108     /**
109     * Gestion du nom de la session.
110     *
111     * @var mixed Configuration niveau application.
112     */
113     protected $_session_name = "openads";
114    
115     /**
116 fmichon 4471 * Gestion du favicon de l'application.
117     *
118     * @var mixed Configuration niveau application.
119     */
120     var $html_head_favicon = '../app/img/favicon.ico';
121    
122 softime 8329 /**
123     * Gestion du mode de gestion des permissions.
124     *
125     * @var mixed Configuration niveau application.
126     */
127     protected $config__permission_by_hierarchical_profile = false;
128    
129 mbroquet 3730 // {{{
130    
131     /**
132     * SURCHARGE DE LA CLASSE OM_APPLICATION.
133     *
134     * @see Documentation sur la méthode parent 'om_application:getCollectivite'.
135     */
136     function getCollectivite($om_collectivite_idx = null) {
137     // On vérifie si une valeur a été passée en paramètre ou non.
138     if ($om_collectivite_idx === null) {
139     // Cas d'utilisation n°1 : nous sommes dans le cas où on
140     // veut récupérer les informations de la collectivité de
141     // l'utilisateur et on stocke l'info dans un flag.
142     $is_get_collectivite_from_user = true;
143     // On initialise l'identifiant de la collectivité
144     // à partir de la variable de session de l'utilisateur.
145     $om_collectivite_idx = $_SESSION['collectivite'];
146     } else {
147     // Cas d'utilisation n°2 : nous sommes dans le cas où on
148     // veut récupérer les informations de la collectivité
149     // passée en paramètre et on stocke l'info dans le flag.
150     $is_get_collectivite_from_user = false;
151     }
152     //
153     $collectivite_parameters = parent::getCollectivite($om_collectivite_idx);
154    
155     //// BEGIN - SURCHARGE OPENADS
156    
157     // Ajout du paramétrage du sig pour la collectivité
158     if (file_exists("../dyn/var.inc")) {
159     include "../dyn/var.inc";
160     }
161     if (file_exists("../dyn/sig.inc.php")) {
162     include "../dyn/sig.inc.php";
163     }
164 softime 4760 if (!isset($sig_externe)) {
165     $sig_externe = "sig-default";
166     }
167 mbroquet 3730 $idx_multi = $this->get_idx_collectivite_multi();
168    
169 softime 4749 if (isset($collectivite_parameters['om_collectivite_idx'])
170     && isset($conf[$sig_externe][$collectivite_parameters['om_collectivite_idx']])
171     && isset($conf[$sig_externe]["sig_treatment_mod"])
172     && isset($collectivite_parameters["option_sig"])
173     && $collectivite_parameters["option_sig"] == "sig_externe"
174 mbroquet 3730 ) {
175    
176     // Cas numéro 1 : conf sig définie sur la collectivité et option sig active
177     $collectivite_parameters["sig"] = $conf[$sig_externe][$collectivite_parameters['om_collectivite_idx']];
178 nhaye 4099 $collectivite_parameters["sig"]["sig_treatment_mod"] = $conf[$sig_externe]["sig_treatment_mod"];
179 mbroquet 3730
180 softime 4749 } elseif($idx_multi != ''
181     && isset($conf[$sig_externe][$idx_multi])
182     && isset($conf[$sig_externe]["sig_treatment_mod"])
183     && isset($collectivite_parameters["option_sig"])
184     && $collectivite_parameters["option_sig"] == "sig_externe") {
185 mbroquet 3730 // Cas numéro : conf sig définie sur la collectivité multi et
186     // option_sig activé pour la collectivité mono
187     $collectivite_parameters["sig"] = $conf[$sig_externe][$idx_multi];
188 nhaye 4099 $collectivite_parameters["sig"]["sig_treatment_mod"] = $conf[$sig_externe]["sig_treatment_mod"];
189 mbroquet 3730 }
190    
191     //// END - SURCHARGE OPENADS
192    
193     // Si on se trouve dans le cas d'utilisation n°1
194     if ($is_get_collectivite_from_user === true) {
195     // Alors on stocke dans l'attribut collectivite le tableau de
196     // paramètres pour utilisation depuis la méthode 'getParameter'.
197     $this->collectivite = $collectivite_parameters;
198     }
199     // On retourne le tableau de paramètres.
200     return $collectivite_parameters;
201     }
202    
203     /**
204     * Retourne l'identifiant de la collectivité multi ou l'identifiant de la
205     * seule collectivité dans le cas d'une installation mono.
206     *
207     * @return integer Identifiant de la collectivité multi.
208     */
209     public function get_idx_collectivite_multi() {
210     // Récupère l'identifiant de la collectivité de niveau 2
211     $sql = "SELECT om_collectivite FROM ".DB_PREFIXE."om_collectivite WHERE niveau = '2'";
212     $idx = $this->db->getOne($sql);
213     $this->addToLog(__METHOD__.": db->getOne(\"".$sql."\");", VERBOSE_MODE);
214     $this->isDatabaseError($idx);
215    
216     // S'il n'y a pas de collectivité de niveau 2
217     if ($idx == null || $idx == '') {
218    
219     // Compte le nombre de collectivité
220     $sql = "SELECT count(om_collectivite) FROM ".DB_PREFIXE."om_collectivite";
221     $count = $this->db->getOne($sql);
222     $this->addToLog(__METHOD__.": db->getOne(\"".$sql."\");", VERBOSE_MODE);
223     $this->isDatabaseError($count);
224    
225     // S'il y qu'une collectivité
226     if ($count == 1) {
227    
228     // Récupère l'identifiant de la seule collectivité
229     $sql = "SELECT om_collectivite FROM ".DB_PREFIXE."om_collectivite WHERE niveau = '1'";
230     $idx = $this->db->getOne($sql);
231     $this->addToLog(__METHOD__.": db->getOne(\"".$sql."\");", VERBOSE_MODE);
232     $this->isDatabaseError($idx);
233     }
234    
235     }
236    
237     // Retourne l'identifiant
238     return $idx;
239     }
240    
241    
242     /**
243     * Retourne l'identifiant de la collectivité de l'element de la table passée
244     * en paramètre.
245     *
246     * @param string $table Table de l'element.
247     * @param mixed $id Identifiant de l'element.
248     *
249     * @return string identifiant de la collectivite ou false si l'element n'existe pas.
250     */
251     public function get_collectivite_of_element($table, $id) {
252 softime 7996 $instance = $this->get_inst__om_dbform(array(
253     "obj" => $table,
254     "idx" => $id,
255     ));
256 mbroquet 3730 if($instance->getVal($instance->clePrimaire) != '') {
257     return $instance->getVal('om_collectivite');
258     }
259     return false;
260     }
261    
262    
263     /**
264 softime 6929 * Retourne vrai si la collectivité passée en paramètre ou la collectivité
265     * de l'utilisateur connecté est mono.
266     *
267     * @param string $id Identifiant de la collectivité.
268     *
269     * @return boolean
270 mbroquet 3730 */
271 softime 6929 public function isCollectiviteMono($id = null) {
272     // Si on ne passe pas de collectivité en argument
273     if ($id == null) {
274     // On vérifie la collectivité stockée en session de l'utilisateur
275     // connecté
276     $res = false;
277     if ($_SESSION['niveau'] === '1') {
278     //
279     $res = true;
280     }
281     //
282     return $res;
283     }
284    
285     // Requête SQL
286 mbroquet 3730 $sql = "SELECT niveau FROM ".DB_PREFIXE."om_collectivite WHERE om_collectivite = ".$id;
287     $niveau = $this->db->getOne($sql);
288     $this->addToLog(__METHOD__.": db->getOne(\"".$sql."\");", VERBOSE_MODE);
289     $this->isDatabaseError($niveau);
290 softime 6929
291     //
292     if ($niveau === '1') {
293     //
294 mbroquet 3730 return true;
295     }
296 softime 6929 //
297 mbroquet 3730 return false;
298     }
299    
300 softime 6929
301 mbroquet 3730 // }}}
302    
303     // {{{
304    
305     var $om_utilisateur = array();
306     var $user_is_instr = NULL;
307     var $user_is_service = NULL;
308     var $user_is_admin = NULL;
309     var $user_is_service_ext = NULL;
310     var $user_is_qualificateur = NULL;
311     var $user_is_chef = NULL;
312     var $user_is_divisionnaire = NULL;
313     var $user_is_service_int = NULL;
314    
315     /**
316     * Méthode de récupération des informations de l'utilisateur connecté.
317     */
318     function getUserInfos() {
319    
320     // Si l'utilisateur est loggé $_SESSION existe
321     if(isset($_SESSION['login']) AND !empty($_SESSION['login'])) {
322    
323     // Récupération des infos utilisateur
324     $sqlUser = "SELECT om_utilisateur, nom, email, login, om_collectivite, om_profil ".
325     "FROM ".DB_PREFIXE."om_utilisateur WHERE login = '".$_SESSION['login']."'";
326     $resUser=$this->db->query($sqlUser);
327     $this->addToLog("getUserInfos(): db->query(\"".$sqlUser."\");", VERBOSE_MODE);
328     if ( database::isError($resUser)){
329     die();
330     }
331     $this->om_utilisateur=&$resUser->fetchRow(DB_FETCHMODE_ASSOC);
332    
333     // Récupère le profil et test si c'est un
334     $sqlProfil = "SELECT libelle FROM ".DB_PREFIXE."om_profil WHERE om_profil = ".$this->om_utilisateur['om_profil'];
335     $resProfil=$this->db->getOne($sqlProfil);
336     $this->addToLog("getUserInfos(): db->getOne(\"".$sqlProfil."\");", VERBOSE_MODE);
337     if (database::isError($resProfil)){
338     die();
339     }
340     // Sauvegarde le libelle du profil
341     $this->om_utilisateur["libelle_profil"] = $resProfil;
342    
343     // si c'est un administrateur technique
344     // XXX Mauvaise méthode, il faut utiliser isAccredited
345     if ($resProfil == "ADMINISTRATEUR TECHNIQUE"
346     || $resProfil == "ADMINISTRATEUR FONCTIONNEL") {
347     $this->user_is_admin = true;
348     } else {
349     $this->user_is_admin = false;
350     }
351    
352     //si c'est un service externe
353     if ($resProfil == "SERVICE CONSULTÉ") {
354     $this->user_is_service_ext = true;
355     } else {
356     $this->user_is_service_ext = false;
357     }
358    
359     //si c'est un service interne
360     if ($resProfil == "SERVICE CONSULTÉ INTERNE") {
361     $this->user_is_service_int = true;
362     } else {
363     $this->user_is_service_int = false;
364     }
365    
366     // si c'est un qualificateur
367     if ($resProfil == "QUALIFICATEUR") {
368     $this->user_is_qualificateur = true;
369     } else {
370     $this->user_is_qualificateur = false;
371     }
372    
373     // si c'est un chef de service
374     if ($resProfil == "CHEF DE SERVICE") {
375     $this->user_is_chef = true;
376     } else {
377     $this->user_is_chef = false;
378     }
379    
380     // si c'est un divisionnaire
381     if ($resProfil == "DIVISIONNAIRE") {
382     $this->user_is_divisionnaire = true;
383     } else {
384     $this->user_is_divisionnaire = false;
385     }
386    
387     // Récupération des infos instructeur
388     $sqlInstr = "SELECT instructeur.instructeur, instructeur.nom, instructeur.telephone,
389     division.division, division.code, division.libelle ".
390     "FROM ".DB_PREFIXE."instructeur INNER JOIN ".DB_PREFIXE."division ON division.division=instructeur.division ".
391     "WHERE instructeur.om_utilisateur = ".$this->om_utilisateur['om_utilisateur'];
392     $resInstr=$this->db->query($sqlInstr);
393     $this->addToLog("getUserInfos(): db->query(\"".$sqlInstr."\");", VERBOSE_MODE);
394     if ( database::isError($resInstr)){
395     die();
396     }
397     $tempInstr=&$resInstr->fetchRow(DB_FETCHMODE_ASSOC);
398     // Si il y a un resultat c'est un instructeur
399     if(count($tempInstr)>0) {
400     $this->user_is_instr=true;
401     $this->om_utilisateur = array_merge($this->om_utilisateur,$tempInstr);
402     } else {
403     $this->user_is_instr=false;
404     }
405    
406     // Récupération des infos de services consultés
407     $sqlServ = "SELECT service.service, service.abrege, service.libelle ".
408     "FROM ".DB_PREFIXE."service ".
409     "INNER JOIN ".DB_PREFIXE."lien_service_om_utilisateur ON lien_service_om_utilisateur.service=service.service ".
410     "WHERE lien_service_om_utilisateur.om_utilisateur = ".$this->om_utilisateur['om_utilisateur'];
411     $resServ=$this->db->query($sqlServ);
412     $this->addToLog("getUserInfos(): db->query(\"".$sqlServ."\");", VERBOSE_MODE);
413     if ( database::isError($resServ)){
414     die();
415     }
416    
417     while ($tempServ=&$resServ->fetchRow(DB_FETCHMODE_ASSOC)) {
418     $this->om_utilisateur['service'][]=$tempServ;
419     }
420     // Si il y a un resultat c'est un utilisateur de service
421     if(isset($this->om_utilisateur['service'])) {
422     $this->user_is_service=true;
423     } else {
424     $this->user_is_service=false;
425     }
426     }
427     }
428    
429     /**
430     * getter user_is_service
431     */
432     function isUserService() {
433     //
434     if (is_null($this->user_is_service)) {
435     //
436     $this->getUserInfos();
437     }
438     //
439     return $this->user_is_service;
440     }
441    
442     /**
443     * getter user_is_instr
444     */
445     function isUserInstructeur() {
446     //
447     if (is_null($this->user_is_instr)) {
448     //
449     $this->getUserInfos();
450     }
451     //
452     return $this->user_is_instr;
453     }
454    
455     function isUserAdministrateur() {
456     //
457     if (is_null($this->user_is_admin)) {
458     //
459     $this->getUserInfos();
460     }
461     //
462     return $this->user_is_admin;
463     }
464    
465     /**
466     * getter user_is_service_ext
467     */
468     function isUserServiceExt() {
469     //
470     if (is_null($this->user_is_service_ext)) {
471     //
472     $this->getUserInfos();
473     }
474     //
475     return $this->user_is_service_ext;
476     }
477    
478     /**
479     * getter user_is_service_int
480     */
481     function isUserServiceInt() {
482     //
483     if (is_null($this->user_is_service_int)) {
484     //
485     $this->getUserInfos();
486     }
487     //
488     return $this->user_is_service_int;
489     }
490    
491     /**
492     * getter user_is_qualificateur
493     */
494     function isUserQualificateur() {
495     //
496     if (is_null($this->user_is_qualificateur)) {
497     //
498     $this->getUserInfos();
499     }
500     //
501     return $this->user_is_qualificateur;
502     }
503    
504     /**
505     * getter user_is_chef
506     */
507     function isUserChef() {
508     //
509     if (is_null($this->user_is_chef)) {
510     //
511     $this->getUserInfos();
512     }
513     //
514     return $this->user_is_chef;
515     }
516    
517     /**
518     * getter user_is_divisionnaire
519     */
520     function isUserDivisionnaire() {
521     //
522     if (is_null($this->user_is_divisionnaire)) {
523     //
524     $this->getUserInfos();
525     }
526     //
527     return $this->user_is_divisionnaire;
528     }
529    
530     /**
531     * Méthode permettant de définir si l'utilisateur connecté peut ajouter un
532     * événement d'instruction
533     *
534     * @param integer $idx identifiant du dossier
535     * @param string $obj objet
536     *
537     * @return boolean true si il peut false sinon
538     */
539     function isUserCanAddObj($idx, $obj) {
540     // Si il à le droit "bypass" il peut ajouter
541     if($this->isAccredited($obj."_ajouter_bypass") === true) {
542     return true;
543     }
544     if($this->isAccredited(array($obj."_ajouter", $obj), "OR") === false) {
545     return false;
546     }
547 softime 6565 $return = false;
548    
549 softime 7996 $object_instance = $this->get_inst__om_dbform(array(
550     "obj" => $obj,
551     "idx" => "]",
552     ));
553 mbroquet 3730 // Si il n'est pas dans la même division on défini le retour comme faux
554     // à moins qu'il ai un droit de changement de decision
555 softime 6565 if($this->isUserInstructeur() === true &&
556     ($object_instance->getDivisionFromDossier($idx) == $_SESSION["division"] or
557     ($obj == "instruction" &&
558     $object_instance->isInstrCanChangeDecision($idx) === true))) {
559 mbroquet 3730
560 softime 6565 $return = true;
561 mbroquet 3730 }
562    
563     return $return;
564     }
565    
566 softime 6565
567 mbroquet 3730 /**
568 softime 6565 * Ajout de variables de session contenant la division pour permettre une
569     * utilisation plus efficace dans les requetes.
570 mbroquet 3730 *
571 softime 6565 * @param array $utilisateur Tableau d'informations de l'utilisateur.
572 mbroquet 3730 */
573 softime 6929 function triggerAfterLogin($utilisateur = NULL) {
574 softime 6565 // Récupération de la division de l'utilisateur.
575 mbroquet 3730 $sql = "SELECT instructeur.division, division.code
576 softime 6565 FROM ".DB_PREFIXE."instructeur
577     LEFT JOIN ".DB_PREFIXE."division
578     ON instructeur.division = division.division
579     WHERE instructeur.om_utilisateur='".$utilisateur["om_utilisateur"]."'";
580 mbroquet 3730 $res = $this->db->query($sql);
581 softime 6565 $this->addToLog(
582     "triggerAfterLogin(): db->query(\"".$sql."\");",
583     VERBOSE_MODE
584     );
585     if (database::isError($res)) {
586 mbroquet 3730 die();
587     }
588     $row = $res->fetchrow(DB_FETCHMODE_ASSOC);
589 softime 6565 // Enregistrement de la division en session
590 mbroquet 3730 if (isset($row["division"]) && $row["division"] != NULL) {
591     $_SESSION["division"] = $row["division"];
592     $_SESSION["division_code"] = $row["code"];
593     } else {
594     $_SESSION["division"] = "0";
595     $_SESSION["division_code"] = "";
596     }
597 softime 6565 // Récupération du paramétrage des groupes de l'utilisateur.
598     $sqlGroupes = "SELECT groupe.code, lien_om_utilisateur_groupe.confidentiel, lien_om_utilisateur_groupe.enregistrement_demande, groupe.libelle
599     FROM ".DB_PREFIXE."groupe
600     RIGHT JOIN ".DB_PREFIXE."lien_om_utilisateur_groupe ON
601     lien_om_utilisateur_groupe.groupe = groupe.groupe
602 softime 6674 WHERE lien_om_utilisateur_groupe.login = '".$utilisateur["login"] ."'
603 softime 6565 ORDER BY libelle";
604     $resGroupes = $this->db->query($sqlGroupes);
605     $this->addToLog(
606     "triggerAfterLogin(): db->query(\"".$sqlGroupes."\");",
607     VERBOSE_MODE
608     );
609     if (database::isError($resGroupes)) {
610     die();
611     }
612     // Si aucun résultat alors récupération du paramétrage des groupes du profil
613     if ($resGroupes->numRows() === 0) {
614     $sqlGroupes = "SELECT groupe.code, lien_om_profil_groupe.confidentiel, lien_om_profil_groupe.enregistrement_demande, groupe.libelle
615     FROM ".DB_PREFIXE."groupe
616     RIGHT JOIN ".DB_PREFIXE."lien_om_profil_groupe ON
617     lien_om_profil_groupe.groupe = groupe.groupe
618     AND om_profil = ".$utilisateur["om_profil"] ."
619     ORDER BY libelle";
620     $resGroupes = $this->db->query($sqlGroupes);
621     $this->addToLog(
622     "triggerAfterLogin(): db->query(\"".$sqlGroupes."\");",
623     VERBOSE_MODE
624     );
625     if (database::isError($resGroupes)) {
626     die();
627     }
628     }
629     $_SESSION["groupe"] = array();
630     // Enregistrement des groupe en session
631     while ($row = $resGroupes->fetchrow(DB_FETCHMODE_ASSOC)) {
632     if ($row["confidentiel"] === 't') {
633     $row["confidentiel"] = true;
634     } else {
635     $row["confidentiel"] = false;
636     }
637     if ($row["enregistrement_demande"] === 't') {
638     $row["enregistrement_demande"] = true;
639     } else {
640     $row["enregistrement_demande"] = false;
641     }
642     $_SESSION["groupe"][$row["code"]] = array(
643     "confidentiel" => $row["confidentiel"],
644     "enregistrement_demande" => $row["enregistrement_demande"],
645     "libelle" => $row["libelle"],
646     );
647     }
648     }
649 mbroquet 3730
650     // Affichage des actions supplémentaires
651     function displayActionExtras() {
652     // Affichage de la division si l'utilisateur en possède une
653     if ($_SESSION["division"] != 0) {
654     echo "\t\t\t<li class=\"action-division\">";
655     echo "(".$_SESSION['division_code'].")";
656     echo "</li>\n";
657     }
658     }
659    
660     // }}}
661    
662    
663     // {{{ GESTION DES FICHIERS
664    
665     /**
666     *
667     */
668     function notExistsError ($explanation = NULL) {
669     // message
670     $message_class = "error";
671     $message = _("Cette page n'existe pas.");
672     $this->addToMessage ($message_class, $message);
673     //
674     $this->setFlag(NULL);
675     $this->display();
676    
677     //
678     die();
679     }
680    
681     // }}}
682     /**
683     * Retourne le statut du dossier d'instruction
684     * @param string $idx Identifiant du dossier d'instruction
685     * @return string Le statut du dossier d'instruction
686     */
687     function getStatutDossier($idx){
688    
689     $statut = '';
690    
691     //Si l'identifiant du dossier d'instruction fourni est correct
692     if ( $idx != '' ){
693    
694     //On récupère le statut de l'état du dossier à partir de l'identifiant du
695     //dossier d'instruction
696     $sql = "SELECT etat.statut
697     FROM ".DB_PREFIXE."dossier
698     LEFT JOIN
699     ".DB_PREFIXE."etat
700     ON
701     dossier.etat = etat.etat
702     WHERE dossier ='".$idx."'";
703     $statut = $this->db->getOne($sql);
704     $this->addToLog("getStatutDossier() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
705     if ( database::isError($statut)){
706     die();
707     }
708     }
709     return $statut;
710     }
711    
712     /**
713     * Formate le champ pour le type Timestamp
714     * @param date $date_str Date
715     * @param boolean $show Format pour l'affichage
716     * @return mixed False si le traitement échoue ou la date formatée
717     */
718     function formatTimestamp ($date_str, $show = true) {
719    
720     // Sépare la date et l'heure
721     $date = explode(" ", $date_str);
722     if (count($date) != 2) {
723     return false;
724     }
725    
726     // Date en BDD
727     $date_db = explode ('-', $date[0]);
728     // Date en affichage
729     $date_show = explode ('/', $date[0]);
730    
731     // Contrôle la composition de la date
732     if (count ($date_db) != 3 and count ($date_show) != 3) {
733     return false;
734     }
735    
736     if (count ($date_db) == 3) {
737     // Vérifie que c'est une date valide
738     if (!checkdate($date_db[1], $date_db[2], $date_db[0])) {
739     return false;
740     }
741     // Si c'est pour l'affichage de la date
742     if ($show == true) {
743     return $date_db [2]."/".$date_db [1]."/".$date_db [0]." ".$date[1];
744     } else {
745     return $date[0];
746     }
747     }
748    
749     //
750     if (count ($date_show) == 3) {
751     // Vérifie que c'est une date valide
752     if (!checkdate($date_show[1], $date_show[0], $date_show[2])) {
753     return false;
754     }
755     // Si c'est pour l'affichage de la date
756     if ($show == true) {
757     return $date[0];
758     } else {
759     return $date_show [2]."-".$date_show [1]."-".$date_show [0]." ".$date[1];
760     }
761    
762     }
763     return false;
764    
765     }
766    
767     /**
768     * Permet de calculer la liste des parcelles à partir de la chaîne passée en paramètre
769     * et la retourner sous forme d'un tableau associatif
770     *
771     * @param string $strParcelles Chaîne de la parcelles.
772     * @param string $collectivite_idx Collectivite de la parcelle.
773     *
774     * @return array (array(prefixe, quartier, section, parcelle), ...)
775     */
776     function parseParcelles($strParcelles, $collectivite_idx = null) {
777    
778     // Séparation des lignes
779     $references = explode(";", $strParcelles);
780     $liste_parcelles = array();
781    
782     // On boucle sur chaque ligne pour ajouter la liste des parcelles de chaque ligne
783     foreach ($references as $parcelles) {
784    
785     // On transforme la chaîne de la ligne de parcelles en tableau
786     $ref = str_split($parcelles);
787     // Les 1er caractères sont numériques
788     $num = true;
789    
790     // Tableau des champs de la ligne de références cadastrales
791     $reference_tab = array();
792     $temp = "";
793     foreach ($ref as $carac) {
794    
795     // Permet de tester si le caractère courant est de même type que le précédent
796     if(is_numeric($carac) === $num) {
797     $temp .= $carac;
798     } else {
799     // Bascule
800     $num = !$num;
801     // On stock le champ
802     $reference_tab[] = $temp;
803     // re-init de la valeur temporaire pour le champ suivant
804     $temp = $carac;
805     }
806     }
807     // Stockage du dernier champ sur lequel il n'y a pas eu de bascule
808     $reference_tab[] = $temp;
809     // Calcul des parcelles
810     $quartier = $reference_tab[0];
811     $sect = $reference_tab[1];
812    
813     $ancien_ref_parc = "";
814     for ($i=2; $i < count($reference_tab); $i+=2) {
815     if($collectivite_idx != null) {
816     // Récupération du code impot de l'arrondissement
817     $collectivite = $this->getCollectivite($collectivite_idx);
818     $parc["prefixe"] = $this->get_arrondissement_code_impot($quartier);
819     }
820     $parc["quartier"] = $quartier;
821     // Met en majuscule si besoin
822     $parc["section"] = strtoupper($sect);
823     if( $ancien_ref_parc == "" OR $reference_tab[$i-1] == "/") {
824     // 1ere parcelle ou parcelle individuelle
825     // Compléte par des "0" le début de la chaîne si besoin
826     $parc["parcelle"] = str_pad($reference_tab[$i], 4, "0", STR_PAD_LEFT);
827     // Ajout d'une parcelle à la liste
828     $liste_parcelles[] = $parc;
829     } elseif ($reference_tab[$i-1] == "A") {
830     // Interval de parcelles
831     for ($j=$ancien_ref_parc+1; $j <= $reference_tab[$i]; $j++) {
832     // Compléte par des "0" le début de la chaîne si besoin
833     $parc["parcelle"] = str_pad($j, 4, "0", STR_PAD_LEFT);
834     // Ajout d'une parcelle à la liste
835     $liste_parcelles[] = $parc;
836     }
837     }
838     //Gestion des erreurs
839     else{
840    
841     echo _("Une erreur de formattage a ete detecte dans la reference cadastrale du dossier ").$this->row['dossier'];
842     }
843     // Sauvegarde de la référence courante de parcelle
844     $ancien_ref_parc = $reference_tab[$i];
845     }
846     }
847    
848     return $liste_parcelles;
849     }
850    
851    
852     /**
853     * Récupère le code impôt par rapport au quartier.
854     *
855     * @param string $quartier Numéro de quartier.
856     * @return string Code impôts.
857     */
858     protected function get_arrondissement_code_impot($quartier) {
859     // Initialisation
860     $code_impots = "";
861     // Si le quartier fournis est correct
862     if ($quartier != "") {
863     // Requête SQL
864     $sql = "SELECT
865     arrondissement.code_impots
866     FROM
867     ".DB_PREFIXE."arrondissement
868     LEFT JOIN
869     ".DB_PREFIXE."quartier
870     ON
871     quartier.arrondissement = arrondissement.arrondissement
872     WHERE
873     quartier.code_impots = '".$quartier."'";
874    
875     }
876     $code_impots = $this->db->getOne($sql);
877     if ($code_impots === null) {
878     $code_impots = "";
879     }
880     $this->isDatabaseError($code_impots);
881     // Retour
882     return $code_impots;
883     }
884    
885    
886     /**
887     * Formate les parcelles en ajoutant le code impôt
888     * @param array $liste_parcelles Tableau des parcelles
889     * @return string Liste des parcelles formatées
890     */
891     function formatParcelleToSend($liste_parcelles) {
892    
893     //
894     $wParcelle = array();
895    
896     //Formatage des références cadastrales pour l'envoi
897     foreach ($liste_parcelles as $value) {
898    
899     // On ajoute les données dans le tableau que si quartier + section + parcelle
900     // a été fourni
901     if ($value["quartier"] !== ""
902     && $value["section"] !== ""
903     && $value["parcelle"] !== ""){
904    
905     //On récupère le code impôt de l'arrondissement
906     $arrondissement = $this->getCodeImpotByQuartier($value["quartier"]);
907    
908     //On ajoute la parcelle, si un arrondissement a été trouvé
909     if ($arrondissement!=="") {
910     //
911     $wParcelle[] = $arrondissement.$value["quartier"].
912     str_pad($value["section"], 2, " ", STR_PAD_LEFT).
913     $value["parcelle"];
914     }
915     }
916     }
917    
918     //
919     return $wParcelle;
920     }
921    
922     /**
923     * Récupère le code impôt par rapport au quartier
924     * @param string $quartier Numéro de quartier
925     * @return string Code impôt
926     */
927     function getCodeImpotByQuartier($quartier) {
928    
929     $arrondissement = "";
930    
931     // Si le quartier fournis est correct
932     if ($quartier != "") {
933    
934     // Requête SQL
935     $sql = "SELECT
936     arrondissement.code_impots
937     FROM
938     ".DB_PREFIXE."arrondissement
939     LEFT JOIN
940     ".DB_PREFIXE."quartier
941     ON
942     quartier.arrondissement = arrondissement.arrondissement
943     WHERE
944     quartier.code_impots = '".$quartier."'";
945     $this->addToLog("getCodeImpotByQuartier() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
946     $arrondissement = $this->db->getOne($sql);
947     $this->isDatabaseError($arrondissement);
948     }
949    
950     // Retour
951     return $arrondissement;
952     }
953    
954    
955     /**
956     * Retourne true si tous les paramètres du SIG externe ont bien été définis
957     * @return bool true/false
958     */
959     public function issetSIGParameter($idx) {
960     $collectivite_idx = $this->get_collectivite_of_element("dossier", $idx);
961     $collectivite = $this->getCollectivite($collectivite_idx);
962     if(isset($collectivite["sig"])) {
963     return true;
964     } else {
965     return false;
966     }
967     }
968    
969     /**
970     * Permet de vérifier que des champs existe dans une table
971     * @param array $list_fields Liste des champs à tester
972     * @param string $table Table où les champs doivent exister
973     * @return mixed Retourne les champs qui n'existent pas
974     * ou true
975     */
976     public function check_field_exist($list_fields, $table) {
977    
978     // Instance de la classe en paramètre
979 softime 7996 $object = $this->get_inst__om_dbform(array(
980     "obj" => $table,
981     "idx" => "]",
982     ));
983 mbroquet 3730
984     // Récupère les champs de la table
985     foreach ($object->champs as $champ) {
986     $list_column[] = $champ;
987     }
988    
989     // Tableau des champs en erreur
990     $error_fields = array();
991    
992     // Pour chaque champ à tester
993     foreach ($list_fields as $value) {
994    
995     // S'il n'apparaît pas dans la liste des champs possible
996     if (!in_array($value, $list_column)) {
997    
998     // Alors le champ est ajouté au tableau des erreurs
999     $error_fields[] = $value;
1000     }
1001     }
1002    
1003     // Si le tableau des erreurs n'est pas vide on le retourne
1004     if (count($error_fields) > 0) {
1005     return $error_fields;
1006     }
1007    
1008     // Sinon on retourne le booléen true
1009     return true;
1010    
1011     }
1012    
1013     /*
1014     *
1015     */
1016     /**
1017     * Récupère la lettre type lié à un événement
1018     * @param integer $evenement L'identifiant de l'événement
1019     * @return integer Retourne l'idenfiant de la lettre-type ou true
1020     */
1021     function getLettreType($evenement){
1022    
1023     $lettretype = NULL;
1024    
1025     $sql =
1026     "SELECT
1027     lettretype
1028     FROM
1029     ".DB_PREFIXE."evenement
1030     WHERE
1031     evenement = $evenement";
1032    
1033     $this->addToLog("getLettreType() : db->query(\"".$sql."\")", VERBOSE_MODE);
1034     $res = $this->db->query($sql);
1035     if ( database::isError($res)){
1036     die();
1037     }
1038    
1039     if ( $res->numrows() > 0 ){
1040    
1041     $row=& $res->fetchRow(DB_FETCHMODE_ASSOC);
1042     $lettretype = $row['lettretype'];
1043     }
1044    
1045     return $lettretype;
1046     }
1047    
1048     /**
1049     * Retourne le type de dossier d'autorisation du dossier courant :
1050     * @param $idxDossier Le numéro du dossier d'instruction
1051     * @return le code du type détaillée de dossier d'autorisation
1052     **/
1053     function getDATDCode($idxDossier) {
1054     $sql = "SELECT dossier_autorisation_type_detaille.code
1055     FROM ".DB_PREFIXE."dossier_autorisation_type_detaille
1056     INNER JOIN ".DB_PREFIXE."dossier_autorisation
1057     ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille =
1058     dossier_autorisation.dossier_autorisation_type_detaille
1059     INNER JOIN ".DB_PREFIXE."dossier ON dossier.dossier_autorisation = dossier_autorisation.dossier_autorisation
1060     WHERE dossier.dossier = '".$idxDossier."'";
1061     $res = $this->db->getOne($sql);
1062     $this->addToLog("getDATDCode() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
1063     if ( database::isError($res)){
1064     die();
1065     }
1066     return $res;
1067     }
1068    
1069     /**
1070 fmichon 4708 * Retourne le type de dossier d'autorisation du dossier courant :
1071     * @param $idxDossier Le numéro du dossier d'instruction
1072     * @return le code du type de dossier d'autorisation
1073     **/
1074     function getDATCode($idxDossier) {
1075     $sql = "
1076     SELECT
1077     dossier_autorisation_type.code
1078     FROM
1079     ".DB_PREFIXE."dossier_autorisation_type
1080     INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille
1081     ON dossier_autorisation_type.dossier_autorisation_type=dossier_autorisation_type_detaille.dossier_autorisation_type
1082     INNER JOIN ".DB_PREFIXE."dossier_autorisation
1083     ON dossier_autorisation_type_detaille.dossier_autorisation_type_detaille=dossier_autorisation.dossier_autorisation_type_detaille
1084     INNER JOIN ".DB_PREFIXE."dossier
1085     ON dossier.dossier_autorisation=dossier_autorisation.dossier_autorisation
1086     WHERE
1087     dossier.dossier = '".$idxDossier."'
1088     ";
1089     $res = $this->db->getOne($sql);
1090     $this->addToLog(__METHOD__."(): db->getOne(\"".$sql."\")", VERBOSE_MODE);
1091     if ( database::isError($res)){
1092     die();
1093     }
1094     return $res;
1095     }
1096    
1097     /**
1098 mbroquet 3730 * Permet de copier un enregistrement
1099     * @param mixed $idx Identifiant de l'enregistrment
1100     * @param string $obj Objet de l'enregistrment
1101     * @param string $objsf Objets associés
1102     * @return array Tableau des nouveaux id et du message
1103     */
1104     function copier($idx, $obj, $objsf) {
1105    
1106     // Tableau de résultat
1107     $resArray = array();
1108     // Message retourné à l'utilisateur
1109     $message = "";
1110     // Type du message (valid ou error)
1111     $message_type = "valid";
1112    
1113     // Requête SQL permettant de récupérer les informations sur l'objet métier
1114     $sql = "SELECT *
1115     FROM ".DB_PREFIXE.$obj."
1116     WHERE ".$obj." = ".$idx;
1117     $res = $this->db->query($sql);
1118     $this->isDatabaseError($res);
1119    
1120     // Valeurs clonées
1121     $valF = array();
1122     while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
1123     // Recupère la valeur
1124     $valF = $row;
1125     }
1126    
1127     // Valeurs non clonées
1128     // Identifiant modifié pour que ça soit un ajout
1129     $valF[$obj] = "]";
1130     // Instance de l'objet métier
1131 softime 7996 $clone_obj = $this->get_inst__om_dbform(array(
1132     "obj" => $obj,
1133     "idx" => "]",
1134     ));
1135 mbroquet 3730 // Si dans l'objet métier la fonction "copier" existe
1136     if (method_exists($clone_obj, "update_for_copy")) {
1137     // Traitement sur les valeurs du duplicata
1138     $valF = $clone_obj->update_for_copy($valF, $objsf, DEBUG);
1139     // Recupère les messages retourné par la fonction
1140     $message .= $valF['message'];
1141     // Supprime les messages de la liste des valeurs
1142     unset($valF['message']);
1143     }
1144     // Ajoute le duplicata
1145     $clone_obj->ajouter($valF, $this->db, DEBUG);
1146     // Si aucune erreur se produit dans la classe instanciée
1147     if ($clone_obj->correct === true) {
1148     // Récupère l'identifiant de l'objet créé
1149     $clone_obj_id = $clone_obj->valF[$obj];
1150    
1151     // Message
1152     $message .= sprintf(_("La copie de l'enregistrement %s avec l'identifiant %s s'est effectuee avec succes"), "<span class='bold'>"._($obj)."</span>", "<span class='bold'>".$idx."</span>")."<br />";
1153 softime 7996 $message .= sprintf(
1154     '<a class="om-prev-icon" id="action-link--copy-of-%s-%s" href="%s">%s</a><br/><br/>',
1155     $obj,
1156     $idx,
1157     sprintf(
1158     '%s&obj=%s&action=3&idx=%s',
1159     OM_ROUTE_FORM,
1160     $obj,
1161     $clone_obj_id
1162     ),
1163     ("Cliquer ici pour accéder à la copie")
1164     );
1165 mbroquet 3730 // Ajout de l'identifant au tableau des résultat
1166     $resArray[$obj.'_'.$idx] = $clone_obj_id;
1167    
1168     // S'il y a au moins un objet metier associé
1169     if ($objsf != "") {
1170     // Liste des objet métier associés
1171     $list_objsf = explode(",", $objsf);
1172     // Pour chaque objet associé
1173     foreach ($list_objsf as $key => $objsf) {
1174     // Requête SQL permettant de récupérer les informations sur
1175     // l'objet métier associé
1176     $sql = "SELECT *
1177     FROM ".DB_PREFIXE.$objsf."
1178     WHERE ".$obj." = ".$idx;
1179     $res = $this->db->query($sql);
1180     $this->isDatabaseError($res);
1181    
1182     // Pour chaque élément associé
1183     while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
1184     // Identifiant de l'objet associé à copier
1185     $idxsf = $row[$objsf];
1186    
1187     // Valeurs clonées
1188     $valF = $row;
1189     // Valeurs non clonées
1190     $valF[$obj] = $clone_obj_id;
1191     // Identifiant modifié pour que ça soit un ajout
1192     $valF[$objsf] = "]";
1193     // Instance de l'objet métier associé
1194 softime 7996 $clone_objsf = $this->get_inst__om_dbform(array(
1195     "obj" => $objsf,
1196     "idx" => "]",
1197     ));
1198 mbroquet 3730 // Si dans l'objet métier associé
1199     // la fonction "copier" existe
1200     if (method_exists($clone_objsf, "update_for_copy")) {
1201     // Traitement sur les valeurs du duplicata
1202     $valF = $clone_objsf->update_for_copy($valF, $objsf, DEBUG);
1203     // Recupère les messages retourné par la fonction
1204     $message .= $valF['message'];
1205     // Supprime les messages de la liste des valeurs
1206     unset($valF['message']);
1207     }
1208     // Ajoute le duplicata
1209     $clone_objsf->ajouter($valF, $this->db, DEBUG);
1210     // Si aucune erreur se produit dans la classe instanciée
1211     if ($clone_objsf->correct === true) {
1212     // Récupère l'identifiant de l'objet créé
1213     $clone_objsf_id = $clone_objsf->valF[$objsf];
1214    
1215     // Message
1216 softime 7996 $message .= sprintf(
1217     _("La copie de l'enregistrement %s avec l'identifiant %s s'est effectuee avec succes"),
1218     "<span class='bold'>"._($objsf)."</span>",
1219     "<span class='bold'>".$idxsf."</span>"
1220     )."<br />";
1221 mbroquet 3730
1222     // Ajout de l'identifant au tableau des résultat
1223     $resArray[$objsf.'_'.$row[$objsf]] = $clone_objsf_id;
1224     } else {
1225    
1226     // Message d'erreur récupéré depuis la classe
1227     $message .= $clone_objsf->msg;
1228     // Type du message
1229     $message_type = "error";
1230     }
1231     }
1232     }
1233     }
1234     //
1235     } else {
1236    
1237     // Message d'erreur récupéré depuis la classe
1238     $message .= $clone_obj->msg;
1239     // Type du message
1240     $message_type = "error";
1241     }
1242    
1243     // Ajout du message au tableau des résultats
1244     $resArray['message'] = $message;
1245     // Ajout du type de message au tableau des résultats
1246     $resArray['message_type'] = $message_type;
1247    
1248     // Retourne le tableau des résultats
1249     return $resArray;
1250     }
1251    
1252     /**
1253     * Cette fonction prend en entrée le ou les paramètres du &contrainte qui sont entre
1254     * parenthèses (un ensemble de paramètres séparés par des points-virgules). Elle
1255     * sépare les paramètres et leurs valeurs puis construit et retourne un tableau
1256     * associatif qui contient pour les groupes et sous-groupes :
1257     * - un tableau de valeurs, avec un nom de groupe ou sous-groupe par ligne
1258     * pour les autres options :
1259     * - la valeur de l'option
1260     *
1261     * @param string $contraintes_param Chaîne contenant tous les paramètres
1262     *
1263     * @return array Tableau associatif avec paramètres et valeurs séparés
1264     */
1265     function explodeConditionContrainte($contraintes_param) {
1266    
1267     // Initialisation des variables
1268     $return = array();
1269     $listGroupes = "";
1270     $listSousgroupes = "";
1271     $service_consulte = "";
1272     $affichage_sans_arborescence = "";
1273    
1274     // Sépare toutes les conditions avec leurs valeurs et les met dans un tableau
1275     $contraintes_params = explode(";", $contraintes_param);
1276    
1277     // Pour chaque paramètre de &contraintes
1278     foreach ($contraintes_params as $value) {
1279     // Récupère le mot-clé "liste_groupe" et les valeurs du paramètre
1280     if (strstr($value, "liste_groupe=")) {
1281     // On enlève le mots-clé "liste_groupe=", on garde les valeurs
1282     $listGroupes = str_replace("liste_groupe=", "", $value);
1283     }
1284     // Récupère le mot-clé "liste_ssgroupe" et les valeurs du paramètre
1285     if (strstr($value, "liste_ssgroupe=")) {
1286     // On enlève le mots-clé "liste_ssgroupe=", on garde les valeurs
1287     $listSousgroupes = str_replace("liste_ssgroupe=", "", $value);
1288     }
1289     // Récupère le mot-clé "service_consulte" et la valeur du paramètre
1290     if (strstr($value, "service_consulte=")) {
1291     // On enlève le mots-clé "service_consulte=", on garde sa valeur
1292     $service_consulte = str_replace("service_consulte=", "", $value);
1293     }
1294     // Récupère le mot-clé "affichage_sans_arborescence" et la valeur du
1295     // paramètre
1296     if (strstr($value, "affichage_sans_arborescence=")) {
1297     // On enlève le mots-clé "affichage_sans_arborescence=", on garde la valeur
1298     $affichage_sans_arborescence = str_replace("affichage_sans_arborescence=", "", $value);
1299     }
1300     }
1301    
1302     // Récupère dans des tableaux la liste des groupes et sous-groupes qui
1303     // doivent être utilisés lors du traitement de la condition
1304     if ($listGroupes != "") {
1305     $listGroupes = array_map('trim', explode(",", $listGroupes));
1306     }
1307     if ($listSousgroupes != "") {
1308     $listSousgroupes = array_map('trim', explode(",", $listSousgroupes));
1309     }
1310    
1311     // Tableau à retourner
1312     $return['groupes'] = $listGroupes;
1313     $return['sousgroupes'] = $listSousgroupes;
1314     $return['service_consulte'] = $service_consulte;
1315     $return['affichage_sans_arborescence'] = $affichage_sans_arborescence;
1316     return $return;
1317     }
1318    
1319     /**
1320     * Méthode qui complète la clause WHERE de la requête SQL de récupération des
1321     * contraintes, selon les paramètres fournis. Elle permet d'ajouter une condition sur
1322     * les groupes, sous-groupes et les services consultés.
1323     *
1324     * @param $string $part Contient tous les paramètres fournis à &contraintes séparés
1325     * par des points-virgules, tel que définis dans l'état.
1326     * array[] $conditions Paramètre optionnel, contient les conditions déjà explosées
1327     * par la fonction explodeConditionContrainte()
1328     *
1329     * @return string Contient les clauses WHERE à ajouter à la requête SQL principale.
1330     */
1331     function traitement_condition_contrainte($part, $conditions = NULL) {
1332    
1333     // Initialisation de la condition
1334     $whereContraintes = "";
1335     // Lorsqu'on a déjà les conditions explosées dans le paramètre $conditions, on
1336     // utilise ces données. Sinon, on appelle la méthode qui explose la chaîne de
1337     // caractères contenant l'ensemble des paramètres.
1338     if (is_array($conditions)){
1339     $explodeConditionContrainte = $conditions;
1340     }
1341     else {
1342     $explodeConditionContrainte = $this->explodeConditionContrainte($part);
1343     }
1344     // Récupère les groupes, sous-groupes et service_consulte pour la condition
1345     $groupes = $explodeConditionContrainte['groupes'];
1346     $sousgroupes = $explodeConditionContrainte['sousgroupes'];
1347     $service_consulte = $explodeConditionContrainte['service_consulte'];
1348    
1349     // Pour chaque groupe
1350     if ($groupes != "") {
1351     foreach ($groupes as $key => $groupe) {
1352     // Si le groupe n'est pas vide
1353     if (!empty($groupe)) {
1354     // Choisit l'opérateur logique
1355     $op_logique = $key > 0 ? 'OR' : 'AND (';
1356     // Ajoute la condition
1357     $whereContraintes .= " ".$op_logique." lower(trim(both E'\n\r\t' from contrainte.groupe)) = lower('"
1358     .pg_escape_string($groupe)."')";
1359     }
1360     }
1361     // S'il y a des valeurs dans groupe
1362     if (count($groupe) > 0) {
1363     // Ferme la parenthèse
1364     $whereContraintes .= " ) ";
1365     }
1366     }
1367    
1368     // Pour chaque sous-groupe
1369     if ($sousgroupes != "") {
1370     foreach ($sousgroupes as $key => $sousgroupe) {
1371     // Si le sous-groupe n'est pas vide
1372     if (!empty($sousgroupe)) {
1373     // Choisit l'opérateur logique
1374     $op_logique = $key > 0 ? 'OR' : 'AND (';
1375     // Ajoute la condition
1376     $whereContraintes .= " ".$op_logique." lower(trim(both E'\n\r\t' from contrainte.sousgroupe)) = lower('"
1377     .pg_escape_string($sousgroupe)."')";
1378     }
1379     }
1380     // S'il y a des valeurs dans sous-groupe
1381     if (count($sousgroupes) > 0) {
1382     // Ferme la parenthèse
1383     $whereContraintes .= " ) ";
1384     }
1385     }
1386    
1387     // Si l'option service_consulte n'est pas vide
1388     if ($service_consulte != "") {
1389     // Ajoute la condition
1390     $whereContraintes .= " AND service_consulte = cast(lower('".$service_consulte."') as boolean) ";
1391     }
1392    
1393     // Condition retournée
1394     return $whereContraintes;
1395     }
1396    
1397     /**
1398     * Calcule une date par l'ajout ou la soustraction de mois ou de jours.
1399     *
1400     * @param date $date Date de base (format dd-mm-yyyy)
1401     * @param integer $delay Délais à ajouter
1402     * @param string $operator Opérateur pour le calcul ("-" ou "+")
1403     * @param string $type Type de calcul (mois ou jour)
1404     *
1405     * @return date Date calculée
1406     */
1407     function mois_date($date, $delay, $operator = "+", $type = "mois") {
1408    
1409     // Si un type n'est pas définit
1410     if ($type != "mois" && $type != "jour") {
1411     //
1412     return null;
1413     }
1414    
1415     // Si aucune date n'a été fournie ou si ce n'est pas une date correctement
1416     // formatée
1417     if ( is_null($date) || $date == "" ||
1418     preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $date) == 0 ){
1419     return null;
1420     }
1421    
1422     // Si l'opérateur n'est pas définit
1423     if ($operator != "+" && $operator != "-") {
1424     //
1425     return null;
1426     }
1427    
1428     // Découpage de la date
1429     $temp = explode("-", $date);
1430     $day = (int) $temp[2];
1431     $month = (int) $temp[1];
1432     $year = (int) $temp[0];
1433    
1434     // Si c'est un calcul sur des mois
1435     // Le calcul par mois ne se fait pas comme le calcul par jour car
1436     // les fonctions PHP ne réalisent pas les calculs réglementaires
1437     if ($type == "mois") {
1438    
1439     // Si c'est une addition
1440     if ($operator == '+') {
1441     // Année à ajouter
1442     $year += floor($delay / 12);
1443     // Mois restant
1444     $nb_month = ($delay % 12);
1445     // S'il y a des mois restant
1446     if ($nb_month != 0) {
1447     // Ajout des mois restant
1448     $month += $nb_month;
1449     // Si ça dépasse le mois 12 (décembre)
1450     if ($month > 12) {
1451     // Soustrait 12 au mois
1452     $month -= 12;
1453     // Ajoute 1 à l'année
1454     $year += 1;
1455     }
1456     }
1457     }
1458    
1459     // Si c'est une soustraction
1460     if ($operator == "-") {
1461     // Année à soustraire
1462     $year -= floor($delay / 12);
1463     // Mois restant
1464     $nb_month = ($delay % 12);
1465     // S'il y a des mois restant
1466     if ($nb_month != 0) {
1467     // Soustrait le délais
1468     $month -= $nb_month;
1469     // Si ça dépasse le mois 1 (janvier)
1470     if ($month < 1) {
1471     // Soustrait 12 au mois
1472     $month += 12;
1473     // Ajoute 1 à l'année
1474     $year -= 1;
1475     }
1476     }
1477     }
1478    
1479     // Calcul du nombre de jours dans le mois sélectionné
1480     switch($month) {
1481     // Mois de février
1482     case "2":
1483     if ($year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0) {
1484     $day_max = 29;
1485     } else {
1486     $day_max = 28;
1487     }
1488     break;
1489     // Mois d'avril, juin, septembre et novembre
1490     case "4":
1491     case "6":
1492     case "9":
1493     case "11":
1494     $day_max = 30;
1495     break;
1496     // Mois de janvier, mars, mai, juillet, août, octobre et décembre
1497     default:
1498     $day_max = 31;
1499     }
1500    
1501     // Si le jour est supérieur au jour maximum du mois
1502     if ($day > $day_max) {
1503     // Le jour devient le jour maximum
1504     $day = $day_max;
1505     }
1506    
1507     // Compléte le mois et le jour par un 0 à gauche si c'est un chiffre
1508     $month = str_pad($month, 2, "0", STR_PAD_LEFT);
1509     $day = str_pad($day, 2, "0", STR_PAD_LEFT);
1510    
1511     // Résultat du calcul
1512     $date_result = $year."-".$month."-".$day;
1513     }
1514    
1515     // Si c'est un calcul sur des jours
1516     if ($type == "jour") {
1517     //
1518     $datetime = new DateTime($date);
1519     // Si le délai est un numérique
1520     if (is_numeric($delay)) {
1521     // Modifie la date
1522     $datetime->modify($operator.$delay.' days');
1523     }
1524     // Résultat du calcul
1525     $date_result = $datetime->format('Y-m-d');
1526     }
1527    
1528     // Retourne la date calculée
1529     return $date_result;
1530     }
1531    
1532     /**
1533     * Vérifie la valididité d'une date.
1534     *
1535     * @param string $pDate Date à vérifier
1536     *
1537     * @return boolean
1538     */
1539     function check_date($pDate) {
1540    
1541     // Vérifie si c'est une date valide
1542     if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $pDate, $date)
1543     && checkdate($date[2], $date[3], $date[1])
1544     && $date[1] >= 1900) {
1545     //
1546     return true;
1547     }
1548    
1549     //
1550     return false;
1551     }
1552    
1553     /**
1554     * Permet de tester le bypass
1555     *
1556     * @param string $obj le nom de l'objet
1557     * @param string $permission_suffix
1558     * @return boolean
1559     */
1560     function can_bypass($obj="", $permission_suffix=""){
1561     //On teste le droit bypass
1562     if ($permission_suffix!=""&&$obj!=""&&
1563     $this->isAccredited($obj."_".$permission_suffix."_bypass")){
1564     return true;
1565     }
1566     return false;
1567     }
1568    
1569    
1570     /**
1571     * Vérifie l'option de numérisation.
1572     *
1573     * @return boolean
1574     */
1575     public function is_option_digitalization_folder_enabled() {
1576     //
1577     if ($this->getParameter("option_digitalization_folder") !== true) {
1578     //
1579     return false;
1580     }
1581     //
1582     return true;
1583     }
1584    
1585 softime 8477 /**
1586     * Vérifie l'option de suppression d'un dossier d'instruction.
1587     *
1588     * @return boolean
1589     */
1590     public function is_option_suppression_dossier_instruction_enabled($om_collectivite=null) {
1591     //
1592     $parameters = $this->getCollectivite($om_collectivite);
1593     //
1594     if (isset($parameters['option_suppression_dossier_instruction']) === true
1595     && $parameters['option_suppression_dossier_instruction'] === 'true') {
1596     //
1597     return true;
1598     }
1599 mbroquet 3730
1600 softime 8477 //
1601     return false;
1602     }
1603    
1604    
1605    
1606 mbroquet 3730 /**
1607     * Vérifie que l'option d'accès au portail citoyen est activée.
1608     *
1609 softime 7366 * @param integer $om_collectivite Identifiant de la collectivité.
1610     *
1611 mbroquet 3730 * @return boolean
1612     */
1613 softime 7366 public function is_option_citizen_access_portal_enabled($om_collectivite=null) {
1614 mbroquet 3730 //
1615 softime 7366 $parameters = $this->getCollectivite($om_collectivite);
1616 mbroquet 3730 //
1617 softime 7366 if (isset($parameters['option_portail_acces_citoyen']) === true
1618     && $parameters['option_portail_acces_citoyen'] === 'true') {
1619 mbroquet 3730 //
1620 softime 7366 return true;
1621 mbroquet 3730 }
1622    
1623     //
1624 softime 7366 return false;
1625 mbroquet 3730 }
1626    
1627 softime 7366
1628 nmeucci 4108 /**
1629 softime 4626 * Vérifie que l'option du SIG est activée.
1630     *
1631     * @return boolean
1632     */
1633 softime 7996 public function is_option_sig_enabled($om_collectivite=null) {
1634 softime 4626 //
1635 softime 7996 $parameters = $this->getCollectivite($om_collectivite);
1636 softime 4626 //
1637 softime 7996 if (isset($parameters['option_sig']) === true
1638     && $parameters['option_sig'] === 'sig_externe') {
1639 softime 4626 //
1640 softime 7996 return true;
1641 softime 4626 }
1642 softime 7996 //
1643     return false;
1644     }
1645 softime 4626
1646 softime 7996 /**
1647     * Vérifie que l'option du SIG est activée.
1648     *
1649     * @return boolean
1650     */
1651     public function is_option_ws_synchro_contrainte_enabled($om_collectivite=null) {
1652 softime 4626 //
1653 softime 7996 $parameters = $this->getCollectivite($om_collectivite);
1654     //
1655     if (isset($parameters['option_ws_synchro_contrainte']) === true
1656     && $parameters['option_ws_synchro_contrainte'] === 'true') {
1657     //
1658     return true;
1659     }
1660     //
1661     return false;
1662 softime 4626 }
1663    
1664 softime 6929
1665 softime 4626 /**
1666 softime 6929 * Vérifie que l'option de simulation des taxes est activée.
1667     *
1668     * @param integer $om_collectivite Identifiant de la collectivité.
1669     *
1670     * @return boolean
1671     */
1672     public function is_option_simulation_taxes_enabled($om_collectivite=null) {
1673     //
1674     $parameters = $this->getCollectivite($om_collectivite);
1675     //
1676     if (isset($parameters['option_simulation_taxes']) === true
1677     && $parameters['option_simulation_taxes'] === 'true') {
1678     //
1679     return true;
1680     }
1681    
1682     //
1683     return false;
1684     }
1685    
1686 softime 7521 /**
1687     * Vérifie que l'option de prévisualisation de l'édition est activée.
1688     *
1689     * @param integer $om_collectivite Identifiant de la collectivité.
1690     *
1691     * @return boolean
1692     */
1693     public function is_option_preview_pdf_enabled($om_collectivite=null) {
1694     //
1695     $parameters = $this->getCollectivite($om_collectivite);
1696     //
1697     if (isset($parameters['option_previsualisation_edition']) === true
1698     && $parameters['option_previsualisation_edition'] === 'true') {
1699     //
1700     return true;
1701     }
1702 softime 6929
1703 softime 7521 //
1704     return false;
1705     }
1706    
1707 softime 7685
1708 softime 6929 /**
1709 softime 7685 * Vérifie que l'option de finalisation automatique des instructions tacites
1710     * et retours est activée..
1711     *
1712     * @param integer $om_collectivite Identifiant de la collectivité.
1713     *
1714     * @return boolean
1715     */
1716     public function is_option_finalisation_auto_enabled($om_collectivite = null) {
1717     //
1718     $parameters = $this->getCollectivite($om_collectivite);
1719     //
1720     if (isset($parameters['option_final_auto_instr_tacite_retour']) === true
1721     && $parameters['option_final_auto_instr_tacite_retour'] === 'true') {
1722     //
1723     return true;
1724     }
1725    
1726     //
1727     return false;
1728     }
1729    
1730 softime 8329 /**
1731     * Vérifie que l'option de trouillotage numérique automatique des
1732     * pièces est activée.
1733     *
1734     * @param integer $om_collectivite Identifiant de la collectivité.
1735     *
1736     * @return boolean
1737     */
1738     public function is_option_trouillotage_numerique_enabled($om_collectivite = null) {
1739     //
1740     $parameters = $this->getCollectivite($om_collectivite);
1741     //
1742     if (isset($parameters['option_trouillotage_numerique']) === true
1743     && $parameters['option_trouillotage_numerique'] === 'true') {
1744     //
1745     return true;
1746     }
1747     //
1748     return false;
1749     }
1750 softime 7685
1751     /**
1752 nmeucci 4108 * Vérifie le niveau de la collectivité de l'utilisateur connecté
1753     *
1754     * @return boolean
1755     */
1756     function has_collectivite_multi() {
1757     $idx_multi = $this->get_idx_collectivite_multi();
1758     if (intval($_SESSION['collectivite']) === intval($idx_multi)) {
1759     return true;
1760     }
1761     return false;
1762     }
1763 mbroquet 3730
1764 nmeucci 4108
1765 softime 3976 /**
1766     * Pour un path absolu donné, retourne le relatif à la racine de
1767     * l'application.
1768     *
1769     * @param string $absolute Chemin absolu.
1770     *
1771     * @return mixed Faux si échec sinon chemin relatif.
1772     */
1773     public function get_relative_path($absolute) {
1774     if ($this->get_path_app() === false) {
1775     return false;
1776     }
1777     $path_app = $this->get_path_app();
1778     return str_replace($path_app, '', $absolute);
1779     }
1780    
1781    
1782     /**
1783     * Retourne le path absolu de la racine de l'application
1784     *
1785     * @return mixed Faux si échec sinon chemin absolu
1786     */
1787     public function get_path_app() {
1788     $match = array();
1789     preg_match( '/(.*)\/[a-zA-Z0-9]+\/\.\.\/core\/$/', PATH_OPENMAIRIE, $match);
1790     // On vérifie qu'il n'y a pas d'erreur
1791     if (isset($match[1]) === false) {
1792     return false;
1793     }
1794     return $match[1];
1795     }
1796    
1797 nmeucci 3981 /**
1798     * Compose un tableau et retourne son code HTML
1799     *
1800     * @param string $id ID CSS du conteneur
1801     * @param array $headers entêtes de colonnes
1802     * @param array $rows lignes
1803     * @return string code HTML
1804     */
1805 nmeucci 3980 public function compose_generate_table($id, $headers, $rows) {
1806 nmeucci 3981 //
1807     $html = '';
1808 nmeucci 3980 // Début conteneur
1809 nmeucci 3981 $html .= '<div id="'.$id.'">';
1810 nmeucci 3980 // Début tableau
1811 nmeucci 3981 $html .= '<table class="tab-tab">';
1812 nmeucci 3980 // Début entête
1813 nmeucci 3981 $html .= '<thead>';
1814     $html .= '<tr class="ui-tabs-nav ui-accordion ui-state-default tab-title">';
1815 nmeucci 3980 // Colonnes
1816     $nb_colonnes = count($headers);
1817     $index_last_col = $nb_colonnes - 1;
1818     foreach ($headers as $i => $header) {
1819     if ($i === 0) {
1820     $col = ' firstcol';
1821     }
1822     if ($i === $index_last_col) {
1823     $col = ' lastcol';
1824     }
1825 nmeucci 3981 $html .= '<th class="title col-'.$i.$col.'">';
1826     $html .= '<span class="name">';
1827     $html .= $header;
1828     $html .= '</span>';
1829     $html .= '</th>';
1830 nmeucci 3980 }
1831     // Fin entête
1832 nmeucci 3981 $html .= '</tr>';
1833     $html .= '</thead>';
1834 nmeucci 3980 // Début corps
1835 nmeucci 3981 $html .= '<tbody>';
1836 nmeucci 3980 // Lignes
1837     foreach ($rows as $cells) {
1838     // Début ligne
1839 nmeucci 3981 $html .= '<tr class="tab-data">';
1840 nmeucci 3980 // Cellules
1841     foreach ($cells as $j => $cell) {
1842     if ($j === 0) {
1843     $col = ' firstcol';
1844     }
1845     if ($j === $index_last_col) {
1846     $col = ' lastcol';
1847     }
1848 nmeucci 3981 $html .= '<td class="title col-'.$j.$col.'">';
1849     $html .= '<span class="name">';
1850     $html .= $cell;
1851     $html .= '</span>';
1852     $html .= '</td>';
1853 nmeucci 3980 }
1854     // Fin ligne
1855 nmeucci 3981 $html .= "</tr>";
1856 nmeucci 3980 }
1857     // Fin corps
1858 nmeucci 3981 $html .= '</tbody>';
1859 nmeucci 3980 // Fin tableau
1860 nmeucci 3981 $html .= '</table>';
1861 nmeucci 3980 // Fin conteneur
1862 nmeucci 3981 $html .= '</div>';
1863     //
1864     return $html;
1865 nmeucci 3980 }
1866 nmeucci 4156
1867     /**
1868     * Retourne le login de l'utilisateur connecté + entre parenthèses son nom
1869     * s'il en a un.
1870     *
1871     * @return string myLogin OU myLogin (myName)
1872     */
1873     public function get_connected_user_login_name() {
1874     // Requête et stockage des informations de l'user connecté
1875     $this->getUserInfos();
1876     // Si le nom existe et est défini on le récupère
1877     $nom = "";
1878     if (isset($this->om_utilisateur["nom"])
1879     && !empty($this->om_utilisateur["nom"])) {
1880     $nom = trim($this->om_utilisateur["nom"]);
1881     }
1882     // Définition de l'émetteur : obligatoirement son login
1883     $emetteur = $_SESSION['login'];
1884     // Définition de l'émetteur : + éventuellement son nom
1885     if ($nom != "") {
1886     $emetteur .= " (".$nom.")";
1887     }
1888     // Retour
1889     return $emetteur;
1890     }
1891 nhaye 4218
1892     /**
1893 fmichon 4708 * Cette méthode permet d'interfacer le module 'Settings'.
1894     */
1895     function view_module_settings() {
1896     //
1897     require_once "../obj/settings.class.php";
1898     $settings = new settings();
1899     $settings->view_main();
1900     }
1901    
1902 softime 7366
1903 fmichon 4708 /**
1904 softime 7366 * Vérifie que l'option référentiel ERP est activée.
1905 fmichon 4708 *
1906 softime 7366 * @param integer $om_collectivite Identifiant de la collectivité.
1907 fmichon 4708 *
1908     * @return boolean
1909     */
1910 softime 7366 public function is_option_referentiel_erp_enabled($om_collectivite=null) {
1911 fmichon 4708 //
1912 softime 7366 $parameters = $this->getCollectivite($om_collectivite);
1913     //
1914     if (isset($parameters['option_referentiel_erp']) === true
1915     && $parameters['option_referentiel_erp'] === 'true') {
1916     //
1917     return true;
1918 fmichon 4708 }
1919 softime 7366
1920 fmichon 4708 //
1921 softime 7366 return false;
1922 fmichon 4708 }
1923    
1924 softime 7366
1925 fmichon 4708 /**
1926     * Interface avec le référentiel ERP.
1927     */
1928     function send_message_to_referentiel_erp($code, $infos) {
1929     //
1930     require_once "../obj/interface_referentiel_erp.class.php";
1931     $interface_referentiel_erp = new interface_referentiel_erp();
1932     $ret = $interface_referentiel_erp->send_message_to_referentiel_erp($code, $infos);
1933     return $ret;
1934     }
1935    
1936     /**
1937 nhaye 4218 * Récupère la liste des identifiants des collectivités
1938     *
1939     * @param string $return_type 'string' ou 'array' selon que l'on retourne
1940     * respectivement une chaîne ou un tableau
1941     * @param string $separator caractère(s) séparateur(s) employé(s) lorsque
1942     * l'on retourne une chaîne, inutilisé si tableau
1943     * @return mixed possibilité de boolean/string/array :
1944     * false si erreur BDD sinon résultat
1945     */
1946     public function get_list_id_collectivites($return_type = 'string', $separator = ',') {
1947     $sql = "
1948     SELECT
1949     array_to_string(
1950     array_agg(om_collectivite),
1951     '".$separator."'
1952     ) as list_id_collectivites
1953     FROM ".DB_PREFIXE."om_collectivite";
1954     $list = $this->db->getone($sql);
1955     $this->addTolog(
1956     __FILE__." - ".__METHOD__." : db->getone(\"".$sql."\");",
1957     VERBOSE_MODE
1958     );
1959     if ($this->isDatabaseError($list, true)) {
1960     return false;
1961     }
1962     if ($return_type === 'array') {
1963     return explode($separator, $list);
1964     }
1965     return $list;
1966     }
1967 nhaye 5254
1968 softime 6565 /**
1969     * Teste si l'utilisateur connecté appartient au groupe indiqué en paramètre
1970     * ou s'il a le goupe bypass.
1971     *
1972     * @param string $groupe Code du groupe : ADS / CTX / CU / RU / ERP.
1973     * @return boolean vrai si utilisateur appartient au groupe fourni
1974     */
1975     public function is_user_in_group($groupe) {
1976     if (isset($_SESSION['groupe']) === true
1977     && (array_key_exists($groupe, $_SESSION['groupe']) === true
1978     || array_key_exists("bypass", $_SESSION['groupe']) === true)) {
1979     return true;
1980     }
1981     return false;
1982     }
1983    
1984     /**
1985     * CONDITION - can_user_access_dossiers_confidentiels_from_groupe
1986     *
1987     * Permet de savoir si le type de dossier d'autorisation du dossier courant est
1988     * considéré comme confidentiel ou si l'utilisateur a le groupe bypass.
1989     *
1990     * @param string $groupe Code du groupe : ADS / CTX / CU / RU / ERP.
1991     * @return boolean true si l'utilisateur à accès aux dossiers confidentiels du groupe
1992     * passé en paramètre, sinon false.
1993     *
1994     */
1995     public function can_user_access_dossiers_confidentiels_from_groupe($groupe) {
1996     if ((isset($_SESSION['groupe'][$groupe]['confidentiel']) === true
1997     AND $_SESSION['groupe'][$groupe]['confidentiel'] === true)
1998     || array_key_exists("bypass", $_SESSION['groupe']) === true) {
1999     return true;
2000     }
2001     return false;
2002     }
2003    
2004     public function starts_with($haystack, $needle) {
2005     $length = strlen($needle);
2006     return (substr($haystack, 0, $length) === $needle);
2007     }
2008    
2009     public function ends_with($haystack, $needle) {
2010     $length = strlen($needle);
2011     if ($length == 0) {
2012     return true;
2013     }
2014     return (substr($haystack, -$length) === $needle);
2015     }
2016    
2017     /**
2018     * Récupère le type définit dans la base de données des champs d'une table
2019     * entière ou d'un champs si celui-ci est précisé.
2020     *
2021     * Liste des types BDD :
2022     * - int4
2023     * - varchar
2024     * - bool
2025     * - numeric
2026     * - text
2027     *
2028     * @param string $table Nom de la table.
2029     * @param string $column Nom de la colonne (facultatif).
2030     *
2031     * @return array
2032     */
2033     public function get_type_from_db($table, $column = null) {
2034     // Composition de la requête
2035     $sql_select = ' SELECT column_name, udt_name ';
2036     $sql_from = ' FROM information_schema.columns ';
2037     $sql_where = ' WHERE table_schema = \''.str_replace('.', '', DB_PREFIXE).'\' AND table_name = \''.$table.'\' ';
2038     $sql_order = ' ORDER BY ordinal_position ';
2039    
2040     // Si une colonne est précisé
2041     if ($column !== null || $column !== '') {
2042     //
2043     $sql_where .= ' AND column_name = \''.$column.'\' ';
2044     }
2045    
2046     // Requête SQL
2047     $sql = $sql_select.$sql_from.$sql_where.$sql_order;
2048     // Exécution de la requête
2049     $res = $this->db->query($sql);
2050     // Log
2051     $this->addToLog(__METHOD__."() : db->query(\"".$sql."\");", VERBOSE_MODE);
2052     // Erreur BDD
2053     $this->isDatabaseError($res);
2054     //
2055     $list_type = array();
2056     while ($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
2057     $list_type[$row['column_name']] = $row['udt_name'];
2058     }
2059    
2060     // Retourne la liste des codes
2061     return $list_type;
2062     }
2063    
2064 softime 7366
2065     /**
2066     * Cette méthode permet de récupérer le code de division correspondant
2067     * au dossier sur lequel on se trouve.
2068     *
2069     * Méthode identique à la méthode getDivisionFromDossier() de la classe
2070     * om_dbform à l'exception d'un cas de récupération du numéro de dossier par
2071     * la méthode getVal(). Cette exception permet d'utiliser cette méthode dans
2072     * les scripts instanciant seulement la classe utils tel que les *.inc.php.
2073     *
2074     * @param string $dossier Identifiant du dossier d'instruction.
2075     *
2076     * @return string Code de la division du dossier en cours
2077     */
2078     public function get_division_from_dossier_without_inst($dossier = null) {
2079    
2080     // Cette méthode peut être appelée plusieurs fois lors d'une requête.
2081     // Pour éviter de refaire le traitement de recherche de la division
2082     // alors on vérifie si nous ne l'avons pas déjà calculé.
2083     if (isset($this->_division_from_dossier) === true
2084     && $this->_division_from_dossier !== null) {
2085     // Log
2086     $this->addToLog(__METHOD__."() : retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
2087     // On retourne la valeur déjà calculée
2088     return $this->_division_from_dossier;
2089     }
2090    
2091     // Récupère le paramétre retourformulaire présent dans l'URL
2092     $retourformulaire = $this->getParameter("retourformulaire");
2093     // Récupère le paramétre idxformulaire présent dans l'URL
2094     $idxformulaire = $this->getParameter("idxformulaire");
2095    
2096     // Si le dossier n'est pas passé en paramètre de la méthode
2097     if ($dossier === null) {
2098    
2099     // La méthode de récupération du dossier diffère selon le contexte
2100     // du formulaire
2101     if ($retourformulaire === "dossier"
2102     || $retourformulaire === "dossier_instruction"
2103     || $retourformulaire === "dossier_instruction_mes_encours"
2104     || $retourformulaire === "dossier_instruction_tous_encours"
2105     || $retourformulaire === "dossier_instruction_mes_clotures"
2106     || $retourformulaire === "dossier_instruction_tous_clotures"
2107     || $retourformulaire === "dossier_contentieux_mes_infractions"
2108     || $retourformulaire === "dossier_contentieux_toutes_infractions"
2109     || $retourformulaire === "dossier_contentieux_mes_recours"
2110     || $retourformulaire === "dossier_contentieux_tous_recours") {
2111    
2112     // Récupère le numéro du dossier depuis le paramètre
2113     // idxformulaire présent dans l'URL
2114     $dossier = $idxformulaire;
2115     }
2116     //
2117     if ($retourformulaire === "lot") {
2118    
2119     // Requête SQL
2120     $sql = sprintf("SELECT dossier FROM ".DB_PREFIXE."lot WHERE lot = %s", $idxformulaire);
2121     // Récupère l'identifiant du dossier
2122     $dossier = $this->db->getone($sql);
2123     // Log
2124     $this->addToLog(__METHOD__."() : db->query(\"".$dossier."\");", VERBOSE_MODE);
2125     // Erreur BDD
2126     $this->isDatabaseError($dossier);
2127     }
2128     }
2129    
2130     // À cette étape si le dossier n'est toujours pas récupéré alors la
2131     // division ne pourra pas être récupérée
2132     if ($dossier === null) {
2133     //
2134     return null;
2135     }
2136    
2137     // Requête SQL
2138     $sql = sprintf("SELECT division FROM ".DB_PREFIXE."dossier WHERE dossier = '%s'", $dossier);
2139     // Récupère l'identifiant de la division du dossier
2140     $this->_division_from_dossier = $this->db->getOne($sql);
2141     // Log
2142     $this->addToLog(__METHOD__."(): db->getone(\"".$sql."\")", VERBOSE_MODE);
2143     // Erreur BDD
2144     $this->isDatabaseError($this->_division_from_dossier);
2145    
2146     //
2147     return $this->_division_from_dossier;
2148    
2149     }
2150    
2151 softime 8329 /**
2152     * Permet de définir la configuration des liens du footer.
2153     *
2154     * @return void
2155     */
2156     protected function set_config__footer() {
2157     $footer = array();
2158     // Documentation du site
2159     $footer[] = array(
2160     "title" => __("Documentation"),
2161     "description" => __("Acceder a l'espace documentation de l'application"),
2162     "href" => "http://docs.openmairie.org/?project=openads&version=4.8&format=html&path=manuel_utilisateur",
2163     "target" => "_blank",
2164     "class" => "footer-documentation",
2165     );
2166 softime 7366
2167 softime 8329 // Forum openMairie
2168     $footer[] = array(
2169     "title" => __("Forum"),
2170     "description" => __("Espace d'échange ouvert du projet openMairie"),
2171     "href" => "https://communaute.openmairie.org/c/openads",
2172     "target" => "_blank",
2173     "class" => "footer-forum",
2174     );
2175    
2176     // Portail openMairie
2177     $footer[] = array(
2178     "title" => __("openMairie.org"),
2179     "description" => __("Site officiel du projet openMairie"),
2180     "href" => "http://www.openmairie.org/catalogue/openads",
2181     "target" => "_blank",
2182     "class" => "footer-openmairie",
2183     );
2184     //
2185     $this->config__footer = $footer;
2186     }
2187    
2188     /**
2189     * Surcharge - set_config__menu().
2190     *
2191     * @return void
2192     */
2193     protected function set_config__menu() {
2194     //
2195     $menu = array();
2196    
2197     // {{{ Rubrique AUTORISATION
2198     //
2199     $rubrik = array(
2200     "title" => _("Autorisation"),
2201     "class" => "autorisation",
2202     "right" => "menu_autorisation",
2203     );
2204     //
2205     $links = array();
2206    
2207     $links[] = array(
2208     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation",
2209     "class" => "dossier_autorisation",
2210     "title" => _("Dossiers d'autorisation"),
2211     "right" => array("dossier_autorisation", "dossier_autorisation_tab", ),
2212     "open" => array("index.php|dossier_autorisation[module=tab]", "index.php|dossier_autorisation[module=form]", ),
2213     );
2214    
2215     // Lien vers les dossiers d'autorisations qui ont une demande d'avis
2216     $links[] = array(
2217     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_avis",
2218     "class" => "dossier_autorisation",
2219     "title" => _("Dossiers d'autorisation"),
2220     "right" => array(
2221     "dossier_autorisation_avis",
2222     "dossier_autorisation_avis_tab",
2223     ),
2224     "open" => array("index.php|dossier_autorisation_avis[module=tab]", "index.php|dossier_autorisation[module=form]", ),
2225     );
2226    
2227     //
2228     $rubrik['links'] = $links;
2229     //
2230     $menu[] = $rubrik;
2231     // }}}
2232    
2233     // {{{ Rubrique GUICHET UNIQUE
2234     //
2235     $rubrik = array(
2236     "title" => _("Guichet Unique"),
2237     "class" => "guichet_unique",
2238     "right" => "menu_guichet_unique",
2239     );
2240     //
2241     $links = array();
2242     //
2243     $links[] = array(
2244     "href" => OM_ROUTE_DASHBOARD,
2245     "class" => "tableau-de-bord",
2246     "title" => _("tableau de bord"),
2247     "right" => "menu_guichet_unique_dashboard",
2248     "open" => array("index.php|[module=dashboard]",),
2249     );
2250     //
2251     $links[] = array(
2252     "class" => "category",
2253     "title" => _("nouvelle demande"),
2254     "right" => array(
2255     "demande",
2256     "demande_nouveau_dossier_ajouter",
2257     "demande_dossier_encours_ajouter", "demande_dossier_encours_tab",
2258     "demande_autre_dossier_ajouter", "demande_autre_dossier_tab",
2259     "demande_consulter","demande_tab",
2260     ),
2261     );
2262     $links[] = array(
2263     "title" => "<hr/>",
2264     "right" => array(
2265     "demande",
2266     "demande_dossier_encours_ajouter",
2267     "demande_dossier_encours_ajouter", "demande_dossier_encours_tab",
2268     ),
2269     );
2270     $links[] = array(
2271     "href" => "".OM_ROUTE_FORM."&obj=demande_nouveau_dossier&amp;action=0&amp;advs_id=&amp;tricol=&amp;valide=&amp;retour=tab&amp;new=",
2272     "class" => "nouveau-dossier",
2273     "title" => _("nouveau dossier"),
2274     "right" => array(
2275     "demande",
2276     "demande_nouveau_dossier_ajouter",
2277     ),
2278     "open" => array("index.php|demande_nouveau_dossier[module=form]",),
2279     );
2280     $links[] = array(
2281     "href" => "".OM_ROUTE_TAB."&obj=demande_dossier_encours",
2282     "class" => "dossier-existant",
2283     "title" => _("dossier en cours"),
2284     "right" => array(
2285     "demande",
2286     "demande_dossier_encours_ajouter",
2287     "demande_dossier_encours_tab",
2288     ),
2289     "open" => array("index.php|demande_dossier_encours[module=tab]", "index.php|demande_dossier_encours[module=form]"),
2290     );
2291     $links[] = array(
2292     "href" => "".OM_ROUTE_TAB."&obj=demande_autre_dossier",
2293     "class" => "autre-dossier",
2294     "title" => _("autre dossier"),
2295     "right" => array(
2296     "demande",
2297     "demande_autre_dossier_ajouter",
2298     "demande_autre_dossier_tab",
2299     ),
2300     "open" => array("index.php|demande_autre_dossier[module=tab]", "index.php|demande_autre_dossier[module=form]"),
2301     );
2302     $links[] = array(
2303     "title" => "<hr/>",
2304     "right" => array(
2305     "demande",
2306     "demande_consulter",
2307     "demande_tab"
2308     ),
2309     );
2310     $links[] = array(
2311     "href" => "".OM_ROUTE_TAB."&obj=demande",
2312     "class" => "pdf",
2313     "title" => _("recepisse"),
2314     "right" => array(
2315     "demande",
2316     "demande_consulter",
2317     "demande_tab"
2318     ),
2319     "open" => array("index.php|demande[module=tab]","index.php|demande[module=form]"),
2320     );
2321     $links[] = array(
2322     "title" => "<hr/>",
2323     "right" => array(
2324     "petitionnaire_frequent",
2325     "petitionnaire_frequent_consulter",
2326     "petitionnaire_frequent_tab"
2327     ),
2328     );
2329     $links[] = array(
2330     "href" => "".OM_ROUTE_TAB."&obj=petitionnaire_frequent",
2331     "class" => "petitionnaire_frequent",
2332     "title" => _("petitionnaire_frequent"),
2333     "right" => array(
2334     "petitionnaire_frequent",
2335     "petitionnaire_frequent_consulter",
2336     "petitionnaire_frequent_tab"
2337     ),
2338     "open" => array("index.php|petitionnaire_frequent[module=tab]","index.php|petitionnaire_frequent[module=form]"),
2339     );
2340     //
2341     $links[] = array(
2342     "class" => "category",
2343     "title" => _("affichage reglementaire"),
2344     "right" => array(
2345     "affichage_reglementaire_registre",
2346     "affichage_reglementaire_attestation",
2347     ),
2348     );
2349     $links[] = array(
2350     "title" => "<hr/>",
2351     "right" => array(
2352     "affichage_reglementaire_registre",
2353     "affichage_reglementaire_attestation",
2354     ),
2355     );
2356     $links[] = array(
2357     "href" => "".OM_ROUTE_FORM."&obj=demande_affichage_reglementaire_registre&action=110&idx=0",
2358     "class" => "affichage_reglementaire_registre",
2359     "title" => _("registre"),
2360     "right" => array(
2361     "affichage_reglementaire_registre",
2362     ),
2363     "open" => array("index.php|demande_affichage_reglementaire_registre[module=tab]", "index.php|demande_affichage_reglementaire_registre[module=form]"),
2364     );
2365     $links[] = array(
2366     "href" => "".OM_ROUTE_FORM."&obj=demande_affichage_reglementaire_attestation&action=120&idx=0",
2367     "class" => "affichage_reglementaire_attestation",
2368     "title" => _("attestation"),
2369     "right" => array(
2370     "affichage_reglementaire_attestation",
2371     ),
2372     "open" => array("index.php|demande_affichage_reglementaire_attestation[module=tab]", "index.php|demande_affichage_reglementaire_attestation[module=form]"),
2373     );
2374     //
2375     $rubrik['links'] = $links;
2376     //
2377     $menu[] = $rubrik;
2378     // }}}
2379    
2380     // {{{ Rubrique QUALIFICATION
2381     //
2382     $rubrik = array(
2383     "title" => _("Qualification"),
2384     "class" => "qualification",
2385     "right" => "qualification_menu",
2386     );
2387     //
2388     $links = array();
2389     //
2390     $links[] = array(
2391     "href" => OM_ROUTE_DASHBOARD,
2392     "class" => "tableau-de-bord",
2393     "title" => _("tableau de bord"),
2394     "right" => "menu_qualification_dashboard",
2395     "open" => array("index.php|[module=dashboard]",),
2396     );
2397    
2398     //
2399     $links[] = array(
2400     "href" => "".OM_ROUTE_TAB."&obj=dossier_qualifier_qualificateur",
2401     "class" => "dossier_qualifier_qualificateur",
2402     "title" => _("dossiers a qualifier"),
2403     "right" => array(
2404     "dossier_qualifier_qualificateur",
2405     "dossier_qualifier_qualificateur_tab",
2406     ),
2407     "open" => array("index.php|dossier_qualifier_qualificateur[module=tab]", "index.php|dossier_instruction[module=form]", ),
2408     );
2409    
2410     //
2411     $rubrik['links'] = $links;
2412     //
2413     $menu[] = $rubrik;
2414     // }}}
2415    
2416     // {{{ Rubrique INSTRUCTION
2417     //
2418     $rubrik = array(
2419     "title" => _("instruction"),
2420     "class" => "instruction",
2421     "right" => "menu_instruction",
2422     );
2423     //
2424     $links = array();
2425     //
2426     $links[] = array(
2427     "href" => OM_ROUTE_DASHBOARD,
2428     "class" => "tableau-de-bord",
2429     "title" => _("tableau de bord"),
2430     "right" => "menu_instruction_dashboard",
2431     "open" => array("index.php|[module=dashboard]",),
2432     );
2433     // Catégorie DOSSIERS D'INSTRUCTION
2434     $links[] = array(
2435     "class" => "category",
2436     "title" => _("dossiers d'instruction"),
2437     "right" => array(
2438     "dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab",
2439     "dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab",
2440     "dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab",
2441     "dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab",
2442     "dossier_instruction", "dossier_instruction_tab",
2443     "PC_modificatif", "PC_modificatif_tab",
2444     ),
2445     );
2446     $links[] = array(
2447     "title" => "<hr/>",
2448     "right" => array(
2449     "dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab",
2450     "dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab",
2451     ),
2452     );
2453     //
2454     $links[] = array(
2455     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_mes_encours",
2456     "class" => "dossier_instruction_mes_encours",
2457     "title" => _("mes encours"),
2458     "right" => array("dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab", ),
2459     "open" => array("index.php|dossier_instruction_mes_encours[module=tab]", "index.php|dossier_instruction_mes_encours[module=form]", ),
2460     );
2461     //
2462     $links[] = array(
2463     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_tous_encours",
2464     "class" => "dossier_instruction_tous_encours",
2465     "title" => _("tous les encours"),
2466     "right" => array("dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab", ),
2467     "open" => array("index.php|dossier_instruction_tous_encours[module=tab]", "index.php|dossier_instruction_tous_encours[module=form]", ),
2468     );
2469     //
2470     $links[] = array(
2471     "title" => "<hr/>",
2472     "right" => array(
2473     "dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab",
2474     "dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab",
2475     ),
2476     );
2477     //
2478     $links[] = array(
2479     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_mes_clotures",
2480     "class" => "dossier_instruction_mes_clotures",
2481     "title" => _("mes clotures"),
2482     "right" => array("dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab", ),
2483     "open" => array("index.php|dossier_instruction_mes_clotures[module=tab]", "index.php|dossier_instruction_mes_clotures[module=form]", ),
2484     );
2485     //
2486     $links[] = array(
2487     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_tous_clotures",
2488     "class" => "dossier_instruction_tous_clotures",
2489     "title" => _("tous les clotures"),
2490     "right" => array("dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab", ),
2491     "open" => array("index.php|dossier_instruction_tous_clotures[module=tab]", "index.php|dossier_instruction_tous_clotures[module=form]", ),
2492     );
2493     //
2494     $links[] = array(
2495     "title" => "<hr/>",
2496     "right" => array(
2497     "dossier_instruction", "dossier_instruction_tab",
2498     ),
2499     );
2500     //
2501     $links[] = array(
2502     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction",
2503     "class" => "dossier_instruction_recherche",
2504     "title" => _("recherche"),
2505     "right" => array("dossier_instruction", "dossier_instruction_tab", ),
2506     "open" => array("index.php|dossier_instruction[module=tab]", "index.php|dossier_instruction[module=form]", ),
2507     );
2508    
2509     // Catégorier Qualification
2510     $links[] = array(
2511     "class" => "category",
2512     "title" => _("qualification"),
2513     "right" => array("dossier_qualifier", "architecte_frequent",),
2514     );
2515     //
2516     $links[] = array(
2517     "title" => "<hr/>",
2518     "right" => array("dossier_qualifier", "architecte_frequent", ),
2519     );
2520     //
2521     $links[] = array(
2522     "href" => "".OM_ROUTE_TAB."&obj=dossier_qualifier",
2523     "class" => "dossier_qualifier",
2524     "title" => _("dossiers a qualifier"),
2525     "right" => array("dossier_qualifier", "dossier_qualifier_tab", ),
2526     "open" => array("index.php|dossier_qualifier[module=tab]", "index.php|dossier_qualifier[module=form]", ),
2527     );
2528     //
2529     $links[] = array(
2530     "href" => "".OM_ROUTE_TAB."&obj=architecte_frequent",
2531     "class" => "architecte_frequent",
2532     "title" => _("architecte_frequent"),
2533     "right" => array("architecte_frequent", "architecte_frequent_tab", ),
2534     "open" => array("index.php|architecte_frequent[module=tab]", "index.php|architecte_frequent[module=form]", ),
2535     );
2536     // Catégorie CONSULTATIONS
2537     $links[] = array(
2538     "class" => "category",
2539     "title" => _("consultations"),
2540     "right" => array(
2541     "consultation",
2542     "consultation_mes_retours",
2543     "consultation_retours_ma_division",
2544     "consultation_tous_retours",
2545     ),
2546     );
2547     $links[] = array(
2548     "title" => "<hr/>",
2549     "right" => array(
2550     "consultation",
2551     "consultation_mes_retours",
2552     "consultation_retours_ma_division",
2553     "consultation_tous_retours",
2554     ),
2555     );
2556     $links[] = array(
2557     "href" => "".OM_ROUTE_TAB."&obj=consultation_mes_retours",
2558     "class" => "consultation_mes_retours",
2559     "title" => _("Mes retours"),
2560     "right" => array(
2561     "consultation",
2562     "consultation_mes_retours",
2563     "consultation_mes_retours_tab",
2564     ),
2565     "open" => array("index.php|consultation_mes_retours[module=tab]", "index.php|consultation_mes_retours[module=form]", ),
2566     );
2567     $links[] = array(
2568     "href" => "".OM_ROUTE_TAB."&obj=consultation_retours_ma_division",
2569     "class" => "consultation_retours_ma_division",
2570     "title" => _("Retours de ma division"),
2571     "right" => array(
2572     "consultation",
2573     "consultation_retours_ma_division",
2574     "consultation_retours_ma_division_tab",
2575     ),
2576     "open" => array("index.php|consultation_retours_ma_division[module=tab]", "index.php|consultation_retours_ma_division[module=form]", ),
2577     );
2578     $links[] = array(
2579     "href" => "".OM_ROUTE_TAB."&obj=consultation_tous_retours",
2580     "class" => "consultation_tous_retours",
2581     "title" => _("Tous les retours"),
2582     "right" => array(
2583     "consultation_tous_retours",
2584     "consultation_tous_retours_tab",
2585     ),
2586     "open" => array("index.php|consultation_tous_retours[module=tab]", "index.php|consultation_tous_retours[module=form]", ),
2587     );
2588     // Catégorie MESSAGES
2589     $links[] = array(
2590     "class" => "category",
2591     "title" => _("Messages"),
2592     "right" => array(
2593     "messages",
2594     "messages_mes_retours",
2595     "messages_retours_ma_division",
2596     "messages_tous_retours",
2597     ),
2598     );
2599     //
2600     $links[] = array(
2601     "title" => "<hr/>",
2602     "right" => array(
2603     "messages",
2604     "messages_mes_retours",
2605     "messages_retours_ma_division",
2606     "messages_tous_retours",
2607     ),
2608     );
2609     //
2610     $links[] = array(
2611     "href" => "".OM_ROUTE_TAB."&obj=messages_mes_retours",
2612     "class" => "messages_mes_retours",
2613     "title" => _("Mes messages"),
2614     "right" => array(
2615     "messages",
2616     "messages_mes_retours",
2617     "messages_mes_retours_tab",
2618     ),
2619     "open" => array("index.php|messages_mes_retours[module=tab]", "index.php|messages_mes_retours[module=form]", ),
2620     );
2621     //
2622     $links[] = array(
2623     "href" => "".OM_ROUTE_TAB."&obj=messages_retours_ma_division",
2624     "class" => "messages_retours_ma_division",
2625     "title" => _("Messages de ma division"),
2626     "right" => array(
2627     "messages",
2628     "messages_retours_ma_division",
2629     "messages_retours_ma_division_tab",
2630     ),
2631     "open" => array("index.php|messages_retours_ma_division[module=tab]", "index.php|messages_retours_ma_division[module=form]", ),
2632     );
2633     //
2634     $links[] = array(
2635     "href" => "".OM_ROUTE_TAB."&obj=messages_tous_retours",
2636     "class" => "messages_tous_retours",
2637     "title" => _("Tous les messages"),
2638     "right" => array(
2639     "messages",
2640     "messages_tous_retours",
2641     "messages_tous_retours_tab",
2642     ),
2643     "open" => array("index.php|messages_tous_retours[module=tab]", "index.php|messages_tous_retours[module=form]", ),
2644     );
2645     // Catégorie COMMISSIONS
2646     $links[] = array(
2647     "class" => "category",
2648     "title" => _("commissions"),
2649     "right" => array(
2650     "commission_mes_retours",
2651     "commission_mes_retours_tab",
2652     "commission_retours_ma_division",
2653     "commission_retours_ma_division_tab",
2654     "commission_tous_retours",
2655     "commission_tous_retours_tab",
2656     ),
2657     );
2658     $links[] = array(
2659     "title" => "<hr/>",
2660     "right" => array(
2661     "commission_mes_retours",
2662     "commission_mes_retours_tab",
2663     "commission_retours_ma_division",
2664     "commission_retours_ma_division_tab",
2665     "commission_tous_retours",
2666     "commission_tous_retours_tab",
2667     ),
2668     );
2669     $links[] = array(
2670     "href" => "".OM_ROUTE_TAB."&obj=commission_mes_retours",
2671     "class" => "commission_mes_retours",
2672     "title" => _("Mes retours"),
2673     "right" => array(
2674     "commission_mes_retours",
2675     "commission_mes_retours_tab",
2676     ),
2677     "open" => array("index.php|commission_mes_retours[module=tab]", "index.php|commission_mes_retours[module=form]", ),
2678     );
2679     $links[] = array(
2680     "href" => "".OM_ROUTE_TAB."&obj=commission_retours_ma_division",
2681     "class" => "commission_retours_ma_division",
2682     "title" => _("Retours de ma division"),
2683     "right" => array(
2684     "commission_retours_ma_division",
2685     "commission_retours_ma_division_tab",
2686     ),
2687     "open" => array("index.php|commission_retours_ma_division[module=tab]", "index.php|commission_retours_ma_division[module=form]", ),
2688     );
2689     $links[] = array(
2690     "href" => "".OM_ROUTE_TAB."&obj=commission_tous_retours",
2691     "class" => "commission_tous_retours",
2692     "title" => _("Tous les retours"),
2693     "right" => array(
2694     "commission_tous_retours",
2695     "commission_tous_retours_tab",
2696     ),
2697     "open" => array("index.php|commission_tous_retours[module=tab]", "index.php|commission_tous_retours[module=form]", ),
2698     );
2699    
2700     //
2701     $rubrik['links'] = $links;
2702     //
2703     $menu[] = $rubrik;
2704     // }}}
2705    
2706     // {{{ Rubrique Contentieux
2707     //
2708     $rubrik = array(
2709     "title" => _("Contentieux"),
2710     "class" => "contentieux",
2711     "right" => "menu_contentieux",
2712     );
2713     //
2714     $links = array();
2715     //
2716     $links[] = array(
2717     "href" => OM_ROUTE_DASHBOARD,
2718     "class" => "tableau-de-bord",
2719     "title" => _("tableau de bord"),
2720     "right" => "menu_contentieux_dashboard",
2721     "open" => array("index.php|[module=dashboard]", "index.php|dossier_contentieux_contradictoire[module=tab]", "index.php|dossier_contentieux_ait[module=tab]", "index.php|dossier_contentieux_audience[module=tab]", "index.php|dossier_contentieux_clotures[module=tab]", "index.php|dossier_contentieux_inaffectes[module=tab]", "index.php|dossier_contentieux_alerte_visite[module=tab]", "index.php|dossier_contentieux_alerte_parquet[module=tab]", ),
2722     );
2723     // Catégorie Nouvelle demande
2724     $links[] = array(
2725     "class" => "category",
2726     "title" => _("Nouvelle demande"),
2727     "right" => array(
2728     "demande_nouveau_dossier_contentieux_ajouter",
2729     ),
2730     );
2731     $links[] = array(
2732     "href" => "".OM_ROUTE_FORM."&obj=demande_nouveau_dossier_contentieux&amp;action=0&amp;advs_id=&amp;tricol=&amp;valide=&amp;retour=tab&amp;new=",
2733     "class" => "nouveau-dossier",
2734     "title" => _("nouveau dossier"),
2735     "right" => array(
2736     "demande_nouveau_dossier_contentieux_ajouter",
2737     ),
2738     "open" => array("index.php|demande_nouveau_dossier_contentieux[module=form]",),
2739     );
2740     // Catégorie Recours
2741     $links[] = array(
2742     "class" => "category",
2743     "title" => _("Recours"),
2744     "right" => array(
2745     "dossier_contentieux_mes_recours", "dossier_contentieux_mes_recours_tab",
2746     "dossier_contentieux_tous_recours", "dossier_contentieux_tous_recours_tab",
2747     ),
2748     );
2749     //
2750     $links[] = array(
2751     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_mes_recours",
2752     "class" => "dossier_contentieux_mes_recours",
2753     "title" => _("Mes recours"),
2754     "right" => array("dossier_contentieux_mes_recours", "dossier_contentieux_mes_recours_tab", ),
2755     "open" => array("index.php|dossier_contentieux_mes_recours[module=tab]", "index.php|dossier_contentieux_mes_recours[module=form]", ),
2756     );
2757     $links[] = array(
2758     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_tous_recours",
2759     "class" => "dossier_contentieux_tous_recours",
2760     "title" => _("Tous les recours"),
2761     "right" => array("dossier_contentieux_tous_recours", "dossier_contentieux_tous_recours_tab", ),
2762     "open" => array("index.php|dossier_contentieux_tous_recours[module=tab]", "index.php|dossier_contentieux_tous_recours[module=form]", ),
2763     );
2764     // Catégorie Infractions
2765     $links[] = array(
2766     "class" => "category",
2767     "title" => _("Infractions"),
2768     "right" => array(
2769     "dossier_contentieux_mes_infractions", "dossier_contentieux_mes_infractions_tab",
2770     "dossier_contentieux_toutes_infractions", "dossier_contentieux_toutes_infractions_tab",
2771     ),
2772     );
2773     //
2774     $links[] = array(
2775     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_mes_infractions",
2776     "class" => "dossier_contentieux_mes_infractions",
2777     "title" => _("Mes infractions"),
2778     "right" => array("dossier_contentieux_mes_infractions", "dossier_contentieux_mes_infractions_tab", ),
2779     "open" => array("index.php|dossier_contentieux_mes_infractions[module=tab]", "index.php|dossier_contentieux_mes_infractions[module=form]", ),
2780     );
2781     //
2782     $links[] = array(
2783     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_toutes_infractions",
2784     "class" => "dossier_contentieux_toutes_infractions",
2785     "title" => _("Toutes les infractions"),
2786     "right" => array("dossier_contentieux_toutes_infractions", "dossier_contentieux_toutes_infractions_tab", ),
2787     "open" => array("index.php|dossier_contentieux_toutes_infractions[module=tab]", "index.php|dossier_contentieux_toutes_infractions[module=form]", ),
2788     );
2789     // Catégorie MESSAGES
2790     $links[] = array(
2791     "class" => "category",
2792     "title" => _("Messages"),
2793     "right" => array(
2794     "messages_contentieux",
2795     "messages_contentieux_mes_retours",
2796     "messages_contentieux_retours_ma_division",
2797     "messages_contentieux_tous_retours",
2798     ),
2799     );
2800     //
2801     $links[] = array(
2802     "title" => "<hr/>",
2803     "right" => array(
2804     "messages_contentieux",
2805     "messages_contentieux_mes_retours",
2806     "messages_contentieux_retours_ma_division",
2807     "messages_contentieux_tous_retours",
2808     ),
2809     );
2810     //
2811     $links[] = array(
2812     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_mes_retours",
2813     "class" => "messages_contentieux_mes_retours",
2814     "title" => _("Mes messages"),
2815     "right" => array(
2816     "messages_contentieux",
2817     "messages_contentieux_mes_retours",
2818     "messages_contentieux_mes_retours_tab",
2819     ),
2820     "open" => array("index.php|messages_contentieux_mes_retours[module=tab]", "index.php|messages_contentieux_mes_retours[module=form]", ),
2821     );
2822     //
2823     $links[] = array(
2824     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_retours_ma_division",
2825     "class" => "messages_contentieux_retours_ma_division",
2826     "title" => _("Messages de ma division"),
2827     "right" => array(
2828     "messages_contentieux",
2829     "messages_contentieux_retours_ma_division",
2830     "messages_contentieux_retours_ma_division_tab",
2831     ),
2832     "open" => array("index.php|messages_contentieux_retours_ma_division[module=tab]", "index.php|messages_contentieux_retours_ma_division[module=form]", ),
2833     );
2834     //
2835     $links[] = array(
2836     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_tous_retours",
2837     "class" => "messages_contentieux_tous_retours",
2838     "title" => _("Tous les messages"),
2839     "right" => array(
2840     "messages_contentieux",
2841     "messages_contentieux_tous_retours",
2842     "messages_contentieux_tous_retours_tab",
2843     ),
2844     "open" => array("index.php|messages_contentieux_tous_retours[module=tab]", "index.php|messages_contentieux_tous_retours[module=form]", ),
2845     );
2846    
2847    
2848     //
2849     $rubrik['links'] = $links;
2850     //
2851     $menu[] = $rubrik;
2852     // }}}
2853    
2854     // {{{ Rubrique SUIVI
2855     //
2856     $rubrik = array(
2857     "title" => _("Suivi"),
2858     "class" => "suivi",
2859     "right" => "menu_suivi",
2860     );
2861     //
2862     $links = array();
2863     //
2864     $links[] = array(
2865     "href" => OM_ROUTE_DASHBOARD,
2866     "class" => "tableau-de-bord",
2867     "title" => _("tableau de bord"),
2868     "right" => "menu_suivi_dashboard",
2869     "open" => array("index.php|[module=dashboard]",),
2870     );
2871     $links[] = array(
2872     "class" => "category",
2873     "title" => _("suivi des pieces"),
2874     "right" => array(
2875     "instruction_suivi_retours_de_consultation", "instruction_suivi_mise_a_jour_des_dates",
2876     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_bordereaux",
2877     "instruction_suivi_retours_de_consultation_consulter", "instruction_suivi_mise_a_jour_des_dates_consulter",
2878     "instruction_suivi_envoi_lettre_rar_consulter", "instruction_suivi_bordereaux_consulter",
2879     ),
2880     );
2881     //
2882     $links[] = array(
2883     "title" => "<hr/>",
2884     "right" => array(
2885     "instruction_suivi_retours_de_consultation", "instruction_suivi_mise_a_jour_des_dates",
2886     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_bordereaux",
2887     "instruction_suivi_retours_de_consultation_consulter", "instruction_suivi_mise_a_jour_des_dates_consulter",
2888     "instruction_suivi_envoi_lettre_rar_consulter", "instruction_suivi_bordereaux_consulter",
2889     ),
2890     );
2891     //
2892     $links[] = array(
2893     "title" => "<hr/>",
2894     "right" => array(
2895     "instruction_suivi_mise_a_jour_des_dates", "instruction_suivi_mise_a_jour_des_dates_consulter",
2896     ),
2897     );
2898     //
2899     $links[] = array(
2900     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_mise_a_jour_des_dates&action=170&idx=0",
2901     "class" => "suivi_mise_a_jour_des_dates",
2902     "title" => _("Mise a jour des dates"),
2903     "right" => array("instruction_suivi_mise_a_jour_des_dates", "instruction_suivi_mise_a_jour_des_dates_consulter", ),
2904     "open" => array("index.php|instruction_suivi_mise_a_jour_des_dates[module=tab]", "index.php|instruction_suivi_mise_a_jour_des_dates[module=form]"),
2905     );
2906     //
2907     $links[] = array(
2908     "title" => "<hr/>",
2909     "right" => array(
2910     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_envoi_lettre_rar_consulter",
2911     ),
2912     );
2913     //
2914     $links[] = array(
2915     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_envoi_lettre_rar&action=160&idx=0",
2916     "class" => "envoi_lettre_rar",
2917     "title" => _("envoi lettre RAR"),
2918     "right" => array("instruction_suivi_envoi_lettre_rar", "instruction_suivi_envoi_lettre_rar_consulter", ),
2919     "open" => array("index.php|instruction_suivi_envoi_lettre_rar[module=tab]", "index.php|instruction_suivi_envoi_lettre_rar[module=form]"),
2920     );
2921     //
2922     $links[] = array(
2923     "title" => "<hr/>",
2924     "right" => array(
2925     "instruction_suivi_bordereaux", "instruction_suivi_bordereaux_consulter",
2926     ),
2927     );
2928     //
2929     $links[] = array(
2930     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_bordereaux&action=150&idx=0",
2931     "class" => "bordereaux",
2932     "title" => _("Bordereaux"),
2933     "right" => array("instruction_suivi_bordereaux", "instruction_suivi_bordereaux_consulter", ),
2934     "open" => array("index.php|instruction_suivi_bordereaux[module=tab]", "index.php|instruction_suivi_bordereaux[module=form]"),
2935     );
2936     //
2937     $links[] = array(
2938     "href" => "".OM_ROUTE_FORM."&obj=bordereau_envoi_maire&action=190&idx=0",
2939     "class" => "bordereau_envoi_maire",
2940     "title" => _("Bordereau d'envoi au maire"),
2941     "right" => array("instruction_bordereau_envoi_maire","bordereau_envoi_maire"),
2942     "open" => array("index.php|bordereau_envoi_maire[module=form]",),
2943     );
2944     //
2945     $links[] = array(
2946     "class" => "category",
2947     "title" => _("Demandes d'avis"),
2948     "right" => array(
2949     "consultation_suivi_mise_a_jour_des_dates",
2950     "consultation_suivi_retours_de_consultation",
2951     ),
2952     );
2953     //
2954     $links[] = array(
2955     "href" => "".OM_ROUTE_FORM."&obj=consultation&idx=0&action=110",
2956     "class" => "demandes_avis_mise_a_jour_des_dates",
2957     "title" => _("Mise a jour des dates"),
2958     "right" => array("consultation_suivi_mise_a_jour_des_dates", ),
2959     "open" => array("index.php|consultation[module=form][action=110]"),
2960     );
2961     //
2962     $links[] = array(
2963     "href" => "".OM_ROUTE_FORM."&obj=consultation&idx=0&action=120",
2964     "class" => "consultation-retour",
2965     "title" => _("retours de consultation"),
2966     "right" => array("consultation_suivi_retours_de_consultation", ),
2967     "open" => array("index.php|consultation[module=form][action=120]", "index.php|consultation[module=form][action=100]", ),
2968     );
2969     // Catégorie COMMISSIONS
2970     $links[] = array(
2971     "class" => "category",
2972     "title" => _("commissions"),
2973     "right" => array(
2974     "commission",
2975     "commission_tab",
2976     "commission_demandes_passage",
2977     "commission_demandes_passage_tab",
2978     ),
2979     );
2980     //
2981     $links[] = array(
2982     "title" => "<hr/>",
2983     "right" => array(
2984     "commission",
2985     "commission_tab",
2986     "commission_demandes_passage",
2987     "commission_demandes_passage_tab",
2988     ),
2989     );
2990     //
2991     $links[] = array(
2992     "href" => "".OM_ROUTE_TAB."&obj=commission",
2993     "class" => "commissions",
2994     "title" => _("gestion"),
2995     "right" => array(
2996     "commission",
2997     ),
2998     "open" => array("index.php|commission[module=tab]", "index.php|commission[module=form]", ),
2999     );
3000     //
3001     $links[] = array(
3002     "href" => "".OM_ROUTE_TAB."&obj=commission_demandes_passage",
3003     "class" => "commissions-demande-passage",
3004     "title" => _("demandes"),
3005     "right" => array(
3006     "commission",
3007     "commission_demandes_passage",
3008     ),
3009     "open" => array("index.php|commission_demandes_passage[module=tab]", "index.php|commission_demandes_passage[module=form]", ),
3010     );
3011     //
3012     $rubrik['links'] = $links;
3013     //
3014     $menu[] = $rubrik;
3015     // }}}
3016    
3017     // {{{ Rubrique DEMANDES D'AVIS
3018     //
3019     $rubrik = array(
3020     "title" => _("Demandes d'avis"),
3021     "class" => "demande_avis",
3022     "right" => "menu_demande_avis",
3023     );
3024     //
3025     $links = array();
3026     //
3027     $links[] = array(
3028     "href" => OM_ROUTE_DASHBOARD,
3029     "class" => "tableau-de-bord",
3030     "title" => _("tableau de bord"),
3031     "right" => "menu_demande_avis_dashboard",
3032     "open" => array("index.php|[module=dashboard]",),
3033     );
3034     //
3035     $links[] = array(
3036     "title" => "<hr/>",
3037     "right" => array(
3038     "demande_avis_encours", "demande_avis_encours_tab",
3039     "demande_avis_passee", "demande_avis_passee_tab",
3040     "demande_avis", "demande_avis_tab",
3041     ),
3042     );
3043     //
3044     $links[] = array(
3045     "href" => "".OM_ROUTE_TAB."&obj=demande_avis_encours",
3046     "class" => "demande_avis_encours",
3047     "title" => _("Demandes en cours"),
3048     "right" => array("demande_avis_encours", "demande_avis_encours_tab", ),
3049     "open" => array("index.php|demande_avis_encours[module=tab]", "index.php|demande_avis_encours[module=form]", ),
3050     );
3051    
3052     $links[] = array(
3053     "href" => "".OM_ROUTE_TAB."&obj=demande_avis_passee",
3054     "class" => "demande_avis_passee",
3055     "title" => _("Demandes passees"),
3056     "right" => array("demande_avis_passee", "demande_avis_passee_tab", ),
3057     "open" => array("index.php|demande_avis_passee[module=tab]", "index.php|demande_avis_passee[module=form]", ),
3058     );
3059    
3060     $links[] = array(
3061     "href" => "".OM_ROUTE_TAB."&obj=demande_avis",
3062     "class" => "demande_avis",
3063     "title" => _("Exports"),
3064     "right" => array("demande_avis", "demande_avis_tab", ),
3065     "open" => array("index.php|demande_avis[module=tab]", "index.php|demande_avis[module=form]", ),
3066     );
3067    
3068     //
3069     $rubrik['links'] = $links;
3070     //
3071     $menu[] = $rubrik;
3072     // }}}
3073    
3074    
3075     // Commentaire de la rubrique EXPORT qui n'est pas prévue d'être opérationnelle
3076     // dans cette version
3077     // {{{ Rubrique EXPORT
3078     //
3079     $rubrik = array(
3080     "title" => _("export / import"),
3081     "class" => "edition",
3082     "right" => "menu_export",
3083     );
3084     //
3085     $links = array();
3086    
3087     //
3088     $links[] = array(
3089     "href" => "".OM_ROUTE_FORM."&obj=sitadel&action=6&idx=0",
3090     "class" => "sitadel",
3091     "title" => _("export sitadel"),
3092     "right" => "export_sitadel",
3093     "open" => "index.php|sitadel[module=form]",
3094     );
3095     //
3096     $links[] = array(
3097     "href" => "../app/versement_archives.php",
3098     "class" => "versement_archives",
3099     "title" => _("versement aux archives"),
3100     "right" => "versement_archives",
3101     "open" => "versement_archives.php|",
3102     );
3103     //
3104     $links[] = array(
3105     "href" => "../app/reqmo_pilot.php",
3106     "class" => "reqmo",
3107     "title" => _("statistiques a la demande"),
3108     "right" => "reqmo_pilot",
3109     "open" => "reqmo_pilot.php|",
3110     );
3111     //
3112     $rubrik['links'] = $links;
3113     //
3114     $menu[] = $rubrik;
3115     // }}}
3116    
3117    
3118     // {{{ Rubrique PARAMETRAGE
3119     //
3120     $rubrik = array(
3121     "title" => _("parametrage dossiers"),
3122     "class" => "parametrage-dossier",
3123     "right" => "menu_parametrage",
3124     );
3125     //
3126     $links = array();
3127     //
3128     $links[] = array(
3129     "class" => "category",
3130     "title" => _("dossiers"),
3131     "right" => array(
3132     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3133     "dossier_autorisation_type_detaille",
3134     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3135     "dossier_instruction_type_tab", "cerfa", "cerfa_tab",
3136     ),
3137     );
3138     //
3139     $links[] = array(
3140     "title" => "<hr/>",
3141     "right" => array(
3142     "cerfa", "cerfa_tab",
3143     ),
3144     );
3145     //
3146     $links[] = array(
3147     "href" => "".OM_ROUTE_TAB."&obj=cerfa",
3148     "class" => "cerfa",
3149     "title" => _("cerfa"),
3150     "right" => array("cerfa", "cerfa_tab", ),
3151     "open" => array("index.php|cerfa[module=tab]", "index.php|cerfa[module=form]", ),
3152     );
3153     //
3154     $links[] = array(
3155     "title" => "<hr/>",
3156     "right" => array(
3157     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3158     "dossier_autorisation_type_detaille",
3159     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3160     "dossier_instruction_type_tab",
3161     ),
3162     );
3163     //
3164     $links[] = array(
3165     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_type",
3166     "class" => "dossier_autorisation_type",
3167     "title" => _("type DA"),
3168     "right" => array("dossier_autorisation_type", "dossier_autorisation_type_tab", ),
3169     "open" => array("index.php|dossier_autorisation_type[module=tab]", "index.php|dossier_autorisation_type[module=form]", ),
3170     );
3171     //
3172     $links[] = array(
3173     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_type_detaille",
3174     "class" => "dossier_autorisation_type_detaille",
3175     "title" => _("type DA detaille"),
3176     "right" => array("dossier_autorisation_type_detaille", "dossier_autorisation_type_detaille_tab", ),
3177     "open" => array("index.php|dossier_autorisation_type_detaille[module=tab]", "index.php|dossier_autorisation_type_detaille[module=form]", ),
3178     );
3179     //
3180     $links[] = array(
3181     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_type",
3182     "class" => "dossier_instruction_type",
3183     "title" => _("type DI"),
3184     "right" => array("dossier_instruction_type", "dossier_instruction_type_tab", ),
3185     "open" => array("index.php|dossier_instruction_type[module=tab]", "index.php|dossier_instruction_type[module=form]", ),
3186     );
3187     //
3188     $links[] = array(
3189     "title" => "<hr/>",
3190     "right" => array(
3191     "contrainte", "contrainte_tab",
3192     "contrainte_souscategorie", "contrainte_souscategorie_tab",
3193     "contrainte_categorie", "contrainte_categorie_tab"
3194     ),
3195     );
3196     //
3197     $links[] = array(
3198     "href" => "".OM_ROUTE_TAB."&obj=contrainte",
3199     "class" => "contrainte",
3200     "title" => _("contrainte"),
3201     "right" => array("contrainte", "contrainte_tab", ),
3202     "open" => array(
3203     "index.php|contrainte[module=tab]",
3204     "index.php|contrainte[module=form][action=0]",
3205     "index.php|contrainte[module=form][action=1]",
3206     "index.php|contrainte[module=form][action=2]",
3207     "index.php|contrainte[module=form][action=3]",
3208     ),
3209     );
3210     //
3211     $links[] = array(
3212     "class" => "category",
3213     "title" => _("demandes"),
3214     "right" => array(
3215     "demande_type",
3216     "demande_type_tab", "demande_nature", "demande_nature_tab",
3217     ),
3218     );
3219     //
3220     $links[] = array(
3221     "title" => "<hr/>",
3222     "right" => array(
3223     "demande_type",
3224     "demande_type_tab", "demande_nature", "demande_nature_tab",
3225     ),
3226     );
3227     //
3228     $links[] = array(
3229     "href" => "".OM_ROUTE_TAB."&obj=demande_nature",
3230     "class" => "demande_nature",
3231     "title" => _("nature"),
3232     "right" => array("demande_nature", "demande_nature_tab", ),
3233     "open" => array("index.php|demande_nature[module=tab]", "index.php|demande_nature[module=form]", ),
3234     );
3235     //
3236     $links[] = array(
3237     "href" => "".OM_ROUTE_TAB."&obj=demande_type",
3238     "class" => "demande_type",
3239     "title" => _("type"),
3240     "right" => array("demande_type", "demande_type_tab",),
3241     "open" => array("index.php|demande_type[module=tab]", "index.php|demande_type[module=form]", ),
3242     );
3243     //
3244     $links[] = array(
3245     "class" => "category",
3246     "title" => _("workflows"),
3247     "right" => array(
3248     "workflows",
3249     "action", "action_tab", "etat",
3250     "etat_tab", "evenement", "evenement_tab", "bible", "bible_tab", "avis_decision",
3251     "avis_decision_tab", "avis_consultation", "avis_consultation_tab",
3252     ),
3253     );
3254     //
3255     $links[] = array(
3256     "title" => "<hr/>",
3257     "right" => array(
3258     "workflows",
3259     "action", "action_tab", "etat",
3260     "etat_tab", "evenement", "evenement_tab", "bible", "bible_tab", "avis_decision",
3261     "avis_decision_tab", "avis_consultation", "avis_consultation_tab",
3262     ),
3263     );
3264     //
3265     $links[] = array(
3266     "href" => "../app/workflows.php",
3267     "class" => "workflows",
3268     "title" => _("workflows"),
3269     "right" => array("workflows", ),
3270     "open" => array("workflows.php|", ),
3271     );
3272     //
3273     $links[] = array(
3274     "title" => "<hr/>",
3275     "right" => array(
3276     "evenement", "evenement_tab",
3277     ),
3278     );
3279     //
3280     $links[] = array(
3281     "href" => "".OM_ROUTE_TAB."&obj=evenement",
3282     "class" => "evenement",
3283     "title" => _("evenement"),
3284     "right" => array("evenement", "evenement_tab", ),
3285     "open" => array("index.php|evenement[module=tab]", "index.php|evenement[module=form]", ),
3286     );
3287     //
3288     $links[] = array(
3289     "title" => "<hr/>",
3290     "right" => array(
3291     "action", "action_tab", "etat",
3292     "etat_tab", "avis_decision",
3293     "avis_decision_tab",
3294     ),
3295     );
3296     //
3297     $links[] = array(
3298     "href" => "".OM_ROUTE_TAB."&obj=etat",
3299     "class" => "workflow-etat",
3300     "title" => _("etat"),
3301     "right" => array("etat", "etat_tab", ),
3302     "open" => array("index.php|etat[module=tab]", "index.php|etat[module=form]", ),
3303     );
3304     //
3305     $links[] = array(
3306     "href" => "".OM_ROUTE_TAB."&obj=avis_decision",
3307     "class" => "avis_decision",
3308     "title" => _("avis decision"),
3309     "right" => array("avis_decision", "avis_decision_tab", ),
3310     "open" => array("index.php|avis_decision[module=tab]", "index.php|avis_decision[module=form]", ),
3311     );
3312     //
3313     $links[] = array(
3314     "href" => "".OM_ROUTE_TAB."&obj=action",
3315     "class" => "action",
3316     "title" => _("action"),
3317     "right" => array("action", "action_tab", ),
3318     "open" => array("index.php|action[module=tab]", "index.php|action[module=form]", ),
3319     );
3320     //
3321     $links[] = array(
3322     "title" => "<hr/>",
3323     "right" => array(
3324     "bible", "bible_tab",
3325     ),
3326     );
3327     //
3328     $links[] = array(
3329     "href" => "".OM_ROUTE_TAB."&obj=bible",
3330     "class" => "bible",
3331     "title" => _("bible"),
3332     "right" => array("bible", "bible_tab", ),
3333     "open" => array("index.php|bible[module=tab]", "index.php|bible[module=form]", ),
3334     );
3335     //
3336     $links[] = array(
3337     "class" => "category",
3338     "title" => _("editions"),
3339     "right" => array(
3340     "om_etat", "om_etat_tab", "om_sousetat", "om_sousetat_tab",
3341     "om_lettretype", "om_lettretype_tab", "om_requete", "om_requete_tab",
3342     "om_logo", "om_logo_tab",
3343     ),
3344     );
3345     //
3346     $links[] = array(
3347     "title" => "<hr/>",
3348     "right" => array(
3349     "om_etat", "om_etat_tab", "om_lettretype", "om_lettretype_tab",
3350     ),
3351     );
3352     //
3353     $links[] = array(
3354     "href" => "".OM_ROUTE_TAB."&obj=om_etat",
3355     "class" => "om_etat",
3356     "title" => _("om_etat"),
3357     "right" => array("om_etat", "om_etat_tab", ),
3358     "open" => array("index.php|om_etat[module=tab]", "index.php|om_etat[module=form]", ),
3359     );
3360     //
3361     $links[] = array(
3362     "href" => "".OM_ROUTE_TAB."&obj=om_lettretype",
3363     "class" => "om_lettretype",
3364     "title" => _("om_lettretype"),
3365     "right" => array("om_lettretype", "om_lettretype_tab"),
3366     "open" => array("index.php|om_lettretype[module=tab]", "index.php|om_lettretype[module=form]", ),
3367     );
3368     //
3369     $links[] = array(
3370     "title" => "<hr/>",
3371     "right" => array(
3372     "om_logo", "om_logo_tab",
3373     ),
3374     );
3375     //
3376     $links[] = array(
3377     "href" => "".OM_ROUTE_TAB."&obj=om_logo",
3378     "class" => "om_logo",
3379     "title" => _("om_logo"),
3380     "right" => array("om_logo", "om_logo_tab", ),
3381     "open" => array("index.php|om_logo[module=tab]", "index.php|om_logo[module=form]", ),
3382     );
3383     //
3384     $rubrik['links'] = $links;
3385     //
3386     $menu[] = $rubrik;
3387     // }}}
3388    
3389     // {{{ Rubrique PARAMETRAGE
3390     //
3391     $rubrik = array(
3392     "title" => _("parametrage"),
3393     "class" => "parametrage",
3394     "right" => "menu_parametrage",
3395     );
3396     //
3397     $links = array();
3398     //
3399     $links[] = array(
3400     "href" => "".OM_ROUTE_TAB."&obj=civilite",
3401     "class" => "civilite",
3402     "title" => _("civilite"),
3403     "right" => array("civilite", "civilite_tab", ),
3404     "open" => array("index.php|civilite[module=tab]", "index.php|civilite[module=form]", ),
3405     );
3406     //
3407     $links[] = array(
3408     "href" => "".OM_ROUTE_TAB."&obj=arrondissement",
3409     "class" => "arrondissement",
3410     "title" => _("arrondissement"),
3411     "right" => array("arrondissement", "arrondissement_tab", ),
3412     "open" => array("index.php|arrondissement[module=tab]", "index.php|arrondissement[module=form]", ),
3413     );
3414     //
3415     $links[] = array(
3416     "href" => "".OM_ROUTE_TAB."&obj=quartier",
3417     "class" => "quartier",
3418     "title" => _("quartier"),
3419     "right" => array("quartier", "quartier_tab", ),
3420     "open" => array("index.php|quartier[module=tab]", "index.php|quartier[module=form]", ),
3421     );
3422     //
3423     $links[] = array(
3424     "class" => "category",
3425     "title" => _("Organisation"),
3426     "right" => array(
3427     "direction", "direction_tab", "division", "division_tab", "instructeur_qualite",
3428     "instructeur_qualite_tab", "instructeur", "instructeur_tab", "groupe",
3429     "groupe_tab", "genre", "genre_tab", "signataire_arrete", "signataire_arrete_tab",
3430     "taxe_amenagement_tab", "taxe_amenagement",
3431     ),
3432     );
3433     $links[] = array(
3434     "title" => "<hr/>",
3435     "right" => array(
3436     "direction", "direction_tab", "division", "division_tab", "instructeur_qualite",
3437     "instructeur_qualite_tab", "instructeur", "instructeur_tab", "groupe",
3438     "groupe_tab", "genre", "genre_tab", "signataire_arrete", "signataire_arrete_tab",
3439     "taxe_amenagement_tab", "taxe_amenagement",
3440     ),
3441     );
3442     //
3443     $links[] = array(
3444     "href" => "".OM_ROUTE_TAB."&obj=genre",
3445     "class" => "genre",
3446     "title" => _("genre"),
3447     "right" => array("genre", "genre_tab", ),
3448     "open" => array("index.php|genre[module=tab]", "index.php|genre[module=form]", ),
3449     );
3450     //
3451     $links[] = array(
3452     "href" => "".OM_ROUTE_TAB."&obj=groupe",
3453     "class" => "groupe",
3454     "title" => _("groupe"),
3455     "right" => array("groupe", "groupe_tab", ),
3456     "open" => array("index.php|groupe[module=tab]", "index.php|groupe[module=form]", ),
3457     );
3458     //
3459     $links[] = array(
3460     "href" => "".OM_ROUTE_TAB."&obj=direction",
3461     "class" => "direction",
3462     "title" => _("direction"),
3463     "right" => array("direction", "direction_tab", ),
3464     "open" => array("index.php|direction[module=tab]", "index.php|direction[module=form]", ),
3465     );
3466     //
3467     $links[] = array(
3468     "href" => "".OM_ROUTE_TAB."&obj=division",
3469     "class" => "division",
3470     "title" => _("division"),
3471     "right" => array("division", "division_tab", ),
3472     "open" => array("index.php|division[module=tab]", "index.php|division[module=form]", ),
3473     );
3474     //
3475     $links[] = array(
3476     "href" => "".OM_ROUTE_TAB."&obj=instructeur_qualite",
3477     "class" => "instructeur_qualite",
3478     "title" => _("instructeur_qualite"),
3479     "right" => array("instructeur_qualite", "instructeur_qualite_tab", ),
3480     "open" => array("index.php|instructeur_qualite[module=tab]", "index.php|instructeur_qualite[module=form]", ),
3481     );
3482     //
3483     $links[] = array(
3484     "href" => "".OM_ROUTE_TAB."&obj=instructeur",
3485     "class" => "instructeur",
3486     "title" => _("instructeur"),
3487     "right" => array("instructeur", "instructeur_tab", ),
3488     "open" => array("index.php|instructeur[module=tab]", "index.php|instructeur[module=form]", ),
3489     );
3490     //
3491     $links[] = array(
3492     "href" => "".OM_ROUTE_TAB."&obj=signataire_arrete",
3493     "class" => "signataire_arrete",
3494     "title" => _("signataire arrete"),
3495     "right" => array("signataire_arrete", "signataire_arrete", ),
3496     "open" => array("index.php|signataire_arrete[module=tab]", "index.php|signataire_arrete[module=form]", ),
3497     );
3498     //
3499     $links[] = array(
3500     "href" => "".OM_ROUTE_TAB."&obj=taxe_amenagement",
3501     "class" => "taxe_amenagement",
3502     "title" => _("taxes"),
3503     "right" => array("taxe_amenagement", "taxe_amenagement_tab", ),
3504     "open" => array("index.php|taxe_amenagement[module=tab]", "index.php|taxe_amenagement[module=form]", ),
3505     );
3506     //
3507     $links[] = array(
3508     "class" => "category",
3509     "title" => _("gestion des commissions"),
3510     "right" => array(
3511     "commission_type", "commission_type_tab",
3512     ),
3513     );
3514     //
3515     $links[] = array(
3516     "title" => "<hr/>",
3517     "right" => array(
3518     "commission_type", "commission_type_tab",
3519     ),
3520     );
3521     //
3522     $links[] = array(
3523     "href" => "".OM_ROUTE_TAB."&obj=commission_type",
3524     "class" => "commission-type",
3525     "title" => _("commission_type"),
3526     "right" => array("commission_type", "commission_type_tab", ),
3527     "open" => array("index.php|commission_type[module=tab]", "index.php|commission_type[module=form]", ),
3528     );
3529     //
3530     $links[] = array(
3531     "class" => "category",
3532     "title" => _("gestion des consultations"),
3533     "right" => array(
3534     "avis_consultation", "avis_consultation_tab", "service", "service_tab",
3535     "service_categorie", "service_categorie_tab",
3536     "lien_service_service_categorie", "lien_service_service_categorie_tab",
3537     ),
3538     );
3539     //
3540     $links[] = array(
3541     "title" => "<hr/>",
3542     "right" => array(
3543     "avis_consultation", "avis_consultation_tab", "service", "service_tab",
3544     "service_categorie", "service_categorie_tab",
3545     "lien_service_service_categorie", "lien_service_service_categorie_tab",
3546     ),
3547     );
3548     //
3549     $links[] = array(
3550     "href" => "".OM_ROUTE_TAB."&obj=avis_consultation",
3551     "class" => "avis_consultation",
3552     "title" => _("avis consultation"),
3553     "right" => array("avis_consultation", "avis_consultation_tab", ),
3554     "open" => array("index.php|avis_consultation[module=tab]", "index.php|avis_consultation[module=form]", ),
3555     );
3556     //
3557     $links[] = array(
3558     "href" => "".OM_ROUTE_TAB."&obj=service",
3559     "class" => "service",
3560     "title" => _("service"),
3561     "right" => array("service", "service_tab", ),
3562     "open" => array("index.php|service[module=tab]", "index.php|service[module=form]", ),
3563     );
3564     $links[] = array(
3565     "href" => "".OM_ROUTE_TAB."&obj=service_categorie",
3566     "class" => "service_categorie",
3567     "title" => _("thematique des services"),
3568     "right" => array("service_categorie", "service_categorie_tab", ),
3569     "open" => array("index.php|service_categorie[module=tab]", "index.php|service_categorie[module=form]", ),
3570     );
3571     //
3572     $links[] = array(
3573     "class" => "category",
3574     "title" => _("Gestion des dossiers"),
3575     "right" => array(
3576     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3577     "dossier_autorisation_type_detaille",
3578     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3579     "dossier_instruction_type_tab",
3580     "autorite_competente", "autorite_competente_tab",
3581     "affectation_automatique", "affectation_automatique_tab",
3582     ),
3583     );
3584     //
3585     $links[] = array(
3586     "title" => "<hr/>",
3587     "right" => array(
3588     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3589     "dossier_autorisation_type_detaille",
3590     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3591     "dossier_instruction_type_tab",
3592     "autorite_competente", "autorite_competente_tab",
3593     "affectation_automatique", "affectation_automatique_tab",
3594    
3595     ),
3596     );
3597     //
3598     $links[] = array(
3599     "href" => "".OM_ROUTE_TAB."&obj=etat_dossier_autorisation",
3600     "class" => "etat_dossier_autorisation",
3601     "title" => _("etat dossiers autorisations"),
3602     "right" => array("etat_dossier_autorisation", "etat_dossier_autorisation_tab", ),
3603     "open" => array("index.php|etat_dossier_autorisation[module=tab]", "index.php|etat_dossier_autorisation[module=form]", ),
3604     );
3605     //
3606     $links[] = array(
3607     "href" => "".OM_ROUTE_TAB."&obj=affectation_automatique",
3608     "class" => "affectation_automatique",
3609     "title" => _("affectation automatique"),
3610     "right" => array("affectation_automatique", "affectation_automatique_tab", ),
3611     "open" => array("index.php|affectation_automatique[module=tab]", "index.php|affectation_automatique[module=form]", ),
3612     );
3613     //
3614     $links[] = array(
3615     "href" => "".OM_ROUTE_TAB."&obj=autorite_competente",
3616     "class" => "autorite_competente",
3617     "title" => _("autorite")." "._("competente"),
3618     "right" => array("autorite_competente", "autorite_competente_tab", ),
3619     "open" => array("index.php|autorite_competente[module=tab]", "index.php|autorite_competente[module=form]", ),
3620     );
3621     //
3622     $links[] = array(
3623     "href" => "".OM_ROUTE_TAB."&obj=phase",
3624     "class" => "phase",
3625     "title" => _("phase"),
3626     "right" => array("phase", "phase_tab", ),
3627     "open" => array("index.php|phase[module=tab]", "index.php|phase[module=form]", ),
3628     );
3629    
3630     //Gestion des pièces
3631     $links[] = array(
3632     "class" => "category",
3633     "title" => _("Gestion des pièces"),
3634     "right" => array(
3635     "document_numerise_type_categorie", "document_numerise_type_categorie_tab",
3636     "document_numerise_type",
3637     "document_numerise_type_tab", "document_numerise_traitement_metadonnees",
3638     "document_numerise_traitement_metadonnees_executer",
3639     ),
3640     );
3641     //
3642     $links[] = array(
3643     "title" => "<hr/>",
3644     "right" => array(
3645     "document_numerise_type_categorie", "document_numerise_type_categorie_tab",
3646     "document_numerise_type",
3647     "document_numerise_type_tab", "document_numerise_traitement_metadonnees",
3648     "document_numerise_traitement_metadonnees_executer",
3649     ),
3650     );
3651     //
3652     $links[] = array(
3653     "href" => "".OM_ROUTE_TAB."&obj=document_numerise_type_categorie",
3654     "class" => "document_numerise_type_categorie",
3655     "title" => _("Catégorie des pièces"),
3656     "right" => array(
3657     "document_numerise_type_categorie",
3658     "document_numerise_type_categorie_tab",
3659     ),
3660     "open" => array(
3661     "index.php|document_numerise_type_categorie[module=tab]",
3662     "index.php|document_numerise_type_categorie[module=form]",
3663     ),
3664     );
3665     //
3666     $links[] = array(
3667     "href" => "".OM_ROUTE_TAB."&obj=document_numerise_type",
3668     "class" => "document_numerise_type",
3669     "title" => _("Type des pièces"),
3670     "right" => array(
3671     "document_numerise_type",
3672     "document_numerise_type_tab",
3673     ),
3674     "open" => array(
3675     "index.php|document_numerise_type[module=tab]",
3676     "index.php|document_numerise_type[module=form][action=0]",
3677     "index.php|document_numerise_type[module=form][action=1]",
3678     "index.php|document_numerise_type[module=form][action=2]",
3679     "index.php|document_numerise_type[module=form][action=3]",
3680     ),
3681     );
3682     //
3683     $links[] = array(
3684     "href" => "".OM_ROUTE_FORM."&obj=document_numerise_traitement_metadonnees&action=100&idx=0",
3685     "class" => "document_numerise_traitement_metadonnees",
3686     "title" => _("Mise à jour des métadonnées"),
3687     "description" => _("Mettre à jour les métadonnées de tous les documents numérisés."),
3688     "right" => array(
3689     "document_numerise_traitement_metadonnees",
3690     "document_numerise_traitement_metadonnees_executer",
3691     ),
3692     "open" => array("index.php|document_numerise_traitement_metadonnees[module=form]", ),
3693     );
3694    
3695     // Gestion des contentieux
3696     $links[] = array(
3697     "class" => "category",
3698     "title" => _("Gestion des contentieux"),
3699     "right" => array(
3700     "objet_recours", "objet_recours_tab", "moyen_souleve", "moyen_souleve_tab",
3701     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3702     ),
3703     );
3704     //
3705     $links[] = array(
3706     "title" => "<hr/>",
3707     "right" => array(
3708     "objet_recours", "objet_recours_tab", "moyen_souleve", "moyen_souleve_tab",
3709     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3710     ),
3711     );
3712     //
3713     $links[] = array(
3714     "href" => "".OM_ROUTE_TAB."&obj=objet_recours",
3715     "class" => "objet_recours",
3716     "title" => _("objet_recours"),
3717     "right" => array(
3718     "objet_recours", "objet_recours_tab",
3719     ),
3720     "open" => array(
3721     "index.php|objet_recours[module=tab]", "index.php|objet_recours[module=form]",
3722     ),
3723     );
3724     //
3725     $links[] = array(
3726     "href" => "".OM_ROUTE_TAB."&obj=moyen_souleve",
3727     "class" => "moyen_souleve",
3728     "title" => _("moyen_souleve"),
3729     "right" => array(
3730     "moyen_souleve", "moyen_souleve_tab",
3731     ),
3732     "open" => array(
3733     "index.php|moyen_souleve[module=tab]", "index.php|moyen_souleve[module=form]",
3734     ),
3735     );
3736     //
3737     $links[] = array(
3738     "href" => "".OM_ROUTE_TAB."&obj=moyen_retenu_juge",
3739     "class" => "moyen_retenu_juge",
3740     "title" => _("moyen_retenu_juge"),
3741     "right" => array(
3742     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3743     ),
3744     "open" => array(
3745     "index.php|moyen_retenu_juge[module=tab]", "index.php|moyen_retenu_juge[module=form]",
3746     ),
3747     );
3748    
3749     //
3750     $rubrik['links'] = $links;
3751     //
3752     $menu[] = $rubrik;
3753     // }}}
3754    
3755     // {{{ Rubrique ADMINISTRATION
3756     //
3757     $rubrik = array(
3758     "title" => _("administration"),
3759     "class" => "administration",
3760     "right" => "menu_administration",
3761     );
3762     //
3763     $links = array();
3764     //
3765     $links[] = array(
3766     "href" => "".OM_ROUTE_TAB."&obj=om_collectivite",
3767     "class" => "collectivite",
3768     "title" => _("om_collectivite"),
3769     "right" => array("om_collectivite", "om_collectivite_tab", ),
3770     "open" => array("index.php|om_collectivite[module=tab]", "index.php|om_collectivite[module=form]", ),
3771     );
3772     //
3773     $links[] = array(
3774     "href" => "".OM_ROUTE_TAB."&obj=om_parametre",
3775     "class" => "parametre",
3776     "title" => _("om_parametre"),
3777     "right" => array("om_parametre", "om_parametre_tab", ),
3778     "open" => array("index.php|om_parametre[module=tab]", "index.php|om_parametre[module=form]", ),
3779     );
3780     //
3781     $links[] = array(
3782     "class" => "category",
3783     "title" => _("gestion des utilisateurs"),
3784     "right" => array(
3785     "om_utilisateur", "om_utilisateur_tab", "om_profil", "om_profil_tab",
3786     "om_droit", "om_droit_tab", "directory",
3787     ),
3788     );
3789     //
3790     $links[] = array(
3791     "title" => "<hr/>",
3792     "right" => array(
3793     "om_utilisateur", "om_utilisateur_tab", "om_profil", "om_profil_tab",
3794     "om_droit", "om_droit_tab",
3795     ),
3796     );
3797     //
3798     $links[] = array(
3799     "href" => "".OM_ROUTE_TAB."&obj=om_profil",
3800     "class" => "profil",
3801     "title" => _("om_profil"),
3802     "right" => array("om_profil", "om_profil_tab", ),
3803     "open" => array("index.php|om_profil[module=tab]", "index.php|om_profil[module=form]", ),
3804     );
3805     //
3806     $links[] = array(
3807     "href" => "".OM_ROUTE_TAB."&obj=om_droit",
3808     "class" => "droit",
3809     "title" => _("om_droit"),
3810     "right" => array("om_droit", "om_droit_tab", ),
3811     "open" => array("index.php|om_droit[module=tab]", "index.php|om_droit[module=form]", ),
3812     );
3813     //
3814     $links[] = array(
3815     "href" => "".OM_ROUTE_TAB."&obj=om_utilisateur",
3816     "class" => "utilisateur",
3817     "title" => _("om_utilisateur"),
3818     "right" => array("om_utilisateur", "om_utilisateur_tab", ),
3819     "open" => array(
3820     "index.php|om_utilisateur[module=tab]",
3821     "index.php|om_utilisateur[module=form][action=0]",
3822     "index.php|om_utilisateur[module=form][action=1]",
3823     "index.php|om_utilisateur[module=form][action=2]",
3824     "index.php|om_utilisateur[module=form][action=3]",
3825     ),
3826     );
3827     //
3828     $links[] = array(
3829     "title" => "<hr/>",
3830     "right" => array("om_utilisateur", "om_utilisateur_synchroniser", ),
3831     "parameters" => array("isDirectoryOptionEnabled" => true, ),
3832     );
3833     //
3834     $links[] = array(
3835     "href" => "".OM_ROUTE_FORM."&obj=om_utilisateur&idx=0&action=11",
3836     "class" => "annuaire",
3837     "title" => _("annuaire"),
3838     "right" => array("om_utilisateur", "om_utilisateur_synchroniser", ),
3839     "open" => array("index.php|om_utilisateur[module=form][action=11]", ),
3840     "parameters" => array("isDirectoryOptionEnabled" => true, ),
3841     );
3842     //
3843     $links[] = array(
3844     "class" => "category",
3845     "title" => _("tableaux de bord"),
3846     "right" => array(
3847     "om_widget", "om_widget_tab", "om_dashboard",
3848     ),
3849     );
3850     //
3851     $links[] = array(
3852     "title" => "<hr/>",
3853     "right" => array(
3854     "om_widget", "om_widget_tab", "om_dashboard",
3855     ),
3856     );
3857     //
3858     $links[] = array(
3859     "href" => "".OM_ROUTE_TAB."&obj=om_widget",
3860     "class" => "om_widget",
3861     "title" => _("om_widget"),
3862     "right" => array("om_widget", "om_widget_tab", ),
3863     "open" => array("index.php|om_widget[module=tab]", "index.php|om_widget[module=form]", ),
3864     );
3865     //
3866     $links[] = array(
3867     "href" => "".OM_ROUTE_FORM."&obj=om_dashboard&amp;idx=0&amp;action=4",
3868     "class" => "om_dashboard",
3869     "title" => _("composition"),
3870     "right" => array("om_dashboard", ),
3871     "open" => array("index.php|om_dashboard[module=form][action=4]", ),
3872     );
3873     //
3874     $links[] = array(
3875     "class" => "category",
3876     "title" => _("sig"),
3877     "right" => array(
3878     "om_sig_map", "om_sig_map_tab", "om_sig_flux", "om_sig_flux_tab", "om_sig_extent", "om_sig_extent_tab",
3879     ),
3880     "parameters" => array("option_localisation" => "sig_interne", ),
3881     );
3882     //
3883     $links[] = array(
3884     "title" => "<hr/>",
3885     "right" => array(
3886     "om_sig_map", "om_sig_map_tab", "om_sig_flux", "om_sig_flux_tab", "om_sig_extent", "om_sig_extent_tab",
3887     ),
3888     "parameters" => array("option_localisation" => "sig_interne", ),
3889     );
3890     //
3891     $links[] = array(
3892     "href" => "".OM_ROUTE_TAB."&obj=om_sig_extent",
3893     "class" => "om_sig_extent",
3894     "title" => _("om_sig_extent"),
3895     "right" => array("om_sig_extent", "om_sig_extent_tab", ),
3896     "open" => array("index.php|om_sig_extent[module=tab]", "index.php|om_sig_extent[module=form]", ),
3897     "parameters" => array("option_localisation" => "sig_interne", ),
3898     );
3899     //
3900     $links[] = array(
3901     "href" => "".OM_ROUTE_TAB."&obj=om_sig_map",
3902     "class" => "om_sig_map",
3903     "title" => _("om_sig_map"),
3904     "right" => array("om_sig_map", "om_sig_map_tab", ),
3905     "open" => array("index.php|om_sig_map[module=tab]", "index.php|om_sig_map[module=form]", ),
3906     "parameters" => array("option_localisation" => "sig_interne", ),
3907     );
3908     //
3909     $links[] = array(
3910     "href" => "".OM_ROUTE_TAB."&obj=om_sig_flux",
3911     "class" => "om_sig_flux",
3912     "title" => _("om_sig_flux"),
3913     "right" => array("om_sig_flux", "om_sig_flux_tab", ),
3914     "open" => array("index.php|om_sig_flux[module=tab]", "index.php|om_sig_flux[module=form]", ),
3915     "parameters" => array("option_localisation" => "sig_interne", ),
3916     );
3917     //
3918     $links[] = array(
3919     "class" => "category",
3920     "title" => _("options avancees"),
3921     "right" => array("import", "gen", "om_requete", "om_requete_tab",
3922     "om_sousetat", "om_sousetat_tab",),
3923     );
3924     //
3925     $links[] = array(
3926     "title" => "<hr/>",
3927     "right" => array(
3928     "interface_referentiel_erp",
3929     ),
3930     );
3931     //
3932     $links[] = array(
3933     "href" => "../app/settings.php?controlpanel=interface_referentiel_erp",
3934     "class" => "interface_referentiel_erp",
3935     "title" => _("interface_referentiel_erp"),
3936     "right" => array("interface_referentiel_erp", ),
3937     "open" => array("settings.php|[controlpanel=interface_referentiel_erp]", ),
3938     );
3939     //
3940     $links[] = array(
3941     "title" => "<hr/>",
3942     "right" => array(
3943     "om_sousetat", "om_sousetat_tab",
3944     ),
3945     );
3946     //
3947     $links[] = array(
3948     "href" => "".OM_ROUTE_TAB."&obj=om_sousetat",
3949     "class" => "om_sousetat",
3950     "title" => _("om_sousetat"),
3951     "right" => array("om_sousetat", "om_sousetat_tab", ),
3952     "open" => array("index.php|om_sousetat[module=tab]", "index.php|om_sousetat[module=form]", ),
3953     );
3954     //
3955     $links[] = array(
3956     "title" => "<hr/>",
3957     "right" => array("om_requete", "om_requete_tab", ),
3958     );
3959     //
3960     $links[] = array(
3961     "href" => "".OM_ROUTE_TAB."&obj=om_requete",
3962     "class" => "om_requete",
3963     "title" => _("om_requete"),
3964     "right" => array("om_requete", "om_requete_tab", ),
3965     "open" => array("index.php|om_requete[module=tab]", "index.php|om_requete[module=form]", ),
3966     );
3967     //
3968     $links[] = array(
3969     "title" => "<hr/>",
3970     "right" => array("import", ),
3971     );
3972     //
3973     $links[] = array(
3974     "href" => OM_ROUTE_MODULE_IMPORT,
3975     "class" => "import",
3976     "title" => _("Import"),
3977     "right" => array("import", ),
3978     "open" => array("import.php|", ),
3979     );
3980     //
3981     $links[] = array(
3982     "href" => "../app/import_specific.php",
3983     "class" => "import_specific",
3984     "title" => _("Import specifique"),
3985     "right" => array("import", ),
3986     "open" => array("import_specific.php|", ),
3987     );
3988     //
3989     $links[] = array(
3990     "title" => "<hr/>",
3991     "right" => array("gen", ),
3992     );
3993     //
3994     $links[] = array(
3995     "title" => _("Generateur"),
3996     "href" => OM_ROUTE_MODULE_GEN,
3997     "class" => "generator",
3998     "right" => array("gen", ),
3999     "open" => array(
4000     "gen.php|","genauto.php|", "gensup.php|", "genfull.php|",
4001     "genetat.php|", "gensousetat.php|", "genlettretype.php|",
4002     "genimport.php|",
4003     ),
4004     );
4005     //
4006     $links[] = array(
4007     "href" => "".OM_ROUTE_FORM."&obj=contrainte&action=100&idx=0",
4008     "class" => "contrainte",
4009     "title" => _("synchronisation des contraintes"),
4010     "right" => array("contrainte", "contrainte_synchronisation", ),
4011     "open" => array("index.php|contrainte[module=form][action=100]", ),
4012     "parameters" => array(
4013     "option_sig" => "sig_externe",
4014     ),
4015     );
4016     //
4017     $links[] = array(
4018     "href" => "".OM_ROUTE_FORM."&obj=dossier_instruction&action=126&idx=0",
4019     "class" => "geocoder",
4020     "title" => _("Géolocalisation des dossiers"),
4021     "right" => array("dossier_instruction_geocoder", ),
4022     "open" => array("index.php|dossier_instruction[module=form][action=126]", ),
4023     "parameters" => array(
4024     "option_sig" => "sig_externe",
4025     ),
4026     );
4027     //
4028     $rubrik['links'] = $links;
4029     //
4030     $menu[] = $rubrik;
4031     $this->config__menu = $menu;
4032     }
4033 mbroquet 3730 }
4034    
4035 softime 7996

Properties

Name Value
svn:keywords "Id"

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26