From 071535396037b1c6b710d91ecff045f178acb58e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Mar 2016 19:42:42 +0100 Subject: [PATCH 1/6] FIX A not enabled field for list must not into fields to add --- htdocs/core/class/html.form.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3594e6214ef..0123d539f50 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4838,7 +4838,10 @@ class Form foreach($array as $key => $val) { - if (isset($val['enabled']) && ! $val['enabled']) + /* var_dump($val); + var_dump(array_key_exists('enabled', $val)); + var_dump(!$val['enabled']);*/ + if (array_key_exists('enabled', $val) && ! $val['enabled']) { unset($array[$key]); // We don't want this field continue; From fce54e9c482a3d612eb74e384cdaf55d11931331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2016 12:49:41 +0200 Subject: [PATCH 2/6] Fix tooltip too large --- htdocs/main.inc.php | 2 +- htdocs/theme/eldy/style.css.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 07a6ae7dc8c..41dcd6285c5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1948,7 +1948,7 @@ if (! function_exists("llxFooter")) print "\n\n"; print '' . "\n"; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 4d5ae4a3ba3..0314ce7b928 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2893,12 +2893,10 @@ table.valid { border-radius: 4px; } #tiptip_content { --moz-border-radius:0px; --webkit-border-radius: 0px; -border-radius: 0px; -background-color: rgb(255,255,255); -/* background-color: rgb(255,255,255); - background-color: rgba(255,255,255,0.95);*/ + -moz-border-radius:0px; + -webkit-border-radius: 0px; + border-radius: 0px; + background-color: rgb(255,255,255); line-height: 1.4em; min-width: 200px; } From 362bc106eb9439d015fca87ccd25f879c19f999b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 30 Mar 2016 11:38:39 +0200 Subject: [PATCH 3/6] FIX Multiprice generator didn't recalculate prices if only the price_base_type property changes --- htdocs/product/class/product.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ec7a67aff83..f8cb45a8b38 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Cedric GROSS - * Copyright (C) 2013-2015 Marcos García + * Copyright (C) 2013-2016 Marcos García * Copyright (C) 2011-2014 Alexandre Spangaro * Copyright (C) 2014 Henry Florian * Copyright (C) 2014-2016 Philippe Grand @@ -4123,7 +4123,11 @@ class Product extends CommonObject $price_min = $price * (1 - ($rules[$i]->var_min_percent/100)); } - if ($price == $this->multiprices[$i] && ($price_min == $this->multiprices_min[$i])) { + //Little check to make sure the price is modified before triggering generation + $check_amount = $price == $this->multiprices[$i] && ($price_min == $this->multiprices_min[$i]); + $check_type = $baseprice == $this->multiprices_base_type[$i]; + + if ($check_amount && $check_type) { continue; } From 07e622a7f818f39e541df103fd37a471bee5c5ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Mar 2016 14:04:22 +0200 Subject: [PATCH 4/6] Introduce () to have code cleaner --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f8cb45a8b38..28855e89855 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4124,8 +4124,8 @@ class Product extends CommonObject } //Little check to make sure the price is modified before triggering generation - $check_amount = $price == $this->multiprices[$i] && ($price_min == $this->multiprices_min[$i]); - $check_type = $baseprice == $this->multiprices_base_type[$i]; + $check_amount = (($price == $this->multiprices[$i]) && ($price_min == $this->multiprices_min[$i])); + $check_type = ($baseprice == $this->multiprices_base_type[$i]); if ($check_amount && $check_type) { continue; From fa10f9e030c454203d3d6d47b867f0c765b9960e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Mar 2016 14:07:07 +0200 Subject: [PATCH 5/6] FIX #4880 --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3470fb6b434..85f340b1cb1 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -162,7 +162,7 @@ class User extends CommonObject */ function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1) { - global $langs, $conf, $user; + global $conf, $user; // Clean parameters $login=trim($login); @@ -256,7 +256,7 @@ class User extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; + //$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; From 7146a8319bacaf3d8913b0aeeef55c833eb27e7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Mar 2016 16:26:34 +0200 Subject: [PATCH 6/6] FIX Each time we edit a line, we loose the unit price. --- htdocs/core/tpl/objectline_edit.tpl.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 7c75e0ae49b..7723123bc0e 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -252,6 +252,10 @@ if (! empty($conf->margin->enabled)) jQuery("input[name='np_marginRate']:first").val(''); jQuery("input[name='np_markRate']:first").val(''); }); + jQuery("#qty").keyup(function() { + jQuery("input[name='np_marginRate']:first").val(''); + jQuery("input[name='np_markRate']:first").val(''); + }); jQuery("#remise_percent").keyup(function() { jQuery("input[name='np_marginRate']:first").val(''); jQuery("input[name='np_markRate']:first").val(''); @@ -300,7 +304,7 @@ if (! empty($conf->margin->enabled)) /* Add rules to reset price_ht from margin info */ global->DISPLAY_MARGIN_RATES)) + if (! empty($conf->global->DISPLAY_MARGIN_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD)) { ?> $('#savelinebutton').click(function (e) { @@ -312,7 +316,7 @@ if (! empty($conf->margin->enabled)) });*/ global->DISPLAY_MARK_RATES)) + if (! empty($conf->global->DISPLAY_MARK_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD)) { ?> $('#savelinebutton').click(function (e) {