From d6205440b90e1e60ba0e3ebd296e6eb90bb31e1d Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Sun, 16 Dec 2007 20:37:51 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20nom=20de=20classe=20et=20constante=20=E9?= =?UTF-8?q?tait=20diff=E9rent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/fichinter.php | 5 +++-- htdocs/fichinter/fiche.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index ae7d9f177b2..737f528e41c 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -176,6 +176,7 @@ if ($handle) if (eregi('^(mod_.*)\.php$',$file,$reg)) { $file = $reg[1]; + $className = substr($file,4); require_once($dir.$file.".php"); @@ -190,13 +191,13 @@ if ($handle) print '<td nowrap="nowrap">'.$module->getExample()."</td>\n"; print '<td align="center">'; - if ($conf->global->FICHEINTER_ADDON == $file) + if ($conf->global->FICHEINTER_ADDON == $className) { print img_tick($langs->trans("Activated")); } else { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$className.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; } print '</td>'; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 193da24b407..d891c2cccfe 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -32,9 +32,9 @@ require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/fichinter/modules_fichinter.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/project.class.php"); -if (defined("FICHEINTER_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/".FICHEINTER_ADDON.".php")) +if (defined("FICHEINTER_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".FICHEINTER_ADDON.".php")) { - require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/".FICHEINTER_ADDON.".php"); + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".FICHEINTER_ADDON.".php"); } $langs->load("companies"); @@ -369,7 +369,7 @@ if ($_GET["action"] == 'create') $result=$ficheinter->fetch($fichinterid); $obj = $conf->global->FICHEINTER_ADDON; - $file = $obj.".php"; + $obj = "mod_".$obj; $modFicheinter = new $obj; $numpr = $modFicheinter->getNextValue($societe,$ficheinter); -- GitLab