diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php
index 3e0c2378742..4b5ccbb133e 100644
--- a/htdocs/admin/ecm.php
+++ b/htdocs/admin/ecm.php
@@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
+$action = GETPOST('action', 'aZ09');
+
if (!$user->admin) {
accessforbidden();
}
@@ -41,6 +43,7 @@ if (!$user->admin) {
*/
// set
+$reg = array();
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
@@ -67,6 +70,8 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
* View
*/
+$form = new Form($db);
+
$help_url = '';
llxHeader('', $langs->trans("ECMSetup"), $help_url);
@@ -81,26 +86,21 @@ print dol_get_fiche_head($head, 'ecm', '', -1, '');
print '
';
print '';
print '| '.$langs->trans("Description").' | ';
-print ' | ';
-print ''.$langs->trans("Value").' | '."\n";
+print ''.$langs->trans("Value").' | '."\n";
print '
';
-$form = new Form($db);
-
// Mail required for members
print '';
print '| '.$langs->trans("ECMAutoTree").' | ';
-print ' | ';
-
-print '';
+print ' | ';
if ($conf->use_javascript_ajax) {
- print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
+ print ajax_constantonoff('ECM_AUTO_TREE_HIDEN', null, null, 1);
} else {
- if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').'';
- } elseif (!empty($conf->global->USER_MAIL_REQUIRED)) {
- print ''.img_picto($langs->trans("Enabled"), 'on').'';
+ if (empty($conf->global->ECM_AUTO_TREE_HIDEN)) {
+ print ''.img_picto($langs->trans("Enabled"), 'on').'';
+ } else {
+ print ''.img_picto($langs->trans("Disabled"), 'off').'';
}
}
print ' |
';
diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php
index e7840505e8f..2a9b9a766a3 100644
--- a/htdocs/core/lib/ecm.lib.php
+++ b/htdocs/core/lib/ecm.lib.php
@@ -54,7 +54,7 @@ function ecm_prepare_dasboard_head($object)
$head[$h][2] = 'index';
$h++;
- if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
+ if (empty($conf->global->ECM_AUTO_TREE_HIDEN)) {
$head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php';
$head[$h][1] = $langs->trans("ECMSectionsAuto").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
$head[$h][2] = 'index_auto';
diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php
index 1ea7530be53..09556b43cd8 100644
--- a/htdocs/core/modules/modECM.class.php
+++ b/htdocs/core/modules/modECM.class.php
@@ -74,12 +74,6 @@ class modECM extends DolibarrModules
$this->const = array(); // List of parameters
$r = 0;
- $this->const[$r][0] = "ECM_AUTO_TREE_ENABLED";
- $this->const[$r][1] = "chaine";
- $this->const[$r][2] = "1";
- $this->const[$r][3] = 'Auto tree is enabled by default';
- $this->const[$r][4] = 0;
-
// Boxes
$this->boxes = array(); // List of boxes
$r = 0;
@@ -182,7 +176,7 @@ class modECM extends DolibarrModules
'langs'=>'ecm',
'position'=>103,
'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
- 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && getDolGlobalInt("ECM_AUTO_TREE_ENABLED")',
+ 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && !getDolGlobalInt("ECM_AUTO_TREE_HIDEN")',
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 342d7d74129..9d9d30e8188 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -309,7 +309,7 @@ llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $m
// Add sections to manage
$rowspan = 0;
$sectionauto = array();
-if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
+if (empty($conf->global->ECM_AUTO_TREE_HIDEN)) {
if (isModEnabled("product") || isModEnabled("service")) {
$langs->load("products");
$rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 51334eaae21..89e190f92c1 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -490,6 +490,13 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
migrate_contractdet_rank();
}
+
+ // Scripts for 18.0
+ $afterversionarray = explode('.', '170.9');
+ $beforeversionarray = explode('.', '18.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_contractdet_rank();
+ }
}