diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index ea675ed9001..e70e6a4cdd7 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -207,6 +207,13 @@ if ($action == 'update') { } else { dolibarr_set_const($db, 'THEME_ELDY_BTNACTION', $val, 'chaine', 0, '', $conf->entity); } + + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTBTNACTION'), array())))); + if ($val == '') { + dolibarr_del_const($db, 'THEME_ELDY_TEXTBTNACTION', $conf->entity); + } else { + dolibarr_set_const($db, 'THEME_ELDY_TEXTBTNACTION', $val, 'chaine', 0, '', $conf->entity); + } } if ($mode == 'dashboard') { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 9ee6afa182e..1f990bd955d 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2021 Anthony Berton + * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -952,6 +952,52 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; } + // Text btn action + if ($foruserprofile) { + /* + print ''; + print ''.$langs->trans("TopMenuBackgroundColor").''; + print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTBTNACTION:$langs->trans("Default")).''; + print 'conf->THEME_ELDY_TEXTBTNACTION)?" checked":""); + print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo + print '> '.$langs->trans("UsePersonalValue").''; + print ''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTBTNACTION,array()),''),'THEME_ELDY_TEXTBTNACTION','',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION,array()),''); + if ($color) print ''; + else print ''; + } + if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '';*/ + } else { + $default = (empty($textbutaction) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($textbutaction))); + + print ''; + print ''.$langs->trans("TextBtnActionColor").''; + print ''; + if ($edit) { + print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $conf->global->THEME_ELDY_TEXTBTNACTION : ''), array()), ''), 'THEME_ELDY_TEXTBTNACTION', '', 1, '', '', 'colortextbtnaction').' '; + } else { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTBTNACTION, array()), ''); + if ($color) { + print ''; + } else { + //print ''; + //print ''.$langs->trans("Default").''; + print $langs->trans("Default"); + } + } + print '   '.$langs->trans("Default").': '.$default.' '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); + print ''; + print ''; + } + // Use MAIN_OPTIMIZEFORTEXTBROWSER if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 99f87413d06..64c9cf5e0d7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1918,6 +1918,7 @@ HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (use 'ffffff' for no highlight) HighlightLinesChecked=Highlight color of the line when it is checked (use 'ffffff' for no highlight) BtnActionColor=Color of the action button +TextBtnActionColor=Text color of the action button TextTitleColor=Text color of Page title LinkColor=Color of links PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 1b92ef80f04..d5a3f51e125 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -11,6 +11,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { --btncolorborder: #FFF; --butactiondeletebg: rgb(234,228,225); --butactionbg: rgb(); + --textbutaction: rgb(); } global->THEME_DARKMODEENABLED)) { --btncolorborder: #2b2c2e; --butactiondeletebg: rgb(252,84,91); --butactionbg: rgb(173,140,79); + --textbutaction: rgb(255,255,255); }\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { @@ -67,7 +69,7 @@ span.butAction, span.butActionDelete { } .butAction { background: var(--butactionbg); - color: #FFF !important; + color: var(--textbutaction) !important; /* background: rgb(230, 232, 239); */ } .butActionRefused, .butAction, .butActionDelete { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index deb7cdadf9e..a26fe1aa2fa 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -228,7 +228,7 @@ input, select { } #mainbody input.button:not(.buttongen):not(.bordertransp), #mainbody a.button:not(.buttongen):not(.bordertransp) { background: var(--butactionbg); - color: #FFF !important; + color: var(--textbutaction)!important; border-radius: 3px; border-collapse: collapse; border: none; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index edeab565f9d..8029ce93681 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -154,6 +154,9 @@ if (!isset($conf->global->THEME_ELDY_TEXTLINK)) { if (!isset($conf->global->THEME_ELDY_BTNACTION)) { $conf->global->THEME_ELDY_BTNACTION = $butactionbg; } +if (!isset($conf->global->THEME_ELDY_TEXTBTNACTION)) { + $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction; +} // Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) { $conf->global->THEME_ELDY_BACKTABCARD1 = '255,255,255'; // card @@ -181,7 +184,8 @@ $colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp $colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->conf->THEME_ELDY_TEXTTITLELINK); $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); -$butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION); +$butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION); +$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE2) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE2); diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 41d162e6cbc..3346ac5d73d 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -75,6 +75,7 @@ $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; $toolTipFontColor = '#333'; $butactionbg = '150, 110, 162, 0.95'; +$textbutaction = '255, 255, 255'; // text color $textSuccess = '#28a745'; diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index 174d53eb516..3ab9550e42d 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -11,6 +11,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { --btncolorborder: #FFF; --butactiondeletebg: rgb(234,228,225); --butactionbg: rgb(); + --textbutaction: rgb(); } global->THEME_DARKMODEENABLED)) { --btncolorborder: #2b2c2e; --butactiondeletebg: rgb(252,84,91); --butactionbg: rgb(173,140,79); + --textbutaction: rgb(255,255,255); }\n"; if ($conf->global->THEME_DARKMODEENABLED != 2) { @@ -62,7 +64,7 @@ span.butAction, span.butActionDelete { .butAction { background: var(--butactionbg); - color: #FFF !important; + color: var(--textbutaction) !important; /* background: rgb(230, 232, 239); */ } .butActionRefused, .butAction, .butActionDelete { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 02075c6fb87..7394cbe697f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -152,6 +152,9 @@ if (!isset($conf->global->THEME_ELDY_TEXTLINK)) { if (!isset($conf->global->THEME_ELDY_BTNACTION)) { $conf->global->THEME_ELDY_BTNACTION = $butactionbg; } +if (!isset($conf->global->THEME_ELDY_TEXTBTNACTION)) { + $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction; +} // Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) { @@ -182,6 +185,7 @@ $colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortext : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); $butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION); +$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE2) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE2); @@ -344,6 +348,7 @@ print '*/'."\n"; --productlinestocktoolow: #884400; --infoboxmoduleenabledbgcolor : linear-gradient(0.4turn, #fff, #fff, #fff, #e4efe8); --butactionbg : #; + --textbutaction : #; } body { @@ -446,7 +451,7 @@ input, select { } #mainbody input.button:not(.buttongen):not(.bordertransp), #mainbody a.button:not(.buttongen):not(.bordertransp) { background: var(--butactionbg); - color: #FFF !important; + color: var(--textbutaction)!important; border-radius: 3px; border-collapse: collapse; border: none; diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index d77b994dab8..5f26d0d83bd 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -70,6 +70,7 @@ $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; $toolTipFontColor = '#333'; $butactionbg = '150, 110, 162, 0.95'; +$textbutaction = '255, 255, 255, 255'; // text color $textSuccess = '#28a745';