From ba146a535ec16c577b386fcc535fe96bc5ae0518 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Sep 2007 05:44:44 +0000 Subject: [PATCH] =?UTF-8?q?D=E9but=20ajout=20mode=20debugage=20=E0=20l'=E9?= =?UTF-8?q?cran?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/conf/conf.class.php | 4 ++++ htdocs/fichinter/fiche.php | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index 65243b4da28..754226e196e 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -333,6 +333,10 @@ class Conf * Modification de quelques variable de conf en fonction des Constantes */ + // Debug Mode + $this->use_debug_mode=0; + if ($this->global->MAIN_ENABLE_DEBUG_MODE) $this->use_debug_mode=$this->global->MAIN_ENABLE_DEBUG_MODE; + // outils systemes if (! $this->global->SYSTEMTOOLS_MYSQLDUMP) $this->global->SYSTEMTOOLS_MYSQLDUMP="mysqldump"; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 0dea2c23bf5..b2ef06e828f 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -318,7 +318,7 @@ if ($_GET["action"] == 'create') } print_titre($langs->trans("AddIntervention")); - + if (! $conf->global->FICHEINTER_ADDON) { dolibarr_print_error($db,$langs->trans("Error")." ".$langs->trans("Error_FICHEINTER_ADDON_NotDefined")); @@ -438,6 +438,18 @@ elseif ($_GET["id"] > 0) exit; } $fichinter->fetch_client(); + + // Debug mode + // TODO: créer une fonction debug générique + if ($conf->use_debug_mode) + { + $debug = '
'; + $debug.= 'Mode Debugage
'; + $debug.= 'Module intervention: lire='.$user->rights->ficheinter->lire.', creer='.$user->rights->ficheinter->creer; + $debug.= ', supprimer='.$user->rights->ficheinter->supprimer; + $debug.= '
'; + print $debug; + } if ($mesg) print $mesg."
";