From cfa10bb8ba27e31f33dbdfac43a1fbab4ee965ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Apr 2023 20:40:07 +0200 Subject: [PATCH] use isModEnabled --- .../modulebuilder/template/core/boxes/mymodulewidget1.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 7ea4b553e71..ace98374461 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2023 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software: you can redistribute it and/or modify @@ -101,8 +101,10 @@ class mymodulewidget1 extends ModeleBoxes $this->param = $param; - //$this->enabled = $conf->global->FEATURES_LEVEL > 0; // Condition when module is enabled or not - //$this->hidden = ! ($user->rights->mymodule->myobject->read); // Condition when module is visible by user (test on permission) + // Condition when module is enabled or not + // $this->enabled = getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0; + // Condition when module is visible by user (test on permission) + // $this->hidden = !$user->hasRight('mymodule', 'myobject', 'read'); } /**