From 5a9d968a75a88b9fcfea9b0fc954da11004859d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 May 2020 00:02:03 +0200 Subject: [PATCH] Fix MAIN_BUGTRACK_ENABLELINK and MAIN_HELP_DISABLELINK setting --- htdocs/admin/ihm.php | 10 ++++++---- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 3 +-- htdocs/main.inc.php | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1b088f0c2b9..d4868ed68ac 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -166,8 +166,8 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities $varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) @@ -354,7 +354,8 @@ print ''; // Show bugtrack link print ''.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; -print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); +print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0); +//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); print ''; print ' '; print ''; @@ -362,7 +363,8 @@ print ''; // Hide wiki link on login page $pictohelp = ''; print ''.$langs->trans("DisableLinkToHelp", $pictohelp).''; -print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1); +print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0); +//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1); print ''; print ' '; print ''; diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index ab9bd529edd..89b8a8ace76 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -67,8 +67,7 @@ ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafie ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL; -- This var is per entity now, so we remove const if global if exists -delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0; - +delete from llx_const where name in ('PROJECT_HIDE_TASKS', 'MAIN_BUGTRACK_ENABLELINK', 'MAIN_HELP_DISABLELINK') and entity = 0; -- For v12 diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 490641ca9fa..679e565cf0e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1699,10 +1699,11 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $langs->load('admin'); $appli .= '
'.$langs->trans("Database").': '.$db->database_name; } - $text = ''.DOL_VERSION.''; - $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2); } + $text = ''.DOL_VERSION.''; + $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2); + // Logout link $toprightmenu .= @Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem logout-btn', 2);