From 4f67488bd3c17167bfcefbc1bc2bf1049c089835 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 14 Jun 2012 20:07:35 +0200 Subject: [PATCH] New: add possibility to hide unauthorized buttons --- htdocs/admin/ihm.php | 15 +++++++++++++++ htdocs/theme/amarok/style.css.php | 6 ++++++ htdocs/theme/auguria/style.css.php | 6 ++++++ htdocs/theme/bureau2crea/style.css.php | 6 ++++++ htdocs/theme/cameleo/style.css.php | 6 ++++++ htdocs/theme/eldy/style.css.php | 6 ++++++ 6 files changed, 45 insertions(+) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 48362cbc5f7..3fa267ece70 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -58,6 +58,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); @@ -207,6 +208,14 @@ if ($action == 'edit') // Edit print ''; print ' '; print ''; + + // Hide unauthorized button + $var=!$var; + print ''.$langs->trans("ButtonHideUnauthorized").''; + print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1); + print ''; + print ' '; + print ''; // Hide helpcenter link on login page $var=!$var; @@ -357,6 +366,12 @@ else // Show print ''; print ' '; print ''; + + // Hide unauthorized button + $var=!$var; + print ''.$langs->trans("ButtonHideUnauthorized").''; + print yn($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED,1); + print ''; // Link to help center $var=!$var; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index f717370c4b9..82be342dd0d 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -144,6 +144,12 @@ td.formdocbutton {padding-top:6px;} color-stop(0, rgba(0,0,0,.3)) ); } + +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + .tabsAction {margin-top:12px !important; text-align:center;} .menu_titre img{padding-bottom:2px;} diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 2d4f81cf602..7566629af57 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1094,6 +1094,12 @@ span.tabspan { cursor: not-allowed; } +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + + span.butAction, span.butActionDelete { cursor: pointer; } diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index dbc5f2dd2b4..6183a246a83 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1257,6 +1257,12 @@ span.tabspan { cursor: not-allowed; } +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + + span.butAction, span.butActionDelete { cursor: pointer; } diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 969588eeb92..a63f1e04636 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1230,6 +1230,12 @@ span.tabspan { color: #666; } +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + + span.butAction, span.butActionDelete { cursor: pointer; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f87802ecbd2..4477acd75fa 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1368,6 +1368,12 @@ span.tabspan { box-shadow: 4px 4px 4px #CCC; } +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + + span.butAction, span.butActionDelete { cursor: pointer; }