diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 4cb5a907927..c6929a0f61e 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -133,6 +134,9 @@ if ($action == 'update') if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); + if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 550ecea4867..80b3a2b546a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6956,17 +6956,22 @@ class Form $("#checkallactions").click(function() { if($(this).is(\':checked\')){ console.log("We check all"); - $(".'.$cssclass.'").prop(\'checked\', true); + $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else { console.log("We uncheck all"); - $(".'.$cssclass.'").prop(\'checked\', false); + $(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\'); }'."\n"; if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; $out.=' }); - }); - '; + + $(".checkforselect").change(function() { + $(this).closest("tr").toggleClass("highlight", this.checked); + }); + + }); + '; return $out; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 2cbba69d256..ae469b89552 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2012 Laurent Destailleur * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -322,6 +323,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):''); + $checkeddisabled=''; + if (empty($foruserprofile)) $checkeddisabled=(isset($conf->global->THEME_ELDY_USE_CHECKED) && $conf->global->THEME_ELDY_USE_CHECKED == '0'); + else $checkeddisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_CHECKED) || $fuser->conf->THEME_ELDY_USE_CHECKED == '0'):''); + $colspan=2; if ($foruserprofile) $colspan=4; @@ -809,8 +814,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; */ } - else - { + else { print ''; print ''.$langs->trans("HighlightLinesColor").''; print ''; @@ -837,6 +841,50 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; print ''; + } + + // Use Checked + if ($foruserprofile) + { + /* Must first change option to choose color of highlight instead of yes or no. + print ''; + print ''.$langs->trans("HighlightLinesOnMouseHover").''; + print 'global->THEME_ELDY_USE_HOVER?" checked":"").'>'; + print ' '.$langs->trans("UsePersonalValue").''; + print ''; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''; + print ''; + */ + } + else + { + print ''; + print ''.$langs->trans("HighlightLinesChecked").''; + print ''; + //print ''; + //print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + if ($edit) + { + if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb'; + else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); + print $formother->selectColor($color,'THEME_ELDY_USE_CHECKED','formcolor',1).' '; + } + else + { + if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb'; + else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); + if ($color) + { + if ($color != 'ffefbb') print ''; + else print $langs->trans("Default"); + } + else print $langs->trans("None"); + } + print '   ('.$langs->trans("Default").': ffefbb) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); + print ''; + print ''; print ''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 16ca7cc7201..5f5e37d38a8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1703,6 +1703,7 @@ InstallModuleFromWebHasBeenDisabledByFile=Install of external module from applic ConfFileMustContainCustom=Installing or building an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to add the 2 directive lines:
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='%s/custom'; HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) +HighlightLinesChecked=Highlight color of the line when it is checked (keep empty for no highlight) 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/style.css.php b/htdocs/theme/eldy/style.css.php index b6e744672e8..222e7a14593 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -107,6 +108,7 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_ if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED=$colorbacklinepairchecked; if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -143,9 +145,11 @@ $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( // Hover color $colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER)); +$colorbacklinepairchecked=((! isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '0')?'':($conf->global->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_CHECKED)); if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) { $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); + $colorbacklinepairchecked=((! isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '0')?'':($user->conf->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_CHECKED)); } //$colortopbordertitle1=$colorbackhmenu1; @@ -191,6 +195,7 @@ $colorbacklineimpair2=join(',',colorStringToArray($colorbacklineimpair2)); $colorbacklinepair1=join(',',colorStringToArray($colorbacklinepair1)); $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); +if ($colorbacklinepairchecked != '') $colorbacklinepairchecked=join(',',colorStringToArray($colorbacklinepairchecked)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); $colortexttitlenotab=join(',',colorStringToArray($colortexttitlenotab)); $colortexttitle=join(',',colorStringToArray($colortexttitle)); @@ -218,6 +223,7 @@ print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'colorbacklinepairchecked='.$colorbacklinepairchecked."\n"; print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; @@ -2931,6 +2937,12 @@ div.pagination li.paginationafterarrows { background: rgb() !important; /* Must be background to be stronger than background of odd or even */ } + +.highlight { + background: rgb() !important; /* Must be background to be stronger than background of odd or even */ +} + + .nohover:hover { background: unset; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index aa02805c5cc..873319b39d1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5,6 +5,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -108,6 +109,7 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_ if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER==$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED=$colorbacklinepairchecked; if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -145,9 +147,11 @@ $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( // Hover color $colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER)); +$colorbacklinepairchecked=((! isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '0')?'':($conf->global->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_CHECKED)); if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) { $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); + $colorbacklinepairchecked=((! isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '0')?'':($user->conf->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_CHECKED)); } if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1; @@ -193,6 +197,7 @@ $colorbacklineimpair2=join(',',colorStringToArray($colorbacklineimpair2)); $colorbacklinepair1=join(',',colorStringToArray($colorbacklinepair1)); $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); +if ($colorbacklinepairchecked != '') $colorbacklinepairchecked=join(',',colorStringToArray($colorbacklinepairchecked)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); $colortexttitlenotab=join(',',colorStringToArray($colortexttitlenotab)); $colortexttitle=join(',',colorStringToArray($colortexttitle)); @@ -211,6 +216,7 @@ print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'colorbacklinepairchecked='.$colorbacklinepairchecked."\n"; print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; @@ -2907,6 +2913,12 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { } + +.highlight { + background: rgb() !important; /* Must be background to be stronger than background of odd or even */ +} + + .oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover { font-family: ; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 5c2869847c6..6cb418ff641 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2017 Laurent Destailleur * Copyright (C) 2010-2015 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -137,6 +138,12 @@ if (empty($reshook)) { $tabparam["THEME_ELDY_USE_HOVER"] = 0; } + if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') { + $tabparam["THEME_ELDY_USE_CHECKED"] = 1; + } else { + $tabparam["THEME_ELDY_USE_CHECKED"] = 0; + } + $result = dol_set_user_param($db, $conf, $object, $tabparam); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);