From b4ebd7e8529721f8f15bf869d518cb9e58fe1f21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Nov 2012 11:36:45 +0100 Subject: [PATCH] Qual: Uniformize code and fix a regression --- .../tpl/predefinedproductline_create.tpl.php | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 601f463682d..4064fb3b585 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -42,17 +42,16 @@ trans('ReductionShort'); ?> margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> trans('BuyingPrice'); ?> -global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} -?>   +
0) jQuery('#np_desc').focus(); }); }); @@ -97,17 +96,16 @@ jQuery(document).ready(function() { % margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> "> global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; } ?> @@ -115,18 +113,17 @@ if (! empty($conf->margin->enabled)) { -service->enabled) && $dateSelector) { -if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - $colspan = 10; -else - $colspan = 9; -if (! empty($conf->margin->enabled)) { - $colspan++; // For the buying price - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} +service->enabled) && $dateSelector) +{ + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; + else $colspan = 9; + if (! empty($conf->margin->enabled)) + { + $colspan++; // For the buying price + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; + } ?> > @@ -138,11 +135,15 @@ if (! empty($conf->margin->enabled)) { ?> - +
+ margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ ?> - +