From 4a1a6ed6f299e14d9e1a3558617520477e8af4ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Apr 2008 19:31:20 +0000 Subject: [PATCH] Fix: Pb with auguria menu --- htdocs/core/menubase.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php index 972b5b93065..5595ddd2802 100644 --- a/htdocs/core/menubase.class.php +++ b/htdocs/core/menubase.class.php @@ -435,9 +435,12 @@ class Menubase } } + + // \TODO Avoid call for each + function verifConstraint($rowid, $mainmenu = "", $leftmenu = "") { - global $user, $conf, $user; + global $user, $conf, $lang; global $constraint; // To export to dol_eval function include_once(DOL_DOCUMENT_ROOT.'/lib/admin.lib.php'); // Because later some eval try to run dynamic call to dolibarr_get_const @@ -447,6 +450,7 @@ class Menubase $sql.= " FROM " . MAIN_DB_PREFIX . "menu_constraint as c, " . MAIN_DB_PREFIX . "menu_const as mc"; $sql.= " WHERE mc.fk_constraint = c.rowid AND (mc.user = 0 OR mc.user = 2) AND mc.fk_menu = '" . $rowid . "'"; + dolibarr_syslog("Menubase::verifConstraint sql=".$sql); $result = $this->db->query($sql); if ($result) { @@ -517,7 +521,8 @@ class Menubase } /** - * brief type_user 0=Internal,1=External,2=All + * \brief Load tabMenu array + * \param type_user 0=Internal,1=External,2=All */ function menutopCharger($type_user, $mainmenu, $menu_handler) { @@ -545,6 +550,7 @@ class Menubase // Init tabMenu array $objm = $this->db->fetch_object($resql); + //print "x".$objm->rowid; if ($this->verifConstraint($objm->rowid)) { // Define class @@ -612,7 +618,7 @@ class Menubase function dol_eval($s) { // To get and return to caller - global $leftmenu, $leftmenuConstraint, $constraint, $rights, $user; + global $leftmenu, $leftmenuConstraint, $constraint, $rights, $user, $conf; //print $s."
\n"; eval($s);