From b70dfd0d54aa0dbd9cdce09b6c3cf99712e78a9b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 11:16:24 +0200 Subject: [PATCH 1/2] New: possibility to defined a tab for all entities in module descriptor --- ChangeLog | 1 + htdocs/core/modules/DolibarrModules.class.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ed418b08f5c..4a1e6ca3576 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ For developers: - New: Function yn can show a visual checkbox. - New: Introduced select2 jquery plugin. - New: Possibility to add javascript in main login page with "getLoginPageOptions" hook +- New: possibility to defined a tab for all entities in module descriptor WARNING: Following changes may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 472e260cfa6..89d65a7d5d7 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1000,7 +1000,18 @@ print $sql; $i=0; foreach ($this->tabs as $key => $value) { - if ($value) + if (is_array($value) && count($value) == 0) continue; // Discard empty arrays + + $entity=$conf->entity; + $newvalue = $value; + + if (is_array($value)) + { + $newvalue = $value['data']; + if (isset($value['entity'])) $entity = $value['entity']; + } + + if ($newvalue) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."const ("; $sql.= "name"; From e9aa98fb9db2e1070f23d4cd3149b3dd1ee49414 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 11:40:59 +0200 Subject: [PATCH 2/2] Fix: travis --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 3178fd67620..d9b60bcd1bc 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -512,7 +512,7 @@ class FormProjets * * @param string $htmlname HTML name * @param int $preselected Preselected - * @param int $shwoempty Add an empty line + * @param int $showempty Add an empty line * @param int $useshortlabel Use short label * @return int|string The HTML select list of element or '' if nothing or -1 if KO */