From 763f3cd5189c0dbc9b18e9da15788da71773a4c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Nov 2018 18:10:38 +0100 Subject: [PATCH] Debug modulebuilder --- htdocs/core/lib/functions.lib.php | 14 ++++---------- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- .../emailcollector/class/emailcollector.class.php | 4 ++-- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e7c0cfe2f7e..27af555c3d2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6816,21 +6816,15 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id function verifCond($strRights) { global $user,$conf,$langs; - global $action,$leftmenu; + global $leftmenu; global $rights; // To export to dol_eval function //print $strRights."
\n"; $rights = true; if ($strRights != '') { - $action = preg_replace('/[a-zA-Z0-9_') - //$tab_rights = explode('&&', $strRights); - //$i = 0; - //while (($i < count($tab_rights)) && ($rights == true)) { $str = 'if(!(' . $strRights . ')) { $rights = false; }'; - dol_eval($str); - // $i++; - //} + dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition } return $rights; } @@ -6847,8 +6841,8 @@ function verifCond($strRights) function dol_eval($s, $returnvalue=0, $hideerrors=1) { // Only global variables can be changed by eval function and returned to caller - global $db, $langs, $user, $conf; - global $mainmenu, $leftmenu; + global $db, $langs, $user, $conf, $website, $websitepage; + global $action, $mainmenu, $leftmenu; global $rights; global $object; global $mysoc; diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 1e85f1ef833..23a60d7f675 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -41,7 +41,7 @@ foreach($object->fields as $key => $val) if (abs($val['visible']) != 1) continue; if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field - var_dump($val['enabled']); + print ''; print '