Using hidden constant to use the feature

MARGININFO_HIDE_SHOW = 0 feature not used
MARGININFO_HIDE_SHOW = 1 feature used, displayed on open
MARGININFO_HIDE_SHOW = 2 feature used, not displayed on open
This commit is contained in:
BENKE Charles 2014-06-26 22:34:40 +02:00
parent 3d7b6e9a26
commit 8acd702cd1

View File

@ -3235,7 +3235,11 @@ abstract class CommonObject
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
$marginInfo = $this->getMarginInfos($force_price); $marginInfo = $this->getMarginInfos($force_price);
if ($conf->global->MARGININFO_HIDE_SHOW > 0)
print "<img onclick=\"$('.margininfos').toggle();\" src='".img_picto($langs->trans("Hide")."/".$langs->trans("Show"),'object_margin.png','','',1)."'>"; print "<img onclick=\"$('.margininfos').toggle();\" src='".img_picto($langs->trans("Hide")."/".$langs->trans("Show"),'object_margin.png','','',1)."'>";
if ($conf->global->MARGININFO_HIDE_SHOW == 2) // hide by default
print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
print '<table class="nobordernopadding margintable" width="100%">'; print '<table class="nobordernopadding margintable" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="30%">'.$langs->trans('Margins').'</td>'; print '<td width="30%">'.$langs->trans('Margins').'</td>';