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)
This commit is contained in:
This Charlène 2022-08-11 09:01:55 +02:00 committed by GitHub
parent febc1b8600
commit 2d8c629200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');