forked from Wavyzz/dolibarr
Force to select "use personalized value" to select a personalized screen
option.
This commit is contained in:
@@ -277,6 +277,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME;
|
if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME;
|
||||||
else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:'');
|
else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:'');
|
||||||
|
|
||||||
|
$hoverdisabled='';
|
||||||
|
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'):'');
|
||||||
|
|
||||||
$colspan=2;
|
$colspan=2;
|
||||||
if ($foruserprofile) $colspan=4;
|
if ($foruserprofile) $colspan=4;
|
||||||
|
|
||||||
@@ -295,7 +299,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("DefaultSkin").'</td>';
|
print '<td>'.$langs->trans("DefaultSkin").'</td>';
|
||||||
print '<td>'.$conf->global->MAIN_THEME.'</td>';
|
print '<td>'.$conf->global->MAIN_THEME.'</td>';
|
||||||
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@@ -359,11 +363,11 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
print '</a><br>';
|
print '</a><br>';
|
||||||
if ($subdir == $selected_theme)
|
if ($subdir == $selected_theme)
|
||||||
{
|
{
|
||||||
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>';
|
print '<input '.($edit?'':'disabled').' type="radio" class="'.($var?'imp':'').'pair themethumbs" style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir;
|
print '<input '.($edit?'':'disabled').' type="radio" class="'.($var?'imp':'').'pair themethumbs" style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir;
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@@ -378,20 +382,57 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (! $foruserprofile)
|
// Use Hover
|
||||||
{
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
if ($foruserprofile)
|
||||||
|
{
|
||||||
|
/* Must first change option to choose color of highlight insteado of yes or no.
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
|
||||||
|
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>';
|
||||||
|
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
|
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
||||||
|
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
|
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
|
||||||
$hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0');
|
|
||||||
print '<td colspan="'.($colspan-1).'"><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
print '<td colspan="'.($colspan-1).'"><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
||||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
//if ($conf->theme == 'eldy')
|
|
||||||
//{
|
|
||||||
// TopMenuBackgroundColor
|
// TopMenuBackgroundColor
|
||||||
|
if ($foruserprofile)
|
||||||
|
{
|
||||||
|
/*$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
||||||
|
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>';
|
||||||
|
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
|
||||||
|
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($edit)
|
||||||
|
{
|
||||||
|
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||||
|
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
|
else print '';
|
||||||
|
}
|
||||||
|
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
|
print '</td>';*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
||||||
@@ -403,13 +444,21 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
else print $langs->trans("Default");
|
else print $langs->trans("Default");
|
||||||
}
|
}
|
||||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// BackgroundTableTitleColor
|
// BackgroundTableTitleColor
|
||||||
|
if ($foruserprofile)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
|
||||||
@@ -424,7 +473,6 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
|||||||
}
|
}
|
||||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//}
|
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,17 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin)))
|
|||||||
if ($_POST["check_MAIN_THEME"]=="on") $tabparam["MAIN_THEME"]=$_POST["main_theme"];
|
if ($_POST["check_MAIN_THEME"]=="on") $tabparam["MAIN_THEME"]=$_POST["main_theme"];
|
||||||
else $tabparam["MAIN_THEME"]='';
|
else $tabparam["MAIN_THEME"]='';
|
||||||
|
|
||||||
|
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
|
||||||
|
if ($val == '') $tabparam['THEME_ELDY_TOPMENU_BACK1']='';
|
||||||
|
else $tabparam['THEME_ELDY_TOPMENU_BACK1']=join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()));
|
||||||
|
|
||||||
|
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
|
||||||
|
if ($val == '') $tabparam['THEME_ELDY_BACKTITLE1']='';
|
||||||
|
else $tabparam['THEME_ELDY_BACKTITLE1']=join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()));
|
||||||
|
|
||||||
|
if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') $tabparam["THEME_ELDY_USE_HOVER"]=1;
|
||||||
|
else $tabparam["THEME_ELDY_USE_HOVER"]=0;
|
||||||
|
|
||||||
$tabparam["MAIN_SEARCHFORM_CONTACT"]=$_POST["main_searchform_contact"];
|
$tabparam["MAIN_SEARCHFORM_CONTACT"]=$_POST["main_searchform_contact"];
|
||||||
$tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"];
|
$tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"];
|
||||||
$tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"];
|
$tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"];
|
||||||
@@ -152,6 +163,8 @@ print '</table><br>';
|
|||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{/*
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
$("#main_lang_default").change(function() {
|
$("#main_lang_default").change(function() {
|
||||||
@@ -162,7 +175,36 @@ if ($action == 'edit')
|
|||||||
else $("#check_SIZE_LISTE_LIMIT").prop("checked", false);
|
else $("#check_SIZE_LISTE_LIMIT").prop("checked", false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
</script>';*/
|
||||||
|
}
|
||||||
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<script type="text/javascript" language="javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
function init_myfunc()
|
||||||
|
{
|
||||||
|
if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
|
||||||
|
else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
|
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
|
||||||
|
else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
|
if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
|
||||||
|
else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
|
if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
|
||||||
|
else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
|
||||||
|
}
|
||||||
|
init_myfunc();
|
||||||
|
jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
|
||||||
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|||||||
Reference in New Issue
Block a user