diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 85d310c39c7..2bf8a55a3d0 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -61,13 +61,21 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob ?> global->DISPLAY_MARGIN_RATES)) + if ($user->rights->margins->creer) { - echo ''.$langs->trans('MarginRate').''; + if(! empty($conf->global->DISPLAY_MARGIN_RATES)) + { + echo ''.$langs->trans('MarginRate').''; + } + if(! empty($conf->global->DISPLAY_MARK_RATES)) + { + echo ''.$langs->trans('MarkRate').''; + } } - if(! empty($conf->global->DISPLAY_MARK_RATES)) + else { - echo ''.$langs->trans('MarkRate').''; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } } ?> @@ -125,12 +133,26 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob value=""> rights->margins->creer) + { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { echo '%'; } elseif (! empty($conf->global->DISPLAY_MARK_RATES)) { echo '%'; } + } + else + { + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { + $colspan++; + $coldisplay++; + } + if (! empty($conf->global->DISPLAY_MARK_RATES)) { + $colspan++; + $coldisplay++; + } + } } ?> @@ -190,7 +212,9 @@ if (! empty($conf->service->enabled) && $dateSelector) -margin->enabled) { ?> +margin->enabled && $user->rights->margins->creer) +{ +?>