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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8593 - (hide annotations)
Wed Feb 27 16:39:17 2019 UTC (5 years, 11 months ago) by softime
File size: 153203 byte(s)
* Merge de la branche d'intégration 4.10.0-develop dans 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 8593 /**
1708     * Vérifie que l'option de rédaction libre de l'édition est activée.
1709     *
1710     * @param integer $om_collectivite Identifiant de la collectivité.
1711     *
1712     * @return boolean
1713     */
1714     public function is_option_redaction_libre_enabled($om_collectivite=null) {
1715     //
1716     $parameters = $this->getCollectivite($om_collectivite);
1717     //
1718     if (isset($parameters['option_redaction_libre']) === true
1719     && $parameters['option_redaction_libre'] === 'true') {
1720     //
1721     return true;
1722     }
1723 softime 7685
1724 softime 8593 //
1725     return false;
1726     }
1727    
1728    
1729 softime 6929 /**
1730 softime 7685 * Vérifie que l'option de finalisation automatique des instructions tacites
1731     * et retours est activée..
1732     *
1733     * @param integer $om_collectivite Identifiant de la collectivité.
1734     *
1735     * @return boolean
1736     */
1737     public function is_option_finalisation_auto_enabled($om_collectivite = null) {
1738     //
1739     $parameters = $this->getCollectivite($om_collectivite);
1740     //
1741     if (isset($parameters['option_final_auto_instr_tacite_retour']) === true
1742     && $parameters['option_final_auto_instr_tacite_retour'] === 'true') {
1743     //
1744     return true;
1745     }
1746    
1747     //
1748     return false;
1749     }
1750    
1751 softime 8329 /**
1752     * Vérifie que l'option de trouillotage numérique automatique des
1753     * pièces est activée.
1754     *
1755     * @param integer $om_collectivite Identifiant de la collectivité.
1756     *
1757     * @return boolean
1758     */
1759     public function is_option_trouillotage_numerique_enabled($om_collectivite = null) {
1760     //
1761     $parameters = $this->getCollectivite($om_collectivite);
1762     //
1763     if (isset($parameters['option_trouillotage_numerique']) === true
1764     && $parameters['option_trouillotage_numerique'] === 'true') {
1765     //
1766     return true;
1767     }
1768     //
1769     return false;
1770     }
1771 softime 7685
1772     /**
1773 nmeucci 4108 * Vérifie le niveau de la collectivité de l'utilisateur connecté
1774     *
1775     * @return boolean
1776     */
1777     function has_collectivite_multi() {
1778     $idx_multi = $this->get_idx_collectivite_multi();
1779     if (intval($_SESSION['collectivite']) === intval($idx_multi)) {
1780     return true;
1781     }
1782     return false;
1783     }
1784 mbroquet 3730
1785 nmeucci 4108
1786 softime 3976 /**
1787     * Pour un path absolu donné, retourne le relatif à la racine de
1788     * l'application.
1789     *
1790     * @param string $absolute Chemin absolu.
1791     *
1792     * @return mixed Faux si échec sinon chemin relatif.
1793     */
1794     public function get_relative_path($absolute) {
1795     if ($this->get_path_app() === false) {
1796     return false;
1797     }
1798     $path_app = $this->get_path_app();
1799     return str_replace($path_app, '', $absolute);
1800     }
1801    
1802    
1803     /**
1804     * Retourne le path absolu de la racine de l'application
1805     *
1806     * @return mixed Faux si échec sinon chemin absolu
1807     */
1808     public function get_path_app() {
1809     $match = array();
1810     preg_match( '/(.*)\/[a-zA-Z0-9]+\/\.\.\/core\/$/', PATH_OPENMAIRIE, $match);
1811     // On vérifie qu'il n'y a pas d'erreur
1812     if (isset($match[1]) === false) {
1813     return false;
1814     }
1815     return $match[1];
1816     }
1817    
1818 nmeucci 3981 /**
1819     * Compose un tableau et retourne son code HTML
1820     *
1821     * @param string $id ID CSS du conteneur
1822     * @param array $headers entêtes de colonnes
1823     * @param array $rows lignes
1824     * @return string code HTML
1825     */
1826 nmeucci 3980 public function compose_generate_table($id, $headers, $rows) {
1827 nmeucci 3981 //
1828     $html = '';
1829 nmeucci 3980 // Début conteneur
1830 nmeucci 3981 $html .= '<div id="'.$id.'">';
1831 nmeucci 3980 // Début tableau
1832 nmeucci 3981 $html .= '<table class="tab-tab">';
1833 nmeucci 3980 // Début entête
1834 nmeucci 3981 $html .= '<thead>';
1835     $html .= '<tr class="ui-tabs-nav ui-accordion ui-state-default tab-title">';
1836 nmeucci 3980 // Colonnes
1837     $nb_colonnes = count($headers);
1838     $index_last_col = $nb_colonnes - 1;
1839     foreach ($headers as $i => $header) {
1840     if ($i === 0) {
1841     $col = ' firstcol';
1842     }
1843     if ($i === $index_last_col) {
1844     $col = ' lastcol';
1845     }
1846 nmeucci 3981 $html .= '<th class="title col-'.$i.$col.'">';
1847     $html .= '<span class="name">';
1848     $html .= $header;
1849     $html .= '</span>';
1850     $html .= '</th>';
1851 nmeucci 3980 }
1852     // Fin entête
1853 nmeucci 3981 $html .= '</tr>';
1854     $html .= '</thead>';
1855 nmeucci 3980 // Début corps
1856 nmeucci 3981 $html .= '<tbody>';
1857 nmeucci 3980 // Lignes
1858     foreach ($rows as $cells) {
1859     // Début ligne
1860 nmeucci 3981 $html .= '<tr class="tab-data">';
1861 nmeucci 3980 // Cellules
1862     foreach ($cells as $j => $cell) {
1863     if ($j === 0) {
1864     $col = ' firstcol';
1865     }
1866     if ($j === $index_last_col) {
1867     $col = ' lastcol';
1868     }
1869 nmeucci 3981 $html .= '<td class="title col-'.$j.$col.'">';
1870     $html .= '<span class="name">';
1871     $html .= $cell;
1872     $html .= '</span>';
1873     $html .= '</td>';
1874 nmeucci 3980 }
1875     // Fin ligne
1876 nmeucci 3981 $html .= "</tr>";
1877 nmeucci 3980 }
1878     // Fin corps
1879 nmeucci 3981 $html .= '</tbody>';
1880 nmeucci 3980 // Fin tableau
1881 nmeucci 3981 $html .= '</table>';
1882 nmeucci 3980 // Fin conteneur
1883 nmeucci 3981 $html .= '</div>';
1884     //
1885     return $html;
1886 nmeucci 3980 }
1887 nmeucci 4156
1888     /**
1889     * Retourne le login de l'utilisateur connecté + entre parenthèses son nom
1890     * s'il en a un.
1891     *
1892     * @return string myLogin OU myLogin (myName)
1893     */
1894     public function get_connected_user_login_name() {
1895     // Requête et stockage des informations de l'user connecté
1896     $this->getUserInfos();
1897     // Si le nom existe et est défini on le récupère
1898     $nom = "";
1899     if (isset($this->om_utilisateur["nom"])
1900     && !empty($this->om_utilisateur["nom"])) {
1901     $nom = trim($this->om_utilisateur["nom"]);
1902     }
1903     // Définition de l'émetteur : obligatoirement son login
1904     $emetteur = $_SESSION['login'];
1905     // Définition de l'émetteur : + éventuellement son nom
1906     if ($nom != "") {
1907     $emetteur .= " (".$nom.")";
1908     }
1909     // Retour
1910     return $emetteur;
1911     }
1912 nhaye 4218
1913     /**
1914 fmichon 4708 * Cette méthode permet d'interfacer le module 'Settings'.
1915     */
1916     function view_module_settings() {
1917     //
1918     require_once "../obj/settings.class.php";
1919     $settings = new settings();
1920     $settings->view_main();
1921     }
1922    
1923 softime 7366
1924 fmichon 4708 /**
1925 softime 7366 * Vérifie que l'option référentiel ERP est activée.
1926 fmichon 4708 *
1927 softime 7366 * @param integer $om_collectivite Identifiant de la collectivité.
1928 fmichon 4708 *
1929     * @return boolean
1930     */
1931 softime 7366 public function is_option_referentiel_erp_enabled($om_collectivite=null) {
1932 fmichon 4708 //
1933 softime 7366 $parameters = $this->getCollectivite($om_collectivite);
1934     //
1935     if (isset($parameters['option_referentiel_erp']) === true
1936     && $parameters['option_referentiel_erp'] === 'true') {
1937     //
1938     return true;
1939 fmichon 4708 }
1940 softime 7366
1941 fmichon 4708 //
1942 softime 7366 return false;
1943 fmichon 4708 }
1944    
1945 softime 7366
1946 fmichon 4708 /**
1947     * Interface avec le référentiel ERP.
1948     */
1949     function send_message_to_referentiel_erp($code, $infos) {
1950     //
1951     require_once "../obj/interface_referentiel_erp.class.php";
1952     $interface_referentiel_erp = new interface_referentiel_erp();
1953     $ret = $interface_referentiel_erp->send_message_to_referentiel_erp($code, $infos);
1954     return $ret;
1955     }
1956    
1957     /**
1958 nhaye 4218 * Récupère la liste des identifiants des collectivités
1959     *
1960     * @param string $return_type 'string' ou 'array' selon que l'on retourne
1961     * respectivement une chaîne ou un tableau
1962     * @param string $separator caractère(s) séparateur(s) employé(s) lorsque
1963     * l'on retourne une chaîne, inutilisé si tableau
1964     * @return mixed possibilité de boolean/string/array :
1965     * false si erreur BDD sinon résultat
1966     */
1967     public function get_list_id_collectivites($return_type = 'string', $separator = ',') {
1968     $sql = "
1969     SELECT
1970     array_to_string(
1971     array_agg(om_collectivite),
1972     '".$separator."'
1973     ) as list_id_collectivites
1974     FROM ".DB_PREFIXE."om_collectivite";
1975     $list = $this->db->getone($sql);
1976     $this->addTolog(
1977     __FILE__." - ".__METHOD__." : db->getone(\"".$sql."\");",
1978     VERBOSE_MODE
1979     );
1980     if ($this->isDatabaseError($list, true)) {
1981     return false;
1982     }
1983     if ($return_type === 'array') {
1984     return explode($separator, $list);
1985     }
1986     return $list;
1987     }
1988 nhaye 5254
1989 softime 6565 /**
1990     * Teste si l'utilisateur connecté appartient au groupe indiqué en paramètre
1991     * ou s'il a le goupe bypass.
1992     *
1993     * @param string $groupe Code du groupe : ADS / CTX / CU / RU / ERP.
1994     * @return boolean vrai si utilisateur appartient au groupe fourni
1995     */
1996     public function is_user_in_group($groupe) {
1997     if (isset($_SESSION['groupe']) === true
1998     && (array_key_exists($groupe, $_SESSION['groupe']) === true
1999     || array_key_exists("bypass", $_SESSION['groupe']) === true)) {
2000     return true;
2001     }
2002     return false;
2003     }
2004    
2005     /**
2006     * CONDITION - can_user_access_dossiers_confidentiels_from_groupe
2007     *
2008     * Permet de savoir si le type de dossier d'autorisation du dossier courant est
2009     * considéré comme confidentiel ou si l'utilisateur a le groupe bypass.
2010     *
2011     * @param string $groupe Code du groupe : ADS / CTX / CU / RU / ERP.
2012     * @return boolean true si l'utilisateur à accès aux dossiers confidentiels du groupe
2013     * passé en paramètre, sinon false.
2014     *
2015     */
2016     public function can_user_access_dossiers_confidentiels_from_groupe($groupe) {
2017     if ((isset($_SESSION['groupe'][$groupe]['confidentiel']) === true
2018     AND $_SESSION['groupe'][$groupe]['confidentiel'] === true)
2019     || array_key_exists("bypass", $_SESSION['groupe']) === true) {
2020     return true;
2021     }
2022     return false;
2023     }
2024    
2025     public function starts_with($haystack, $needle) {
2026     $length = strlen($needle);
2027     return (substr($haystack, 0, $length) === $needle);
2028     }
2029    
2030     public function ends_with($haystack, $needle) {
2031     $length = strlen($needle);
2032     if ($length == 0) {
2033     return true;
2034     }
2035     return (substr($haystack, -$length) === $needle);
2036     }
2037    
2038     /**
2039     * Récupère le type définit dans la base de données des champs d'une table
2040     * entière ou d'un champs si celui-ci est précisé.
2041     *
2042     * Liste des types BDD :
2043     * - int4
2044     * - varchar
2045     * - bool
2046     * - numeric
2047     * - text
2048     *
2049     * @param string $table Nom de la table.
2050     * @param string $column Nom de la colonne (facultatif).
2051     *
2052     * @return array
2053     */
2054     public function get_type_from_db($table, $column = null) {
2055     // Composition de la requête
2056     $sql_select = ' SELECT column_name, udt_name ';
2057     $sql_from = ' FROM information_schema.columns ';
2058     $sql_where = ' WHERE table_schema = \''.str_replace('.', '', DB_PREFIXE).'\' AND table_name = \''.$table.'\' ';
2059     $sql_order = ' ORDER BY ordinal_position ';
2060    
2061     // Si une colonne est précisé
2062     if ($column !== null || $column !== '') {
2063     //
2064     $sql_where .= ' AND column_name = \''.$column.'\' ';
2065     }
2066    
2067     // Requête SQL
2068     $sql = $sql_select.$sql_from.$sql_where.$sql_order;
2069     // Exécution de la requête
2070     $res = $this->db->query($sql);
2071     // Log
2072     $this->addToLog(__METHOD__."() : db->query(\"".$sql."\");", VERBOSE_MODE);
2073     // Erreur BDD
2074     $this->isDatabaseError($res);
2075     //
2076     $list_type = array();
2077     while ($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
2078     $list_type[$row['column_name']] = $row['udt_name'];
2079     }
2080    
2081     // Retourne la liste des codes
2082     return $list_type;
2083     }
2084    
2085 softime 7366
2086     /**
2087     * Cette méthode permet de récupérer le code de division correspondant
2088     * au dossier sur lequel on se trouve.
2089     *
2090     * Méthode identique à la méthode getDivisionFromDossier() de la classe
2091     * om_dbform à l'exception d'un cas de récupération du numéro de dossier par
2092     * la méthode getVal(). Cette exception permet d'utiliser cette méthode dans
2093     * les scripts instanciant seulement la classe utils tel que les *.inc.php.
2094     *
2095     * @param string $dossier Identifiant du dossier d'instruction.
2096     *
2097     * @return string Code de la division du dossier en cours
2098     */
2099     public function get_division_from_dossier_without_inst($dossier = null) {
2100    
2101     // Cette méthode peut être appelée plusieurs fois lors d'une requête.
2102     // Pour éviter de refaire le traitement de recherche de la division
2103     // alors on vérifie si nous ne l'avons pas déjà calculé.
2104     if (isset($this->_division_from_dossier) === true
2105     && $this->_division_from_dossier !== null) {
2106     // Log
2107     $this->addToLog(__METHOD__."() : retour de la valeur déjà calculée - '".$this->_division_from_dossier."'", EXTRA_VERBOSE_MODE);
2108     // On retourne la valeur déjà calculée
2109     return $this->_division_from_dossier;
2110     }
2111    
2112     // Récupère le paramétre retourformulaire présent dans l'URL
2113     $retourformulaire = $this->getParameter("retourformulaire");
2114     // Récupère le paramétre idxformulaire présent dans l'URL
2115     $idxformulaire = $this->getParameter("idxformulaire");
2116    
2117     // Si le dossier n'est pas passé en paramètre de la méthode
2118     if ($dossier === null) {
2119    
2120     // La méthode de récupération du dossier diffère selon le contexte
2121     // du formulaire
2122     if ($retourformulaire === "dossier"
2123     || $retourformulaire === "dossier_instruction"
2124     || $retourformulaire === "dossier_instruction_mes_encours"
2125     || $retourformulaire === "dossier_instruction_tous_encours"
2126     || $retourformulaire === "dossier_instruction_mes_clotures"
2127     || $retourformulaire === "dossier_instruction_tous_clotures"
2128     || $retourformulaire === "dossier_contentieux_mes_infractions"
2129     || $retourformulaire === "dossier_contentieux_toutes_infractions"
2130     || $retourformulaire === "dossier_contentieux_mes_recours"
2131     || $retourformulaire === "dossier_contentieux_tous_recours") {
2132    
2133     // Récupère le numéro du dossier depuis le paramètre
2134     // idxformulaire présent dans l'URL
2135     $dossier = $idxformulaire;
2136     }
2137     //
2138     if ($retourformulaire === "lot") {
2139    
2140     // Requête SQL
2141     $sql = sprintf("SELECT dossier FROM ".DB_PREFIXE."lot WHERE lot = %s", $idxformulaire);
2142     // Récupère l'identifiant du dossier
2143     $dossier = $this->db->getone($sql);
2144     // Log
2145     $this->addToLog(__METHOD__."() : db->query(\"".$dossier."\");", VERBOSE_MODE);
2146     // Erreur BDD
2147     $this->isDatabaseError($dossier);
2148     }
2149     }
2150    
2151     // À cette étape si le dossier n'est toujours pas récupéré alors la
2152     // division ne pourra pas être récupérée
2153     if ($dossier === null) {
2154     //
2155     return null;
2156     }
2157    
2158     // Requête SQL
2159     $sql = sprintf("SELECT division FROM ".DB_PREFIXE."dossier WHERE dossier = '%s'", $dossier);
2160     // Récupère l'identifiant de la division du dossier
2161     $this->_division_from_dossier = $this->db->getOne($sql);
2162     // Log
2163     $this->addToLog(__METHOD__."(): db->getone(\"".$sql."\")", VERBOSE_MODE);
2164     // Erreur BDD
2165     $this->isDatabaseError($this->_division_from_dossier);
2166    
2167     //
2168     return $this->_division_from_dossier;
2169    
2170     }
2171    
2172 softime 8329 /**
2173 softime 8593 *
2174     */
2175     function setDefaultValues() {
2176     $this->addHTMLHeadCss(
2177     array(
2178     "../app/lib/chosen/chosen.min.css",
2179     ),
2180     21
2181     );
2182     $this->addHTMLHeadJs(
2183     array(
2184     "../app/lib/chosen/chosen.jquery.min.js",
2185     ),
2186     21
2187     );
2188     }
2189    
2190     /**
2191 softime 8329 * Permet de définir la configuration des liens du footer.
2192     *
2193     * @return void
2194     */
2195     protected function set_config__footer() {
2196     $footer = array();
2197     // Documentation du site
2198     $footer[] = array(
2199     "title" => __("Documentation"),
2200     "description" => __("Acceder a l'espace documentation de l'application"),
2201 softime 8593 "href" => "http://docs.openmairie.org/?project=openads&version=4.10&format=html&path=manuel_utilisateur",
2202 softime 8329 "target" => "_blank",
2203     "class" => "footer-documentation",
2204     );
2205 softime 7366
2206 softime 8329 // Forum openMairie
2207     $footer[] = array(
2208     "title" => __("Forum"),
2209     "description" => __("Espace d'échange ouvert du projet openMairie"),
2210     "href" => "https://communaute.openmairie.org/c/openads",
2211     "target" => "_blank",
2212     "class" => "footer-forum",
2213     );
2214    
2215     // Portail openMairie
2216     $footer[] = array(
2217     "title" => __("openMairie.org"),
2218     "description" => __("Site officiel du projet openMairie"),
2219     "href" => "http://www.openmairie.org/catalogue/openads",
2220     "target" => "_blank",
2221     "class" => "footer-openmairie",
2222     );
2223     //
2224     $this->config__footer = $footer;
2225     }
2226    
2227     /**
2228     * Surcharge - set_config__menu().
2229     *
2230     * @return void
2231     */
2232     protected function set_config__menu() {
2233     //
2234     $menu = array();
2235    
2236     // {{{ Rubrique AUTORISATION
2237     //
2238     $rubrik = array(
2239     "title" => _("Autorisation"),
2240     "class" => "autorisation",
2241     "right" => "menu_autorisation",
2242     );
2243     //
2244     $links = array();
2245    
2246     $links[] = array(
2247     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation",
2248     "class" => "dossier_autorisation",
2249     "title" => _("Dossiers d'autorisation"),
2250     "right" => array("dossier_autorisation", "dossier_autorisation_tab", ),
2251     "open" => array("index.php|dossier_autorisation[module=tab]", "index.php|dossier_autorisation[module=form]", ),
2252     );
2253    
2254     // Lien vers les dossiers d'autorisations qui ont une demande d'avis
2255     $links[] = array(
2256     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_avis",
2257     "class" => "dossier_autorisation",
2258     "title" => _("Dossiers d'autorisation"),
2259     "right" => array(
2260     "dossier_autorisation_avis",
2261     "dossier_autorisation_avis_tab",
2262     ),
2263     "open" => array("index.php|dossier_autorisation_avis[module=tab]", "index.php|dossier_autorisation[module=form]", ),
2264     );
2265    
2266     //
2267     $rubrik['links'] = $links;
2268     //
2269     $menu[] = $rubrik;
2270     // }}}
2271    
2272     // {{{ Rubrique GUICHET UNIQUE
2273     //
2274     $rubrik = array(
2275     "title" => _("Guichet Unique"),
2276     "class" => "guichet_unique",
2277     "right" => "menu_guichet_unique",
2278     );
2279     //
2280     $links = array();
2281     //
2282     $links[] = array(
2283     "href" => OM_ROUTE_DASHBOARD,
2284     "class" => "tableau-de-bord",
2285     "title" => _("tableau de bord"),
2286     "right" => "menu_guichet_unique_dashboard",
2287     "open" => array("index.php|[module=dashboard]",),
2288     );
2289     //
2290     $links[] = array(
2291     "class" => "category",
2292     "title" => _("nouvelle demande"),
2293     "right" => array(
2294     "demande",
2295     "demande_nouveau_dossier_ajouter",
2296     "demande_dossier_encours_ajouter", "demande_dossier_encours_tab",
2297     "demande_autre_dossier_ajouter", "demande_autre_dossier_tab",
2298     "demande_consulter","demande_tab",
2299     ),
2300     );
2301     $links[] = array(
2302     "title" => "<hr/>",
2303     "right" => array(
2304     "demande",
2305     "demande_dossier_encours_ajouter",
2306     "demande_dossier_encours_ajouter", "demande_dossier_encours_tab",
2307     ),
2308     );
2309     $links[] = array(
2310     "href" => "".OM_ROUTE_FORM."&obj=demande_nouveau_dossier&amp;action=0&amp;advs_id=&amp;tricol=&amp;valide=&amp;retour=tab&amp;new=",
2311     "class" => "nouveau-dossier",
2312     "title" => _("nouveau dossier"),
2313     "right" => array(
2314     "demande",
2315     "demande_nouveau_dossier_ajouter",
2316     ),
2317     "open" => array("index.php|demande_nouveau_dossier[module=form]",),
2318     );
2319     $links[] = array(
2320     "href" => "".OM_ROUTE_TAB."&obj=demande_dossier_encours",
2321     "class" => "dossier-existant",
2322     "title" => _("dossier en cours"),
2323     "right" => array(
2324     "demande",
2325     "demande_dossier_encours_ajouter",
2326     "demande_dossier_encours_tab",
2327     ),
2328     "open" => array("index.php|demande_dossier_encours[module=tab]", "index.php|demande_dossier_encours[module=form]"),
2329     );
2330     $links[] = array(
2331     "href" => "".OM_ROUTE_TAB."&obj=demande_autre_dossier",
2332     "class" => "autre-dossier",
2333     "title" => _("autre dossier"),
2334     "right" => array(
2335     "demande",
2336     "demande_autre_dossier_ajouter",
2337     "demande_autre_dossier_tab",
2338     ),
2339     "open" => array("index.php|demande_autre_dossier[module=tab]", "index.php|demande_autre_dossier[module=form]"),
2340     );
2341     $links[] = array(
2342     "title" => "<hr/>",
2343     "right" => array(
2344     "demande",
2345     "demande_consulter",
2346     "demande_tab"
2347     ),
2348     );
2349     $links[] = array(
2350     "href" => "".OM_ROUTE_TAB."&obj=demande",
2351     "class" => "pdf",
2352     "title" => _("recepisse"),
2353     "right" => array(
2354     "demande",
2355     "demande_consulter",
2356     "demande_tab"
2357     ),
2358     "open" => array("index.php|demande[module=tab]","index.php|demande[module=form]"),
2359     );
2360     $links[] = array(
2361     "title" => "<hr/>",
2362     "right" => array(
2363     "petitionnaire_frequent",
2364     "petitionnaire_frequent_consulter",
2365     "petitionnaire_frequent_tab"
2366     ),
2367     );
2368     $links[] = array(
2369     "href" => "".OM_ROUTE_TAB."&obj=petitionnaire_frequent",
2370     "class" => "petitionnaire_frequent",
2371     "title" => _("petitionnaire_frequent"),
2372     "right" => array(
2373     "petitionnaire_frequent",
2374     "petitionnaire_frequent_consulter",
2375     "petitionnaire_frequent_tab"
2376     ),
2377     "open" => array("index.php|petitionnaire_frequent[module=tab]","index.php|petitionnaire_frequent[module=form]"),
2378     );
2379     //
2380     $links[] = array(
2381     "class" => "category",
2382     "title" => _("affichage reglementaire"),
2383     "right" => array(
2384     "affichage_reglementaire_registre",
2385     "affichage_reglementaire_attestation",
2386     ),
2387     );
2388     $links[] = array(
2389     "title" => "<hr/>",
2390     "right" => array(
2391     "affichage_reglementaire_registre",
2392     "affichage_reglementaire_attestation",
2393     ),
2394     );
2395     $links[] = array(
2396     "href" => "".OM_ROUTE_FORM."&obj=demande_affichage_reglementaire_registre&action=110&idx=0",
2397     "class" => "affichage_reglementaire_registre",
2398     "title" => _("registre"),
2399     "right" => array(
2400     "affichage_reglementaire_registre",
2401     ),
2402     "open" => array("index.php|demande_affichage_reglementaire_registre[module=tab]", "index.php|demande_affichage_reglementaire_registre[module=form]"),
2403     );
2404     $links[] = array(
2405     "href" => "".OM_ROUTE_FORM."&obj=demande_affichage_reglementaire_attestation&action=120&idx=0",
2406     "class" => "affichage_reglementaire_attestation",
2407     "title" => _("attestation"),
2408     "right" => array(
2409     "affichage_reglementaire_attestation",
2410     ),
2411     "open" => array("index.php|demande_affichage_reglementaire_attestation[module=tab]", "index.php|demande_affichage_reglementaire_attestation[module=form]"),
2412     );
2413     //
2414     $rubrik['links'] = $links;
2415     //
2416     $menu[] = $rubrik;
2417     // }}}
2418    
2419     // {{{ Rubrique QUALIFICATION
2420     //
2421     $rubrik = array(
2422     "title" => _("Qualification"),
2423     "class" => "qualification",
2424     "right" => "qualification_menu",
2425     );
2426     //
2427     $links = array();
2428     //
2429     $links[] = array(
2430     "href" => OM_ROUTE_DASHBOARD,
2431     "class" => "tableau-de-bord",
2432     "title" => _("tableau de bord"),
2433     "right" => "menu_qualification_dashboard",
2434     "open" => array("index.php|[module=dashboard]",),
2435     );
2436    
2437     //
2438     $links[] = array(
2439     "href" => "".OM_ROUTE_TAB."&obj=dossier_qualifier_qualificateur",
2440     "class" => "dossier_qualifier_qualificateur",
2441     "title" => _("dossiers a qualifier"),
2442     "right" => array(
2443     "dossier_qualifier_qualificateur",
2444     "dossier_qualifier_qualificateur_tab",
2445     ),
2446     "open" => array("index.php|dossier_qualifier_qualificateur[module=tab]", "index.php|dossier_instruction[module=form]", ),
2447     );
2448    
2449     //
2450     $rubrik['links'] = $links;
2451     //
2452     $menu[] = $rubrik;
2453     // }}}
2454    
2455     // {{{ Rubrique INSTRUCTION
2456     //
2457     $rubrik = array(
2458     "title" => _("instruction"),
2459     "class" => "instruction",
2460     "right" => "menu_instruction",
2461     );
2462     //
2463     $links = array();
2464     //
2465     $links[] = array(
2466     "href" => OM_ROUTE_DASHBOARD,
2467     "class" => "tableau-de-bord",
2468     "title" => _("tableau de bord"),
2469     "right" => "menu_instruction_dashboard",
2470     "open" => array("index.php|[module=dashboard]",),
2471     );
2472     // Catégorie DOSSIERS D'INSTRUCTION
2473     $links[] = array(
2474     "class" => "category",
2475     "title" => _("dossiers d'instruction"),
2476     "right" => array(
2477     "dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab",
2478     "dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab",
2479     "dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab",
2480     "dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab",
2481     "dossier_instruction", "dossier_instruction_tab",
2482     "PC_modificatif", "PC_modificatif_tab",
2483     ),
2484     );
2485     $links[] = array(
2486     "title" => "<hr/>",
2487     "right" => array(
2488     "dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab",
2489     "dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab",
2490     ),
2491     );
2492     //
2493     $links[] = array(
2494     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_mes_encours",
2495     "class" => "dossier_instruction_mes_encours",
2496     "title" => _("mes encours"),
2497     "right" => array("dossier_instruction_mes_encours", "dossier_instruction_mes_encours_tab", ),
2498     "open" => array("index.php|dossier_instruction_mes_encours[module=tab]", "index.php|dossier_instruction_mes_encours[module=form]", ),
2499     );
2500     //
2501     $links[] = array(
2502     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_tous_encours",
2503     "class" => "dossier_instruction_tous_encours",
2504     "title" => _("tous les encours"),
2505     "right" => array("dossier_instruction_tous_encours", "dossier_instruction_tous_encours_tab", ),
2506     "open" => array("index.php|dossier_instruction_tous_encours[module=tab]", "index.php|dossier_instruction_tous_encours[module=form]", ),
2507     );
2508     //
2509     $links[] = array(
2510     "title" => "<hr/>",
2511     "right" => array(
2512     "dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab",
2513     "dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab",
2514     ),
2515     );
2516     //
2517     $links[] = array(
2518     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_mes_clotures",
2519     "class" => "dossier_instruction_mes_clotures",
2520     "title" => _("mes clotures"),
2521     "right" => array("dossier_instruction_mes_clotures", "dossier_instruction_mes_clotures_tab", ),
2522     "open" => array("index.php|dossier_instruction_mes_clotures[module=tab]", "index.php|dossier_instruction_mes_clotures[module=form]", ),
2523     );
2524     //
2525     $links[] = array(
2526     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_tous_clotures",
2527     "class" => "dossier_instruction_tous_clotures",
2528     "title" => _("tous les clotures"),
2529     "right" => array("dossier_instruction_tous_clotures", "dossier_instruction_tous_clotures_tab", ),
2530     "open" => array("index.php|dossier_instruction_tous_clotures[module=tab]", "index.php|dossier_instruction_tous_clotures[module=form]", ),
2531     );
2532     //
2533     $links[] = array(
2534     "title" => "<hr/>",
2535     "right" => array(
2536     "dossier_instruction", "dossier_instruction_tab",
2537     ),
2538     );
2539     //
2540     $links[] = array(
2541     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction",
2542     "class" => "dossier_instruction_recherche",
2543     "title" => _("recherche"),
2544     "right" => array("dossier_instruction", "dossier_instruction_tab", ),
2545     "open" => array("index.php|dossier_instruction[module=tab]", "index.php|dossier_instruction[module=form]", ),
2546     );
2547    
2548     // Catégorier Qualification
2549     $links[] = array(
2550     "class" => "category",
2551     "title" => _("qualification"),
2552     "right" => array("dossier_qualifier", "architecte_frequent",),
2553     );
2554     //
2555     $links[] = array(
2556     "title" => "<hr/>",
2557     "right" => array("dossier_qualifier", "architecte_frequent", ),
2558     );
2559     //
2560     $links[] = array(
2561     "href" => "".OM_ROUTE_TAB."&obj=dossier_qualifier",
2562     "class" => "dossier_qualifier",
2563     "title" => _("dossiers a qualifier"),
2564     "right" => array("dossier_qualifier", "dossier_qualifier_tab", ),
2565     "open" => array("index.php|dossier_qualifier[module=tab]", "index.php|dossier_qualifier[module=form]", ),
2566     );
2567     //
2568     $links[] = array(
2569     "href" => "".OM_ROUTE_TAB."&obj=architecte_frequent",
2570     "class" => "architecte_frequent",
2571     "title" => _("architecte_frequent"),
2572     "right" => array("architecte_frequent", "architecte_frequent_tab", ),
2573     "open" => array("index.php|architecte_frequent[module=tab]", "index.php|architecte_frequent[module=form]", ),
2574     );
2575     // Catégorie CONSULTATIONS
2576     $links[] = array(
2577     "class" => "category",
2578     "title" => _("consultations"),
2579     "right" => array(
2580     "consultation",
2581     "consultation_mes_retours",
2582     "consultation_retours_ma_division",
2583     "consultation_tous_retours",
2584     ),
2585     );
2586     $links[] = array(
2587     "title" => "<hr/>",
2588     "right" => array(
2589     "consultation",
2590     "consultation_mes_retours",
2591     "consultation_retours_ma_division",
2592     "consultation_tous_retours",
2593     ),
2594     );
2595     $links[] = array(
2596     "href" => "".OM_ROUTE_TAB."&obj=consultation_mes_retours",
2597     "class" => "consultation_mes_retours",
2598     "title" => _("Mes retours"),
2599     "right" => array(
2600     "consultation",
2601     "consultation_mes_retours",
2602     "consultation_mes_retours_tab",
2603     ),
2604     "open" => array("index.php|consultation_mes_retours[module=tab]", "index.php|consultation_mes_retours[module=form]", ),
2605     );
2606     $links[] = array(
2607     "href" => "".OM_ROUTE_TAB."&obj=consultation_retours_ma_division",
2608     "class" => "consultation_retours_ma_division",
2609     "title" => _("Retours de ma division"),
2610     "right" => array(
2611     "consultation",
2612     "consultation_retours_ma_division",
2613     "consultation_retours_ma_division_tab",
2614     ),
2615     "open" => array("index.php|consultation_retours_ma_division[module=tab]", "index.php|consultation_retours_ma_division[module=form]", ),
2616     );
2617     $links[] = array(
2618     "href" => "".OM_ROUTE_TAB."&obj=consultation_tous_retours",
2619     "class" => "consultation_tous_retours",
2620     "title" => _("Tous les retours"),
2621     "right" => array(
2622     "consultation_tous_retours",
2623     "consultation_tous_retours_tab",
2624     ),
2625     "open" => array("index.php|consultation_tous_retours[module=tab]", "index.php|consultation_tous_retours[module=form]", ),
2626     );
2627     // Catégorie MESSAGES
2628     $links[] = array(
2629     "class" => "category",
2630     "title" => _("Messages"),
2631     "right" => array(
2632     "messages",
2633     "messages_mes_retours",
2634     "messages_retours_ma_division",
2635     "messages_tous_retours",
2636     ),
2637     );
2638     //
2639     $links[] = array(
2640     "title" => "<hr/>",
2641     "right" => array(
2642     "messages",
2643     "messages_mes_retours",
2644     "messages_retours_ma_division",
2645     "messages_tous_retours",
2646     ),
2647     );
2648     //
2649     $links[] = array(
2650     "href" => "".OM_ROUTE_TAB."&obj=messages_mes_retours",
2651     "class" => "messages_mes_retours",
2652     "title" => _("Mes messages"),
2653     "right" => array(
2654     "messages",
2655     "messages_mes_retours",
2656     "messages_mes_retours_tab",
2657     ),
2658     "open" => array("index.php|messages_mes_retours[module=tab]", "index.php|messages_mes_retours[module=form]", ),
2659     );
2660     //
2661     $links[] = array(
2662     "href" => "".OM_ROUTE_TAB."&obj=messages_retours_ma_division",
2663     "class" => "messages_retours_ma_division",
2664     "title" => _("Messages de ma division"),
2665     "right" => array(
2666     "messages",
2667     "messages_retours_ma_division",
2668     "messages_retours_ma_division_tab",
2669     ),
2670     "open" => array("index.php|messages_retours_ma_division[module=tab]", "index.php|messages_retours_ma_division[module=form]", ),
2671     );
2672     //
2673     $links[] = array(
2674     "href" => "".OM_ROUTE_TAB."&obj=messages_tous_retours",
2675     "class" => "messages_tous_retours",
2676     "title" => _("Tous les messages"),
2677     "right" => array(
2678     "messages",
2679     "messages_tous_retours",
2680     "messages_tous_retours_tab",
2681     ),
2682     "open" => array("index.php|messages_tous_retours[module=tab]", "index.php|messages_tous_retours[module=form]", ),
2683     );
2684     // Catégorie COMMISSIONS
2685     $links[] = array(
2686     "class" => "category",
2687     "title" => _("commissions"),
2688     "right" => array(
2689     "commission_mes_retours",
2690     "commission_mes_retours_tab",
2691     "commission_retours_ma_division",
2692     "commission_retours_ma_division_tab",
2693     "commission_tous_retours",
2694     "commission_tous_retours_tab",
2695     ),
2696     );
2697     $links[] = array(
2698     "title" => "<hr/>",
2699     "right" => array(
2700     "commission_mes_retours",
2701     "commission_mes_retours_tab",
2702     "commission_retours_ma_division",
2703     "commission_retours_ma_division_tab",
2704     "commission_tous_retours",
2705     "commission_tous_retours_tab",
2706     ),
2707     );
2708     $links[] = array(
2709     "href" => "".OM_ROUTE_TAB."&obj=commission_mes_retours",
2710     "class" => "commission_mes_retours",
2711     "title" => _("Mes retours"),
2712     "right" => array(
2713     "commission_mes_retours",
2714     "commission_mes_retours_tab",
2715     ),
2716     "open" => array("index.php|commission_mes_retours[module=tab]", "index.php|commission_mes_retours[module=form]", ),
2717     );
2718     $links[] = array(
2719     "href" => "".OM_ROUTE_TAB."&obj=commission_retours_ma_division",
2720     "class" => "commission_retours_ma_division",
2721     "title" => _("Retours de ma division"),
2722     "right" => array(
2723     "commission_retours_ma_division",
2724     "commission_retours_ma_division_tab",
2725     ),
2726     "open" => array("index.php|commission_retours_ma_division[module=tab]", "index.php|commission_retours_ma_division[module=form]", ),
2727     );
2728     $links[] = array(
2729     "href" => "".OM_ROUTE_TAB."&obj=commission_tous_retours",
2730     "class" => "commission_tous_retours",
2731     "title" => _("Tous les retours"),
2732     "right" => array(
2733     "commission_tous_retours",
2734     "commission_tous_retours_tab",
2735     ),
2736     "open" => array("index.php|commission_tous_retours[module=tab]", "index.php|commission_tous_retours[module=form]", ),
2737     );
2738    
2739     //
2740     $rubrik['links'] = $links;
2741     //
2742     $menu[] = $rubrik;
2743     // }}}
2744    
2745     // {{{ Rubrique Contentieux
2746     //
2747     $rubrik = array(
2748     "title" => _("Contentieux"),
2749     "class" => "contentieux",
2750     "right" => "menu_contentieux",
2751     );
2752     //
2753     $links = array();
2754     //
2755     $links[] = array(
2756     "href" => OM_ROUTE_DASHBOARD,
2757     "class" => "tableau-de-bord",
2758     "title" => _("tableau de bord"),
2759     "right" => "menu_contentieux_dashboard",
2760     "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]", ),
2761     );
2762     // Catégorie Nouvelle demande
2763     $links[] = array(
2764     "class" => "category",
2765     "title" => _("Nouvelle demande"),
2766     "right" => array(
2767     "demande_nouveau_dossier_contentieux_ajouter",
2768     ),
2769     );
2770     $links[] = array(
2771     "href" => "".OM_ROUTE_FORM."&obj=demande_nouveau_dossier_contentieux&amp;action=0&amp;advs_id=&amp;tricol=&amp;valide=&amp;retour=tab&amp;new=",
2772     "class" => "nouveau-dossier",
2773     "title" => _("nouveau dossier"),
2774     "right" => array(
2775     "demande_nouveau_dossier_contentieux_ajouter",
2776     ),
2777     "open" => array("index.php|demande_nouveau_dossier_contentieux[module=form]",),
2778     );
2779     // Catégorie Recours
2780     $links[] = array(
2781     "class" => "category",
2782     "title" => _("Recours"),
2783     "right" => array(
2784     "dossier_contentieux_mes_recours", "dossier_contentieux_mes_recours_tab",
2785     "dossier_contentieux_tous_recours", "dossier_contentieux_tous_recours_tab",
2786     ),
2787     );
2788     //
2789     $links[] = array(
2790     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_mes_recours",
2791     "class" => "dossier_contentieux_mes_recours",
2792     "title" => _("Mes recours"),
2793     "right" => array("dossier_contentieux_mes_recours", "dossier_contentieux_mes_recours_tab", ),
2794     "open" => array("index.php|dossier_contentieux_mes_recours[module=tab]", "index.php|dossier_contentieux_mes_recours[module=form]", ),
2795     );
2796     $links[] = array(
2797     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_tous_recours",
2798     "class" => "dossier_contentieux_tous_recours",
2799     "title" => _("Tous les recours"),
2800     "right" => array("dossier_contentieux_tous_recours", "dossier_contentieux_tous_recours_tab", ),
2801     "open" => array("index.php|dossier_contentieux_tous_recours[module=tab]", "index.php|dossier_contentieux_tous_recours[module=form]", ),
2802     );
2803     // Catégorie Infractions
2804     $links[] = array(
2805     "class" => "category",
2806     "title" => _("Infractions"),
2807     "right" => array(
2808     "dossier_contentieux_mes_infractions", "dossier_contentieux_mes_infractions_tab",
2809     "dossier_contentieux_toutes_infractions", "dossier_contentieux_toutes_infractions_tab",
2810     ),
2811     );
2812     //
2813     $links[] = array(
2814     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_mes_infractions",
2815     "class" => "dossier_contentieux_mes_infractions",
2816     "title" => _("Mes infractions"),
2817     "right" => array("dossier_contentieux_mes_infractions", "dossier_contentieux_mes_infractions_tab", ),
2818     "open" => array("index.php|dossier_contentieux_mes_infractions[module=tab]", "index.php|dossier_contentieux_mes_infractions[module=form]", ),
2819     );
2820     //
2821     $links[] = array(
2822     "href" => "".OM_ROUTE_TAB."&obj=dossier_contentieux_toutes_infractions",
2823     "class" => "dossier_contentieux_toutes_infractions",
2824     "title" => _("Toutes les infractions"),
2825     "right" => array("dossier_contentieux_toutes_infractions", "dossier_contentieux_toutes_infractions_tab", ),
2826     "open" => array("index.php|dossier_contentieux_toutes_infractions[module=tab]", "index.php|dossier_contentieux_toutes_infractions[module=form]", ),
2827     );
2828     // Catégorie MESSAGES
2829     $links[] = array(
2830     "class" => "category",
2831     "title" => _("Messages"),
2832     "right" => array(
2833     "messages_contentieux",
2834     "messages_contentieux_mes_retours",
2835     "messages_contentieux_retours_ma_division",
2836     "messages_contentieux_tous_retours",
2837     ),
2838     );
2839     //
2840     $links[] = array(
2841     "title" => "<hr/>",
2842     "right" => array(
2843     "messages_contentieux",
2844     "messages_contentieux_mes_retours",
2845     "messages_contentieux_retours_ma_division",
2846     "messages_contentieux_tous_retours",
2847     ),
2848     );
2849     //
2850     $links[] = array(
2851     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_mes_retours",
2852     "class" => "messages_contentieux_mes_retours",
2853     "title" => _("Mes messages"),
2854     "right" => array(
2855     "messages_contentieux",
2856     "messages_contentieux_mes_retours",
2857     "messages_contentieux_mes_retours_tab",
2858     ),
2859     "open" => array("index.php|messages_contentieux_mes_retours[module=tab]", "index.php|messages_contentieux_mes_retours[module=form]", ),
2860     );
2861     //
2862     $links[] = array(
2863     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_retours_ma_division",
2864     "class" => "messages_contentieux_retours_ma_division",
2865     "title" => _("Messages de ma division"),
2866     "right" => array(
2867     "messages_contentieux",
2868     "messages_contentieux_retours_ma_division",
2869     "messages_contentieux_retours_ma_division_tab",
2870     ),
2871     "open" => array("index.php|messages_contentieux_retours_ma_division[module=tab]", "index.php|messages_contentieux_retours_ma_division[module=form]", ),
2872     );
2873     //
2874     $links[] = array(
2875     "href" => "".OM_ROUTE_TAB."&obj=messages_contentieux_tous_retours",
2876     "class" => "messages_contentieux_tous_retours",
2877     "title" => _("Tous les messages"),
2878     "right" => array(
2879     "messages_contentieux",
2880     "messages_contentieux_tous_retours",
2881     "messages_contentieux_tous_retours_tab",
2882     ),
2883     "open" => array("index.php|messages_contentieux_tous_retours[module=tab]", "index.php|messages_contentieux_tous_retours[module=form]", ),
2884     );
2885    
2886    
2887     //
2888     $rubrik['links'] = $links;
2889     //
2890     $menu[] = $rubrik;
2891     // }}}
2892    
2893     // {{{ Rubrique SUIVI
2894     //
2895     $rubrik = array(
2896     "title" => _("Suivi"),
2897     "class" => "suivi",
2898     "right" => "menu_suivi",
2899     );
2900     //
2901     $links = array();
2902     //
2903     $links[] = array(
2904     "href" => OM_ROUTE_DASHBOARD,
2905     "class" => "tableau-de-bord",
2906     "title" => _("tableau de bord"),
2907     "right" => "menu_suivi_dashboard",
2908     "open" => array("index.php|[module=dashboard]",),
2909     );
2910     $links[] = array(
2911     "class" => "category",
2912     "title" => _("suivi des pieces"),
2913     "right" => array(
2914     "instruction_suivi_retours_de_consultation", "instruction_suivi_mise_a_jour_des_dates",
2915     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_bordereaux",
2916     "instruction_suivi_retours_de_consultation_consulter", "instruction_suivi_mise_a_jour_des_dates_consulter",
2917     "instruction_suivi_envoi_lettre_rar_consulter", "instruction_suivi_bordereaux_consulter",
2918     ),
2919     );
2920     //
2921     $links[] = array(
2922     "title" => "<hr/>",
2923     "right" => array(
2924     "instruction_suivi_retours_de_consultation", "instruction_suivi_mise_a_jour_des_dates",
2925     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_bordereaux",
2926     "instruction_suivi_retours_de_consultation_consulter", "instruction_suivi_mise_a_jour_des_dates_consulter",
2927     "instruction_suivi_envoi_lettre_rar_consulter", "instruction_suivi_bordereaux_consulter",
2928     ),
2929     );
2930     //
2931     $links[] = array(
2932     "title" => "<hr/>",
2933     "right" => array(
2934     "instruction_suivi_mise_a_jour_des_dates", "instruction_suivi_mise_a_jour_des_dates_consulter",
2935     ),
2936     );
2937     //
2938     $links[] = array(
2939     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_mise_a_jour_des_dates&action=170&idx=0",
2940     "class" => "suivi_mise_a_jour_des_dates",
2941     "title" => _("Mise a jour des dates"),
2942     "right" => array("instruction_suivi_mise_a_jour_des_dates", "instruction_suivi_mise_a_jour_des_dates_consulter", ),
2943     "open" => array("index.php|instruction_suivi_mise_a_jour_des_dates[module=tab]", "index.php|instruction_suivi_mise_a_jour_des_dates[module=form]"),
2944     );
2945     //
2946     $links[] = array(
2947     "title" => "<hr/>",
2948     "right" => array(
2949     "instruction_suivi_envoi_lettre_rar", "instruction_suivi_envoi_lettre_rar_consulter",
2950     ),
2951     );
2952     //
2953     $links[] = array(
2954     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_envoi_lettre_rar&action=160&idx=0",
2955     "class" => "envoi_lettre_rar",
2956     "title" => _("envoi lettre RAR"),
2957     "right" => array("instruction_suivi_envoi_lettre_rar", "instruction_suivi_envoi_lettre_rar_consulter", ),
2958     "open" => array("index.php|instruction_suivi_envoi_lettre_rar[module=tab]", "index.php|instruction_suivi_envoi_lettre_rar[module=form]"),
2959     );
2960     //
2961     $links[] = array(
2962     "title" => "<hr/>",
2963     "right" => array(
2964     "instruction_suivi_bordereaux", "instruction_suivi_bordereaux_consulter",
2965     ),
2966     );
2967     //
2968     $links[] = array(
2969     "href" => "".OM_ROUTE_FORM."&obj=instruction_suivi_bordereaux&action=150&idx=0",
2970     "class" => "bordereaux",
2971     "title" => _("Bordereaux"),
2972     "right" => array("instruction_suivi_bordereaux", "instruction_suivi_bordereaux_consulter", ),
2973     "open" => array("index.php|instruction_suivi_bordereaux[module=tab]", "index.php|instruction_suivi_bordereaux[module=form]"),
2974     );
2975     //
2976     $links[] = array(
2977     "href" => "".OM_ROUTE_FORM."&obj=bordereau_envoi_maire&action=190&idx=0",
2978     "class" => "bordereau_envoi_maire",
2979     "title" => _("Bordereau d'envoi au maire"),
2980     "right" => array("instruction_bordereau_envoi_maire","bordereau_envoi_maire"),
2981     "open" => array("index.php|bordereau_envoi_maire[module=form]",),
2982     );
2983     //
2984     $links[] = array(
2985     "class" => "category",
2986     "title" => _("Demandes d'avis"),
2987     "right" => array(
2988     "consultation_suivi_mise_a_jour_des_dates",
2989     "consultation_suivi_retours_de_consultation",
2990     ),
2991     );
2992     //
2993     $links[] = array(
2994     "href" => "".OM_ROUTE_FORM."&obj=consultation&idx=0&action=110",
2995     "class" => "demandes_avis_mise_a_jour_des_dates",
2996     "title" => _("Mise a jour des dates"),
2997     "right" => array("consultation_suivi_mise_a_jour_des_dates", ),
2998     "open" => array("index.php|consultation[module=form][action=110]"),
2999     );
3000     //
3001     $links[] = array(
3002     "href" => "".OM_ROUTE_FORM."&obj=consultation&idx=0&action=120",
3003     "class" => "consultation-retour",
3004     "title" => _("retours de consultation"),
3005     "right" => array("consultation_suivi_retours_de_consultation", ),
3006     "open" => array("index.php|consultation[module=form][action=120]", "index.php|consultation[module=form][action=100]", ),
3007     );
3008     // Catégorie COMMISSIONS
3009     $links[] = array(
3010     "class" => "category",
3011     "title" => _("commissions"),
3012     "right" => array(
3013     "commission",
3014     "commission_tab",
3015     "commission_demandes_passage",
3016     "commission_demandes_passage_tab",
3017     ),
3018     );
3019     //
3020     $links[] = array(
3021     "title" => "<hr/>",
3022     "right" => array(
3023     "commission",
3024     "commission_tab",
3025     "commission_demandes_passage",
3026     "commission_demandes_passage_tab",
3027     ),
3028     );
3029     //
3030     $links[] = array(
3031     "href" => "".OM_ROUTE_TAB."&obj=commission",
3032     "class" => "commissions",
3033     "title" => _("gestion"),
3034     "right" => array(
3035     "commission",
3036     ),
3037     "open" => array("index.php|commission[module=tab]", "index.php|commission[module=form]", ),
3038     );
3039     //
3040     $links[] = array(
3041     "href" => "".OM_ROUTE_TAB."&obj=commission_demandes_passage",
3042     "class" => "commissions-demande-passage",
3043     "title" => _("demandes"),
3044     "right" => array(
3045     "commission",
3046     "commission_demandes_passage",
3047     ),
3048     "open" => array("index.php|commission_demandes_passage[module=tab]", "index.php|commission_demandes_passage[module=form]", ),
3049     );
3050     //
3051     $rubrik['links'] = $links;
3052     //
3053     $menu[] = $rubrik;
3054     // }}}
3055    
3056     // {{{ Rubrique DEMANDES D'AVIS
3057     //
3058     $rubrik = array(
3059     "title" => _("Demandes d'avis"),
3060     "class" => "demande_avis",
3061     "right" => "menu_demande_avis",
3062     );
3063     //
3064     $links = array();
3065     //
3066     $links[] = array(
3067     "href" => OM_ROUTE_DASHBOARD,
3068     "class" => "tableau-de-bord",
3069     "title" => _("tableau de bord"),
3070     "right" => "menu_demande_avis_dashboard",
3071     "open" => array("index.php|[module=dashboard]",),
3072     );
3073     //
3074     $links[] = array(
3075     "title" => "<hr/>",
3076     "right" => array(
3077     "demande_avis_encours", "demande_avis_encours_tab",
3078     "demande_avis_passee", "demande_avis_passee_tab",
3079     "demande_avis", "demande_avis_tab",
3080     ),
3081     );
3082     //
3083     $links[] = array(
3084     "href" => "".OM_ROUTE_TAB."&obj=demande_avis_encours",
3085     "class" => "demande_avis_encours",
3086     "title" => _("Demandes en cours"),
3087     "right" => array("demande_avis_encours", "demande_avis_encours_tab", ),
3088     "open" => array("index.php|demande_avis_encours[module=tab]", "index.php|demande_avis_encours[module=form]", ),
3089     );
3090    
3091     $links[] = array(
3092     "href" => "".OM_ROUTE_TAB."&obj=demande_avis_passee",
3093     "class" => "demande_avis_passee",
3094     "title" => _("Demandes passees"),
3095     "right" => array("demande_avis_passee", "demande_avis_passee_tab", ),
3096     "open" => array("index.php|demande_avis_passee[module=tab]", "index.php|demande_avis_passee[module=form]", ),
3097     );
3098    
3099     $links[] = array(
3100     "href" => "".OM_ROUTE_TAB."&obj=demande_avis",
3101     "class" => "demande_avis",
3102     "title" => _("Exports"),
3103     "right" => array("demande_avis", "demande_avis_tab", ),
3104     "open" => array("index.php|demande_avis[module=tab]", "index.php|demande_avis[module=form]", ),
3105     );
3106    
3107     //
3108     $rubrik['links'] = $links;
3109     //
3110     $menu[] = $rubrik;
3111     // }}}
3112    
3113    
3114     // Commentaire de la rubrique EXPORT qui n'est pas prévue d'être opérationnelle
3115     // dans cette version
3116     // {{{ Rubrique EXPORT
3117     //
3118     $rubrik = array(
3119     "title" => _("export / import"),
3120     "class" => "edition",
3121     "right" => "menu_export",
3122     );
3123     //
3124     $links = array();
3125    
3126     //
3127     $links[] = array(
3128     "href" => "".OM_ROUTE_FORM."&obj=sitadel&action=6&idx=0",
3129     "class" => "sitadel",
3130     "title" => _("export sitadel"),
3131     "right" => "export_sitadel",
3132     "open" => "index.php|sitadel[module=form]",
3133     );
3134     //
3135     $links[] = array(
3136     "href" => "../app/versement_archives.php",
3137     "class" => "versement_archives",
3138     "title" => _("versement aux archives"),
3139     "right" => "versement_archives",
3140     "open" => "versement_archives.php|",
3141     );
3142     //
3143     $links[] = array(
3144     "href" => "../app/reqmo_pilot.php",
3145     "class" => "reqmo",
3146     "title" => _("statistiques a la demande"),
3147     "right" => "reqmo_pilot",
3148     "open" => "reqmo_pilot.php|",
3149     );
3150     //
3151     $rubrik['links'] = $links;
3152     //
3153     $menu[] = $rubrik;
3154     // }}}
3155    
3156    
3157     // {{{ Rubrique PARAMETRAGE
3158     //
3159     $rubrik = array(
3160     "title" => _("parametrage dossiers"),
3161     "class" => "parametrage-dossier",
3162     "right" => "menu_parametrage",
3163     );
3164     //
3165     $links = array();
3166     //
3167     $links[] = array(
3168     "class" => "category",
3169     "title" => _("dossiers"),
3170     "right" => array(
3171     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3172     "dossier_autorisation_type_detaille",
3173     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3174     "dossier_instruction_type_tab", "cerfa", "cerfa_tab",
3175     ),
3176     );
3177     //
3178     $links[] = array(
3179     "title" => "<hr/>",
3180     "right" => array(
3181     "cerfa", "cerfa_tab",
3182     ),
3183     );
3184     //
3185     $links[] = array(
3186     "href" => "".OM_ROUTE_TAB."&obj=cerfa",
3187     "class" => "cerfa",
3188     "title" => _("cerfa"),
3189     "right" => array("cerfa", "cerfa_tab", ),
3190     "open" => array("index.php|cerfa[module=tab]", "index.php|cerfa[module=form]", ),
3191     );
3192     //
3193     $links[] = array(
3194     "title" => "<hr/>",
3195     "right" => array(
3196     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3197     "dossier_autorisation_type_detaille",
3198     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3199     "dossier_instruction_type_tab",
3200     ),
3201     );
3202     //
3203     $links[] = array(
3204     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_type",
3205     "class" => "dossier_autorisation_type",
3206     "title" => _("type DA"),
3207     "right" => array("dossier_autorisation_type", "dossier_autorisation_type_tab", ),
3208     "open" => array("index.php|dossier_autorisation_type[module=tab]", "index.php|dossier_autorisation_type[module=form]", ),
3209     );
3210     //
3211     $links[] = array(
3212     "href" => "".OM_ROUTE_TAB."&obj=dossier_autorisation_type_detaille",
3213     "class" => "dossier_autorisation_type_detaille",
3214     "title" => _("type DA detaille"),
3215     "right" => array("dossier_autorisation_type_detaille", "dossier_autorisation_type_detaille_tab", ),
3216     "open" => array("index.php|dossier_autorisation_type_detaille[module=tab]", "index.php|dossier_autorisation_type_detaille[module=form]", ),
3217     );
3218     //
3219     $links[] = array(
3220     "href" => "".OM_ROUTE_TAB."&obj=dossier_instruction_type",
3221     "class" => "dossier_instruction_type",
3222     "title" => _("type DI"),
3223     "right" => array("dossier_instruction_type", "dossier_instruction_type_tab", ),
3224     "open" => array("index.php|dossier_instruction_type[module=tab]", "index.php|dossier_instruction_type[module=form]", ),
3225     );
3226     //
3227     $links[] = array(
3228     "title" => "<hr/>",
3229     "right" => array(
3230     "contrainte", "contrainte_tab",
3231     "contrainte_souscategorie", "contrainte_souscategorie_tab",
3232     "contrainte_categorie", "contrainte_categorie_tab"
3233     ),
3234     );
3235     //
3236     $links[] = array(
3237     "href" => "".OM_ROUTE_TAB."&obj=contrainte",
3238     "class" => "contrainte",
3239     "title" => _("contrainte"),
3240     "right" => array("contrainte", "contrainte_tab", ),
3241     "open" => array(
3242     "index.php|contrainte[module=tab]",
3243     "index.php|contrainte[module=form][action=0]",
3244     "index.php|contrainte[module=form][action=1]",
3245     "index.php|contrainte[module=form][action=2]",
3246     "index.php|contrainte[module=form][action=3]",
3247     ),
3248     );
3249     //
3250     $links[] = array(
3251     "class" => "category",
3252     "title" => _("demandes"),
3253     "right" => array(
3254     "demande_type",
3255     "demande_type_tab", "demande_nature", "demande_nature_tab",
3256     ),
3257     );
3258     //
3259     $links[] = array(
3260     "title" => "<hr/>",
3261     "right" => array(
3262     "demande_type",
3263     "demande_type_tab", "demande_nature", "demande_nature_tab",
3264     ),
3265     );
3266     //
3267     $links[] = array(
3268     "href" => "".OM_ROUTE_TAB."&obj=demande_nature",
3269     "class" => "demande_nature",
3270     "title" => _("nature"),
3271     "right" => array("demande_nature", "demande_nature_tab", ),
3272     "open" => array("index.php|demande_nature[module=tab]", "index.php|demande_nature[module=form]", ),
3273     );
3274     //
3275     $links[] = array(
3276     "href" => "".OM_ROUTE_TAB."&obj=demande_type",
3277     "class" => "demande_type",
3278     "title" => _("type"),
3279     "right" => array("demande_type", "demande_type_tab",),
3280     "open" => array("index.php|demande_type[module=tab]", "index.php|demande_type[module=form]", ),
3281     );
3282     //
3283     $links[] = array(
3284     "class" => "category",
3285     "title" => _("workflows"),
3286     "right" => array(
3287     "workflows",
3288     "action", "action_tab", "etat",
3289     "etat_tab", "evenement", "evenement_tab", "bible", "bible_tab", "avis_decision",
3290     "avis_decision_tab", "avis_consultation", "avis_consultation_tab",
3291     ),
3292     );
3293     //
3294     $links[] = array(
3295     "title" => "<hr/>",
3296     "right" => array(
3297     "workflows",
3298     "action", "action_tab", "etat",
3299     "etat_tab", "evenement", "evenement_tab", "bible", "bible_tab", "avis_decision",
3300     "avis_decision_tab", "avis_consultation", "avis_consultation_tab",
3301     ),
3302     );
3303     //
3304     $links[] = array(
3305     "href" => "../app/workflows.php",
3306     "class" => "workflows",
3307     "title" => _("workflows"),
3308     "right" => array("workflows", ),
3309     "open" => array("workflows.php|", ),
3310     );
3311     //
3312     $links[] = array(
3313     "title" => "<hr/>",
3314     "right" => array(
3315     "evenement", "evenement_tab",
3316     ),
3317     );
3318     //
3319     $links[] = array(
3320     "href" => "".OM_ROUTE_TAB."&obj=evenement",
3321     "class" => "evenement",
3322     "title" => _("evenement"),
3323     "right" => array("evenement", "evenement_tab", ),
3324     "open" => array("index.php|evenement[module=tab]", "index.php|evenement[module=form]", ),
3325     );
3326     //
3327     $links[] = array(
3328     "title" => "<hr/>",
3329     "right" => array(
3330     "action", "action_tab", "etat",
3331     "etat_tab", "avis_decision",
3332     "avis_decision_tab",
3333     ),
3334     );
3335     //
3336     $links[] = array(
3337     "href" => "".OM_ROUTE_TAB."&obj=etat",
3338     "class" => "workflow-etat",
3339     "title" => _("etat"),
3340     "right" => array("etat", "etat_tab", ),
3341     "open" => array("index.php|etat[module=tab]", "index.php|etat[module=form]", ),
3342     );
3343     //
3344     $links[] = array(
3345     "href" => "".OM_ROUTE_TAB."&obj=avis_decision",
3346     "class" => "avis_decision",
3347     "title" => _("avis decision"),
3348     "right" => array("avis_decision", "avis_decision_tab", ),
3349     "open" => array("index.php|avis_decision[module=tab]", "index.php|avis_decision[module=form]", ),
3350     );
3351     //
3352     $links[] = array(
3353     "href" => "".OM_ROUTE_TAB."&obj=action",
3354     "class" => "action",
3355     "title" => _("action"),
3356     "right" => array("action", "action_tab", ),
3357     "open" => array("index.php|action[module=tab]", "index.php|action[module=form]", ),
3358     );
3359     //
3360     $links[] = array(
3361     "title" => "<hr/>",
3362     "right" => array(
3363     "bible", "bible_tab",
3364     ),
3365     );
3366     //
3367     $links[] = array(
3368     "href" => "".OM_ROUTE_TAB."&obj=bible",
3369     "class" => "bible",
3370     "title" => _("bible"),
3371     "right" => array("bible", "bible_tab", ),
3372     "open" => array("index.php|bible[module=tab]", "index.php|bible[module=form]", ),
3373     );
3374     //
3375     $links[] = array(
3376     "class" => "category",
3377     "title" => _("editions"),
3378     "right" => array(
3379     "om_etat", "om_etat_tab", "om_sousetat", "om_sousetat_tab",
3380     "om_lettretype", "om_lettretype_tab", "om_requete", "om_requete_tab",
3381     "om_logo", "om_logo_tab",
3382     ),
3383     );
3384     //
3385     $links[] = array(
3386     "title" => "<hr/>",
3387     "right" => array(
3388     "om_etat", "om_etat_tab", "om_lettretype", "om_lettretype_tab",
3389     ),
3390     );
3391     //
3392     $links[] = array(
3393     "href" => "".OM_ROUTE_TAB."&obj=om_etat",
3394     "class" => "om_etat",
3395     "title" => _("om_etat"),
3396     "right" => array("om_etat", "om_etat_tab", ),
3397     "open" => array("index.php|om_etat[module=tab]", "index.php|om_etat[module=form]", ),
3398     );
3399     //
3400     $links[] = array(
3401     "href" => "".OM_ROUTE_TAB."&obj=om_lettretype",
3402     "class" => "om_lettretype",
3403     "title" => _("om_lettretype"),
3404     "right" => array("om_lettretype", "om_lettretype_tab"),
3405     "open" => array("index.php|om_lettretype[module=tab]", "index.php|om_lettretype[module=form]", ),
3406     );
3407     //
3408     $links[] = array(
3409     "title" => "<hr/>",
3410     "right" => array(
3411     "om_logo", "om_logo_tab",
3412     ),
3413     );
3414     //
3415     $links[] = array(
3416     "href" => "".OM_ROUTE_TAB."&obj=om_logo",
3417     "class" => "om_logo",
3418     "title" => _("om_logo"),
3419     "right" => array("om_logo", "om_logo_tab", ),
3420     "open" => array("index.php|om_logo[module=tab]", "index.php|om_logo[module=form]", ),
3421     );
3422     //
3423     $rubrik['links'] = $links;
3424     //
3425     $menu[] = $rubrik;
3426     // }}}
3427    
3428     // {{{ Rubrique PARAMETRAGE
3429     //
3430     $rubrik = array(
3431     "title" => _("parametrage"),
3432     "class" => "parametrage",
3433     "right" => "menu_parametrage",
3434     );
3435     //
3436     $links = array();
3437     //
3438     $links[] = array(
3439     "href" => "".OM_ROUTE_TAB."&obj=civilite",
3440     "class" => "civilite",
3441     "title" => _("civilite"),
3442     "right" => array("civilite", "civilite_tab", ),
3443     "open" => array("index.php|civilite[module=tab]", "index.php|civilite[module=form]", ),
3444     );
3445     //
3446     $links[] = array(
3447     "href" => "".OM_ROUTE_TAB."&obj=arrondissement",
3448     "class" => "arrondissement",
3449     "title" => _("arrondissement"),
3450     "right" => array("arrondissement", "arrondissement_tab", ),
3451     "open" => array("index.php|arrondissement[module=tab]", "index.php|arrondissement[module=form]", ),
3452     );
3453     //
3454     $links[] = array(
3455     "href" => "".OM_ROUTE_TAB."&obj=quartier",
3456     "class" => "quartier",
3457     "title" => _("quartier"),
3458     "right" => array("quartier", "quartier_tab", ),
3459     "open" => array("index.php|quartier[module=tab]", "index.php|quartier[module=form]", ),
3460     );
3461     //
3462     $links[] = array(
3463     "class" => "category",
3464     "title" => _("Organisation"),
3465     "right" => array(
3466     "direction", "direction_tab", "division", "division_tab", "instructeur_qualite",
3467     "instructeur_qualite_tab", "instructeur", "instructeur_tab", "groupe",
3468     "groupe_tab", "genre", "genre_tab", "signataire_arrete", "signataire_arrete_tab",
3469     "taxe_amenagement_tab", "taxe_amenagement",
3470     ),
3471     );
3472     $links[] = array(
3473     "title" => "<hr/>",
3474     "right" => array(
3475     "direction", "direction_tab", "division", "division_tab", "instructeur_qualite",
3476     "instructeur_qualite_tab", "instructeur", "instructeur_tab", "groupe",
3477     "groupe_tab", "genre", "genre_tab", "signataire_arrete", "signataire_arrete_tab",
3478     "taxe_amenagement_tab", "taxe_amenagement",
3479     ),
3480     );
3481     //
3482     $links[] = array(
3483     "href" => "".OM_ROUTE_TAB."&obj=genre",
3484     "class" => "genre",
3485     "title" => _("genre"),
3486     "right" => array("genre", "genre_tab", ),
3487     "open" => array("index.php|genre[module=tab]", "index.php|genre[module=form]", ),
3488     );
3489     //
3490     $links[] = array(
3491     "href" => "".OM_ROUTE_TAB."&obj=groupe",
3492     "class" => "groupe",
3493     "title" => _("groupe"),
3494     "right" => array("groupe", "groupe_tab", ),
3495     "open" => array("index.php|groupe[module=tab]", "index.php|groupe[module=form]", ),
3496     );
3497     //
3498     $links[] = array(
3499     "href" => "".OM_ROUTE_TAB."&obj=direction",
3500     "class" => "direction",
3501     "title" => _("direction"),
3502     "right" => array("direction", "direction_tab", ),
3503     "open" => array("index.php|direction[module=tab]", "index.php|direction[module=form]", ),
3504     );
3505     //
3506     $links[] = array(
3507     "href" => "".OM_ROUTE_TAB."&obj=division",
3508     "class" => "division",
3509     "title" => _("division"),
3510     "right" => array("division", "division_tab", ),
3511     "open" => array("index.php|division[module=tab]", "index.php|division[module=form]", ),
3512     );
3513     //
3514     $links[] = array(
3515     "href" => "".OM_ROUTE_TAB."&obj=instructeur_qualite",
3516     "class" => "instructeur_qualite",
3517     "title" => _("instructeur_qualite"),
3518     "right" => array("instructeur_qualite", "instructeur_qualite_tab", ),
3519     "open" => array("index.php|instructeur_qualite[module=tab]", "index.php|instructeur_qualite[module=form]", ),
3520     );
3521     //
3522     $links[] = array(
3523     "href" => "".OM_ROUTE_TAB."&obj=instructeur",
3524     "class" => "instructeur",
3525     "title" => _("instructeur"),
3526     "right" => array("instructeur", "instructeur_tab", ),
3527     "open" => array("index.php|instructeur[module=tab]", "index.php|instructeur[module=form]", ),
3528     );
3529     //
3530     $links[] = array(
3531     "href" => "".OM_ROUTE_TAB."&obj=signataire_arrete",
3532     "class" => "signataire_arrete",
3533     "title" => _("signataire arrete"),
3534     "right" => array("signataire_arrete", "signataire_arrete", ),
3535     "open" => array("index.php|signataire_arrete[module=tab]", "index.php|signataire_arrete[module=form]", ),
3536     );
3537     //
3538     $links[] = array(
3539     "href" => "".OM_ROUTE_TAB."&obj=taxe_amenagement",
3540     "class" => "taxe_amenagement",
3541     "title" => _("taxes"),
3542     "right" => array("taxe_amenagement", "taxe_amenagement_tab", ),
3543     "open" => array("index.php|taxe_amenagement[module=tab]", "index.php|taxe_amenagement[module=form]", ),
3544     );
3545     //
3546     $links[] = array(
3547     "class" => "category",
3548     "title" => _("gestion des commissions"),
3549     "right" => array(
3550     "commission_type", "commission_type_tab",
3551     ),
3552     );
3553     //
3554     $links[] = array(
3555     "title" => "<hr/>",
3556     "right" => array(
3557     "commission_type", "commission_type_tab",
3558     ),
3559     );
3560     //
3561     $links[] = array(
3562     "href" => "".OM_ROUTE_TAB."&obj=commission_type",
3563     "class" => "commission-type",
3564     "title" => _("commission_type"),
3565     "right" => array("commission_type", "commission_type_tab", ),
3566     "open" => array("index.php|commission_type[module=tab]", "index.php|commission_type[module=form]", ),
3567     );
3568     //
3569     $links[] = array(
3570     "class" => "category",
3571     "title" => _("gestion des consultations"),
3572     "right" => array(
3573     "avis_consultation", "avis_consultation_tab", "service", "service_tab",
3574     "service_categorie", "service_categorie_tab",
3575     "lien_service_service_categorie", "lien_service_service_categorie_tab",
3576     ),
3577     );
3578     //
3579     $links[] = array(
3580     "title" => "<hr/>",
3581     "right" => array(
3582     "avis_consultation", "avis_consultation_tab", "service", "service_tab",
3583     "service_categorie", "service_categorie_tab",
3584     "lien_service_service_categorie", "lien_service_service_categorie_tab",
3585     ),
3586     );
3587     //
3588     $links[] = array(
3589     "href" => "".OM_ROUTE_TAB."&obj=avis_consultation",
3590     "class" => "avis_consultation",
3591     "title" => _("avis consultation"),
3592     "right" => array("avis_consultation", "avis_consultation_tab", ),
3593     "open" => array("index.php|avis_consultation[module=tab]", "index.php|avis_consultation[module=form]", ),
3594     );
3595     //
3596     $links[] = array(
3597     "href" => "".OM_ROUTE_TAB."&obj=service",
3598     "class" => "service",
3599     "title" => _("service"),
3600     "right" => array("service", "service_tab", ),
3601     "open" => array("index.php|service[module=tab]", "index.php|service[module=form]", ),
3602     );
3603     $links[] = array(
3604     "href" => "".OM_ROUTE_TAB."&obj=service_categorie",
3605     "class" => "service_categorie",
3606     "title" => _("thematique des services"),
3607     "right" => array("service_categorie", "service_categorie_tab", ),
3608     "open" => array("index.php|service_categorie[module=tab]", "index.php|service_categorie[module=form]", ),
3609     );
3610     //
3611     $links[] = array(
3612     "class" => "category",
3613     "title" => _("Gestion des dossiers"),
3614     "right" => array(
3615     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3616     "dossier_autorisation_type_detaille",
3617     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3618     "dossier_instruction_type_tab",
3619     "autorite_competente", "autorite_competente_tab",
3620     "affectation_automatique", "affectation_automatique_tab",
3621     ),
3622     );
3623     //
3624     $links[] = array(
3625     "title" => "<hr/>",
3626     "right" => array(
3627     "dossier_autorisation_type", "dossier_autorisation_type_tab",
3628     "dossier_autorisation_type_detaille",
3629     "dossier_autorisation_type_detaille_tab", "dossier_instruction_type",
3630     "dossier_instruction_type_tab",
3631     "autorite_competente", "autorite_competente_tab",
3632     "affectation_automatique", "affectation_automatique_tab",
3633    
3634     ),
3635     );
3636     //
3637     $links[] = array(
3638     "href" => "".OM_ROUTE_TAB."&obj=etat_dossier_autorisation",
3639     "class" => "etat_dossier_autorisation",
3640     "title" => _("etat dossiers autorisations"),
3641     "right" => array("etat_dossier_autorisation", "etat_dossier_autorisation_tab", ),
3642     "open" => array("index.php|etat_dossier_autorisation[module=tab]", "index.php|etat_dossier_autorisation[module=form]", ),
3643     );
3644     //
3645     $links[] = array(
3646     "href" => "".OM_ROUTE_TAB."&obj=affectation_automatique",
3647     "class" => "affectation_automatique",
3648     "title" => _("affectation automatique"),
3649     "right" => array("affectation_automatique", "affectation_automatique_tab", ),
3650     "open" => array("index.php|affectation_automatique[module=tab]", "index.php|affectation_automatique[module=form]", ),
3651     );
3652     //
3653     $links[] = array(
3654     "href" => "".OM_ROUTE_TAB."&obj=autorite_competente",
3655     "class" => "autorite_competente",
3656     "title" => _("autorite")." "._("competente"),
3657     "right" => array("autorite_competente", "autorite_competente_tab", ),
3658     "open" => array("index.php|autorite_competente[module=tab]", "index.php|autorite_competente[module=form]", ),
3659     );
3660     //
3661     $links[] = array(
3662     "href" => "".OM_ROUTE_TAB."&obj=phase",
3663     "class" => "phase",
3664     "title" => _("phase"),
3665     "right" => array("phase", "phase_tab", ),
3666     "open" => array("index.php|phase[module=tab]", "index.php|phase[module=form]", ),
3667     );
3668    
3669     //Gestion des pièces
3670     $links[] = array(
3671     "class" => "category",
3672     "title" => _("Gestion des pièces"),
3673     "right" => array(
3674     "document_numerise_type_categorie", "document_numerise_type_categorie_tab",
3675     "document_numerise_type",
3676     "document_numerise_type_tab", "document_numerise_traitement_metadonnees",
3677     "document_numerise_traitement_metadonnees_executer",
3678     ),
3679     );
3680     //
3681     $links[] = array(
3682     "title" => "<hr/>",
3683     "right" => array(
3684     "document_numerise_type_categorie", "document_numerise_type_categorie_tab",
3685     "document_numerise_type",
3686     "document_numerise_type_tab", "document_numerise_traitement_metadonnees",
3687     "document_numerise_traitement_metadonnees_executer",
3688     ),
3689     );
3690     //
3691     $links[] = array(
3692     "href" => "".OM_ROUTE_TAB."&obj=document_numerise_type_categorie",
3693     "class" => "document_numerise_type_categorie",
3694     "title" => _("Catégorie des pièces"),
3695     "right" => array(
3696     "document_numerise_type_categorie",
3697     "document_numerise_type_categorie_tab",
3698     ),
3699     "open" => array(
3700     "index.php|document_numerise_type_categorie[module=tab]",
3701     "index.php|document_numerise_type_categorie[module=form]",
3702     ),
3703     );
3704     //
3705     $links[] = array(
3706     "href" => "".OM_ROUTE_TAB."&obj=document_numerise_type",
3707     "class" => "document_numerise_type",
3708     "title" => _("Type des pièces"),
3709     "right" => array(
3710     "document_numerise_type",
3711     "document_numerise_type_tab",
3712     ),
3713     "open" => array(
3714     "index.php|document_numerise_type[module=tab]",
3715     "index.php|document_numerise_type[module=form][action=0]",
3716     "index.php|document_numerise_type[module=form][action=1]",
3717     "index.php|document_numerise_type[module=form][action=2]",
3718     "index.php|document_numerise_type[module=form][action=3]",
3719     ),
3720     );
3721     //
3722     $links[] = array(
3723     "href" => "".OM_ROUTE_FORM."&obj=document_numerise_traitement_metadonnees&action=100&idx=0",
3724     "class" => "document_numerise_traitement_metadonnees",
3725     "title" => _("Mise à jour des métadonnées"),
3726     "description" => _("Mettre à jour les métadonnées de tous les documents numérisés."),
3727     "right" => array(
3728     "document_numerise_traitement_metadonnees",
3729     "document_numerise_traitement_metadonnees_executer",
3730     ),
3731     "open" => array("index.php|document_numerise_traitement_metadonnees[module=form]", ),
3732     );
3733    
3734     // Gestion des contentieux
3735     $links[] = array(
3736     "class" => "category",
3737     "title" => _("Gestion des contentieux"),
3738     "right" => array(
3739     "objet_recours", "objet_recours_tab", "moyen_souleve", "moyen_souleve_tab",
3740     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3741     ),
3742     );
3743     //
3744     $links[] = array(
3745     "title" => "<hr/>",
3746     "right" => array(
3747     "objet_recours", "objet_recours_tab", "moyen_souleve", "moyen_souleve_tab",
3748     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3749     ),
3750     );
3751     //
3752     $links[] = array(
3753     "href" => "".OM_ROUTE_TAB."&obj=objet_recours",
3754     "class" => "objet_recours",
3755     "title" => _("objet_recours"),
3756     "right" => array(
3757     "objet_recours", "objet_recours_tab",
3758     ),
3759     "open" => array(
3760     "index.php|objet_recours[module=tab]", "index.php|objet_recours[module=form]",
3761     ),
3762     );
3763     //
3764     $links[] = array(
3765     "href" => "".OM_ROUTE_TAB."&obj=moyen_souleve",
3766     "class" => "moyen_souleve",
3767     "title" => _("moyen_souleve"),
3768     "right" => array(
3769     "moyen_souleve", "moyen_souleve_tab",
3770     ),
3771     "open" => array(
3772     "index.php|moyen_souleve[module=tab]", "index.php|moyen_souleve[module=form]",
3773     ),
3774     );
3775     //
3776     $links[] = array(
3777     "href" => "".OM_ROUTE_TAB."&obj=moyen_retenu_juge",
3778     "class" => "moyen_retenu_juge",
3779     "title" => _("moyen_retenu_juge"),
3780     "right" => array(
3781     "moyen_retenu_juge", "moyen_retenu_juge_tab",
3782     ),
3783     "open" => array(
3784     "index.php|moyen_retenu_juge[module=tab]", "index.php|moyen_retenu_juge[module=form]",
3785     ),
3786     );
3787    
3788     //
3789     $rubrik['links'] = $links;
3790     //
3791     $menu[] = $rubrik;
3792     // }}}
3793    
3794     // {{{ Rubrique ADMINISTRATION
3795     //
3796     $rubrik = array(
3797     "title" => _("administration"),
3798     "class" => "administration",
3799     "right" => "menu_administration",
3800     );
3801     //
3802     $links = array();
3803     //
3804     $links[] = array(
3805     "href" => "".OM_ROUTE_TAB."&obj=om_collectivite",
3806     "class" => "collectivite",
3807     "title" => _("om_collectivite"),
3808     "right" => array("om_collectivite", "om_collectivite_tab", ),
3809     "open" => array("index.php|om_collectivite[module=tab]", "index.php|om_collectivite[module=form]", ),
3810     );
3811     //
3812     $links[] = array(
3813     "href" => "".OM_ROUTE_TAB."&obj=om_parametre",
3814     "class" => "parametre",
3815     "title" => _("om_parametre"),
3816     "right" => array("om_parametre", "om_parametre_tab", ),
3817     "open" => array("index.php|om_parametre[module=tab]", "index.php|om_parametre[module=form]", ),
3818     );
3819     //
3820     $links[] = array(
3821     "class" => "category",
3822     "title" => _("gestion des utilisateurs"),
3823     "right" => array(
3824     "om_utilisateur", "om_utilisateur_tab", "om_profil", "om_profil_tab",
3825     "om_droit", "om_droit_tab", "directory",
3826     ),
3827     );
3828     //
3829     $links[] = array(
3830     "title" => "<hr/>",
3831     "right" => array(
3832     "om_utilisateur", "om_utilisateur_tab", "om_profil", "om_profil_tab",
3833     "om_droit", "om_droit_tab",
3834     ),
3835     );
3836     //
3837     $links[] = array(
3838     "href" => "".OM_ROUTE_TAB."&obj=om_profil",
3839     "class" => "profil",
3840     "title" => _("om_profil"),
3841     "right" => array("om_profil", "om_profil_tab", ),
3842     "open" => array("index.php|om_profil[module=tab]", "index.php|om_profil[module=form]", ),
3843     );
3844     //
3845     $links[] = array(
3846     "href" => "".OM_ROUTE_TAB."&obj=om_droit",
3847     "class" => "droit",
3848     "title" => _("om_droit"),
3849     "right" => array("om_droit", "om_droit_tab", ),
3850     "open" => array("index.php|om_droit[module=tab]", "index.php|om_droit[module=form]", ),
3851     );
3852     //
3853     $links[] = array(
3854     "href" => "".OM_ROUTE_TAB."&obj=om_utilisateur",
3855     "class" => "utilisateur",
3856     "title" => _("om_utilisateur"),
3857     "right" => array("om_utilisateur", "om_utilisateur_tab", ),
3858     "open" => array(
3859     "index.php|om_utilisateur[module=tab]",
3860     "index.php|om_utilisateur[module=form][action=0]",
3861     "index.php|om_utilisateur[module=form][action=1]",
3862     "index.php|om_utilisateur[module=form][action=2]",
3863     "index.php|om_utilisateur[module=form][action=3]",
3864     ),
3865     );
3866     //
3867     $links[] = array(
3868     "title" => "<hr/>",
3869     "right" => array("om_utilisateur", "om_utilisateur_synchroniser", ),
3870     "parameters" => array("isDirectoryOptionEnabled" => true, ),
3871     );
3872     //
3873     $links[] = array(
3874     "href" => "".OM_ROUTE_FORM."&obj=om_utilisateur&idx=0&action=11",
3875     "class" => "annuaire",
3876     "title" => _("annuaire"),
3877     "right" => array("om_utilisateur", "om_utilisateur_synchroniser", ),
3878     "open" => array("index.php|om_utilisateur[module=form][action=11]", ),
3879     "parameters" => array("isDirectoryOptionEnabled" => true, ),
3880     );
3881     //
3882     $links[] = array(
3883     "class" => "category",
3884     "title" => _("tableaux de bord"),
3885     "right" => array(
3886     "om_widget", "om_widget_tab", "om_dashboard",
3887     ),
3888     );
3889     //
3890     $links[] = array(
3891     "title" => "<hr/>",
3892     "right" => array(
3893     "om_widget", "om_widget_tab", "om_dashboard",
3894     ),
3895     );
3896     //
3897     $links[] = array(
3898     "href" => "".OM_ROUTE_TAB."&obj=om_widget",
3899     "class" => "om_widget",
3900     "title" => _("om_widget"),
3901     "right" => array("om_widget", "om_widget_tab", ),
3902     "open" => array("index.php|om_widget[module=tab]", "index.php|om_widget[module=form]", ),
3903     );
3904     //
3905     $links[] = array(
3906     "href" => "".OM_ROUTE_FORM."&obj=om_dashboard&amp;idx=0&amp;action=4",
3907     "class" => "om_dashboard",
3908     "title" => _("composition"),
3909     "right" => array("om_dashboard", ),
3910     "open" => array("index.php|om_dashboard[module=form][action=4]", ),
3911     );
3912     //
3913     $links[] = array(
3914     "class" => "category",
3915     "title" => _("sig"),
3916     "right" => array(
3917     "om_sig_map", "om_sig_map_tab", "om_sig_flux", "om_sig_flux_tab", "om_sig_extent", "om_sig_extent_tab",
3918     ),
3919     "parameters" => array("option_localisation" => "sig_interne", ),
3920     );
3921     //
3922     $links[] = array(
3923     "title" => "<hr/>",
3924     "right" => array(
3925     "om_sig_map", "om_sig_map_tab", "om_sig_flux", "om_sig_flux_tab", "om_sig_extent", "om_sig_extent_tab",
3926     ),
3927     "parameters" => array("option_localisation" => "sig_interne", ),
3928     );
3929     //
3930     $links[] = array(
3931     "href" => "".OM_ROUTE_TAB."&obj=om_sig_extent",
3932     "class" => "om_sig_extent",
3933     "title" => _("om_sig_extent"),
3934     "right" => array("om_sig_extent", "om_sig_extent_tab", ),
3935     "open" => array("index.php|om_sig_extent[module=tab]", "index.php|om_sig_extent[module=form]", ),
3936     "parameters" => array("option_localisation" => "sig_interne", ),
3937     );
3938     //
3939     $links[] = array(
3940     "href" => "".OM_ROUTE_TAB."&obj=om_sig_map",
3941     "class" => "om_sig_map",
3942     "title" => _("om_sig_map"),
3943     "right" => array("om_sig_map", "om_sig_map_tab", ),
3944     "open" => array("index.php|om_sig_map[module=tab]", "index.php|om_sig_map[module=form]", ),
3945     "parameters" => array("option_localisation" => "sig_interne", ),
3946     );
3947     //
3948     $links[] = array(
3949     "href" => "".OM_ROUTE_TAB."&obj=om_sig_flux",
3950     "class" => "om_sig_flux",
3951     "title" => _("om_sig_flux"),
3952     "right" => array("om_sig_flux", "om_sig_flux_tab", ),
3953     "open" => array("index.php|om_sig_flux[module=tab]", "index.php|om_sig_flux[module=form]", ),
3954     "parameters" => array("option_localisation" => "sig_interne", ),
3955     );
3956     //
3957     $links[] = array(
3958     "class" => "category",
3959     "title" => _("options avancees"),
3960     "right" => array("import", "gen", "om_requete", "om_requete_tab",
3961     "om_sousetat", "om_sousetat_tab",),
3962     );
3963     //
3964     $links[] = array(
3965     "title" => "<hr/>",
3966     "right" => array(
3967     "interface_referentiel_erp",
3968     ),
3969     );
3970     //
3971     $links[] = array(
3972     "href" => "../app/settings.php?controlpanel=interface_referentiel_erp",
3973     "class" => "interface_referentiel_erp",
3974     "title" => _("interface_referentiel_erp"),
3975     "right" => array("interface_referentiel_erp", ),
3976     "open" => array("settings.php|[controlpanel=interface_referentiel_erp]", ),
3977     );
3978     //
3979     $links[] = array(
3980     "title" => "<hr/>",
3981     "right" => array(
3982     "om_sousetat", "om_sousetat_tab",
3983     ),
3984     );
3985     //
3986     $links[] = array(
3987     "href" => "".OM_ROUTE_TAB."&obj=om_sousetat",
3988     "class" => "om_sousetat",
3989     "title" => _("om_sousetat"),
3990     "right" => array("om_sousetat", "om_sousetat_tab", ),
3991     "open" => array("index.php|om_sousetat[module=tab]", "index.php|om_sousetat[module=form]", ),
3992     );
3993     //
3994     $links[] = array(
3995     "title" => "<hr/>",
3996     "right" => array("om_requete", "om_requete_tab", ),
3997     );
3998     //
3999     $links[] = array(
4000     "href" => "".OM_ROUTE_TAB."&obj=om_requete",
4001     "class" => "om_requete",
4002     "title" => _("om_requete"),
4003     "right" => array("om_requete", "om_requete_tab", ),
4004     "open" => array("index.php|om_requete[module=tab]", "index.php|om_requete[module=form]", ),
4005     );
4006     //
4007     $links[] = array(
4008     "title" => "<hr/>",
4009     "right" => array("import", ),
4010     );
4011     //
4012     $links[] = array(
4013     "href" => OM_ROUTE_MODULE_IMPORT,
4014     "class" => "import",
4015     "title" => _("Import"),
4016     "right" => array("import", ),
4017     "open" => array("import.php|", ),
4018     );
4019     //
4020     $links[] = array(
4021     "href" => "../app/import_specific.php",
4022     "class" => "import_specific",
4023     "title" => _("Import specifique"),
4024     "right" => array("import", ),
4025     "open" => array("import_specific.php|", ),
4026     );
4027     //
4028     $links[] = array(
4029     "title" => "<hr/>",
4030     "right" => array("gen", ),
4031     );
4032     //
4033     $links[] = array(
4034     "title" => _("Generateur"),
4035     "href" => OM_ROUTE_MODULE_GEN,
4036     "class" => "generator",
4037     "right" => array("gen", ),
4038     "open" => array(
4039     "gen.php|","genauto.php|", "gensup.php|", "genfull.php|",
4040     "genetat.php|", "gensousetat.php|", "genlettretype.php|",
4041     "genimport.php|",
4042     ),
4043     );
4044     //
4045     $links[] = array(
4046     "href" => "".OM_ROUTE_FORM."&obj=contrainte&action=100&idx=0",
4047     "class" => "contrainte",
4048     "title" => _("synchronisation des contraintes"),
4049     "right" => array("contrainte", "contrainte_synchronisation", ),
4050     "open" => array("index.php|contrainte[module=form][action=100]", ),
4051     "parameters" => array(
4052     "option_sig" => "sig_externe",
4053     ),
4054     );
4055     //
4056     $links[] = array(
4057     "href" => "".OM_ROUTE_FORM."&obj=dossier_instruction&action=126&idx=0",
4058     "class" => "geocoder",
4059     "title" => _("Géolocalisation des dossiers"),
4060     "right" => array("dossier_instruction_geocoder", ),
4061     "open" => array("index.php|dossier_instruction[module=form][action=126]", ),
4062     "parameters" => array(
4063     "option_sig" => "sig_externe",
4064     ),
4065     );
4066     //
4067     $rubrik['links'] = $links;
4068     //
4069     $menu[] = $rubrik;
4070     $this->config__menu = $menu;
4071     }
4072 mbroquet 3730 }
4073    
4074 softime 7996

Properties

Name Value
svn:keywords "Id"

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26