From 2d8c6292001acc71638f1935f3d41d552cd0b28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:01:55 +0200 Subject: [PATCH] if we set another view list mode, we keep it if we set another view list mode, we keep it (till we change one more time) --- htdocs/admin/modules.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 286ccc424e8..517b3e509e7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -43,10 +43,15 @@ require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors", "admin", "modulebuilder")); -$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common'); -if (empty($mode)) { - $mode = 'common'; +// if we set another view list mode, we keep it (till we change one more time) +if (GETPOSTISSET('mode')) { + $mode = GETPOST('mode', 'alpha'); + if ($mode =='common' || $mode =='commonkanban') + dolibarr_set_const( $db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity); +} else { + $mode = (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT); } + $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); $page_y = GETPOST('page_y', 'int');