diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 458f0bd4fad..5c45eb5836d 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1094,7 +1094,7 @@ class DolGraph $i++; } // shadowSize: 0 -> Drawing is faster without shadows - $this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n"; + $this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }'."\n"; // Xaxis $this->stringtoshow.=', xaxis: { ticks: ['."\n"; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7da112fa255..ea7f9856509 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -947,5 +947,44 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) */ } + + // Use MAIN_OPTIMIZEFORTEXTBROWSER + if ($foruserprofile) + { + //$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND); + $default=$langs->trans('No'); + print ''; + print ''.$langs->trans("MAIN_OPTIMIZEFORCOLORBLIND").''; + print ''; + + $colorBlindOptions = array( + 0 => $langs->trans('No'), + 'protanopia' => $langs->trans('Protanopia'), + 'deuteranopes' => $langs->trans('Deuteranopes'), + 'tritanopes' => $langs->trans('Tritanopes'), + ); + + if ($edit) + { + print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0); + } + else + { + if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])){ + print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND]; + } + else{ + print yn(0); + } + } + print '   ('.$langs->trans("Default").': '.$default.') '; + print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORCOLORBLINDDesc")); + print ''; + print ''; + } + else + { + + } print ''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f22d42327c..48d4d898de6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1900,6 +1900,11 @@ OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links. +MAIN_OPTIMIZEFORCOLORBLIND=Change interface's color for color blind person +MAIN_OPTIMIZEFORCOLORBLINDDesc=Enable this option if you are a color blind person, in some case interface will change color setup to increase contrast. +Protanopia=Protanopia +Deuteranopes=Deuteranopes +Tritanopes=Tritanopes ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s' DefaultCustomerType=Default thirdparty type for "New customer" creation form ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7b983ca05eb..e1a1f333d1d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -902,6 +902,9 @@ elseif (! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=$user->conf->MAIN_OPTIMIZEFORTEXTBROWSER; } +// set MAIN_OPTIMIZEFORCOLORBLIND +$conf->global->MAIN_OPTIMIZEFORCOLORBLIND=$user->conf->MAIN_OPTIMIZEFORCOLORBLIND; + // Set terminal output option according to conf->browser. if (GETPOST('dol_hide_leftmenu', 'int') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; if (GETPOST('dol_hide_topmenu', 'int') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1; @@ -1087,6 +1090,10 @@ if (! function_exists("llxHeader")) if ($mainmenu != 'website') $tmpcsstouse=$morecssonbody; // We do not use sidebar-collpase by default to have menuhider open by default. } + if(!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)){ + $tmpcsstouse.= ' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND); + } + print '' . "\n"; // top menu and left menu area diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 984315b0bde..0f635941a8e 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -115,6 +115,17 @@ a.badge-warning:focus, a.badge-warning:hover { background-color: ; } +/* WARNING colorblind */ +body[class^="colorblind-"] .badge-warning { + background-color: ; + } +body[class^="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus { + box-shadow: 0 0 0 0.2rem ; +} +body[class^="colorblind-"] a.badge-warning:focus, a.badge-warning:hover { + background-color: ; +} + /* INFO */ .badge-info { color: #fff !important; @@ -160,44 +171,66 @@ a.badge-dark:focus, a.badge-dark:hover { /* * STATUS BADGES */ - -/* Default Status */ - global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php +{ + // for now we use the same configuration for all types of color blind + $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85,135,150), array(150,135,80), array(150,80,150)); +} + $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); @@ -71,6 +77,11 @@ $badgeInfo ='#17a2b8'; $badgeDark ='#343a40'; $badgeLight ='#f8f9fa'; +// badge color ajustement for color blind +$colorblind_deuteranopes_badgeSuccess ='#37de5d'; //! text color black +$colorblind_deuteranopes_badgeSuccess_textColor7='#000'; +$colorblind_deuteranopes_badgeWarning ='#e4e411'; + /* default color for status : After a quick check, somme status can have oposite function according to objects * So this badges status uses default value according to theme eldy status img * TODO: use color definition vars above for define badges color status X -> expemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive .... @@ -85,3 +96,9 @@ $badgeStatus6='#cad2d2'; $badgeStatus7='#baa32b'; $badgeStatus8='#be3013'; $badgeStatus9='#e7f0f0'; + +// status color ajustement for color blind +$colorblind_deuteranopes_badgeStatus4=$colorblind_deuteranopes_badgeStatus7=$colorblind_deuteranopes_badgeSuccess; //! text color black +$colorblind_deuteranopes_badgeStatus_textColor4=$colorblind_deuteranopes_badgeStatus_textColor7='#000'; +$colorblind_deuteranopes_badgeStatus1=$colorblind_deuteranopes_badgeWarning; +$colorblind_deuteranopes_badgeStatus_textColor1='#000'; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 90228aa952e..c33c26fa95b 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -152,6 +152,12 @@ if (empty($reshook)) { $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0; } + if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) { + $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND'); + } else { + $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0; + } + $result = dol_set_user_param($db, $conf, $object, $tabparam); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);