Add color blind option
This commit is contained in:
parent
7866c2c0d3
commit
4aeaa580ea
@ -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 '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORCOLORBLIND").'</td>';
|
||||
print '<td colspan="'.($colspan-1).'">';
|
||||
|
||||
$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").': <strong>'.$default.'</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORCOLORBLINDDesc"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user