From d243e1058890c7572352ab9a9396e9065805b8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Mar 2023 09:36:58 +0100 Subject: [PATCH 1/2] add doc --- htdocs/core/modules/DolibarrModules.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e0d7a8741a5..6c43c945b65 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -248,10 +248,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $export_icon; + /** + * @var array export enabled + */ + public $export_enabled; public $export_permission; public $export_fields_array; public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid' public $export_entities_array; + public $export_examplevalues_array; public $export_help_array; public $export_special_array; // special or computed field public $export_dependencies_array; @@ -273,9 +278,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $import_label; public $import_icon; - public $import_entities_array; public $import_tables_array; + public $import_tables_creator_array; public $import_fields_array; public $import_fieldshidden_array; public $import_convertvalue_array; From 2403599b08e620814e99c3031a55b12c0318652c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Mar 2023 09:43:59 +0100 Subject: [PATCH 2/2] use isModEnabled --- htdocs/core/modules/modCategorie.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 4a8680502ae..d4900e18540 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -142,16 +142,16 @@ class modCategorie extends DolibarrModules if (isModEnabled("societe")) { $typeexample .= ($typeexample ? " / " : "")."4=Contact"; } - if (!empty($conf->bank->enabled)) { + if (isModEnabled('bank')) { $typeexample .= ($typeexample ? " / " : "")."5=Bank account"; } if (isModEnabled('project')) { $typeexample .= ($typeexample ? " / " : "")."6=Project"; } - if (!empty($conf->user->enabled)) { + if (isModEnabled('user')) { $typeexample .= ($typeexample ? " / " : "")."7=User"; } - if (!empty($conf->bank->enabled)) { + if (isModEnabled('bank')) { $typeexample .= ($typeexample ? " / " : "")."8=Bank line"; } if (isModEnabled('stock')) { @@ -411,7 +411,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7]; $this->export_label[$r] = 'CatUsersList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->user->enabled)'; + $this->export_enabled[$r] = 'isModEnabled("user")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); @@ -594,7 +594,7 @@ class modCategorie extends DolibarrModules } // 7 Users - if (!empty($conf->user->enabled)) { + if (isModEnabled('user')) { $r++; $this->import_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7]; $this->import_label[$r] = "CatUsersLinks"; // Translation key