diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7da112fa255..630ad5c796e 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( + 'none' => $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/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);