From 56aafa4660cb7b5e262943cff1b561c09d73c07c Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 10 Dec 2016 23:25:13 +0100 Subject: [PATCH 1/5] Fix #5646 Error editing Sell Price on products/services --- htdocs/product/price.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 8c3ad45c90c..88c6c3e57b1 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2014 Florian Henry - * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2014-2015 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro @@ -246,8 +246,8 @@ if (empty($reshook)) { $obj = $db->fetch_object($resql); $npr = $obj->recuperableonly; - $localtax1 = $obj->localtax1; - $localtax2 = $obj->localtax2; + $localtax1 = get_localtax($tva_tx,1); + $localtax2 = get_localtax($tva_tx,2); $localtax1_type = $obj->localtax1_type; $localtax2_type = $obj->localtax2_type; } From 530d3503f5b11fb29aa662b942f87180631493f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Dec 2016 10:32:10 +0100 Subject: [PATCH 2/5] FIX Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email. --- htdocs/core/lib/functions.lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index aaff894fcf9..e0acccfe0c0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -290,8 +290,15 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) */ function dol_getprefix() { + global $conf; + if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) { + if (! empty($conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID)) + { + if ($conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID == 'SERVER_NAME') return $_SERVER["SERVER_NAME"]; + return $conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID; + } return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); // Use this for a "clear" cookie name //return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); From 56b3f2c011a11d898fbcbd759325daf18361d53f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Dec 2016 10:36:11 +0100 Subject: [PATCH 3/5] FIX Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email. --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e0acccfe0c0..bce67604ee7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -294,10 +294,10 @@ function dol_getprefix() if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) { - if (! empty($conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID)) + if (! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) { - if ($conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID == 'SERVER_NAME') return $_SERVER["SERVER_NAME"]; - return $conf->gobal->MAIL_PREFIX_FOR_EMAIL_ID; + if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID == 'SERVER_NAME') return $_SERVER["SERVER_NAME"]; + return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID; } return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); // Use this for a "clear" cookie name From af407a094a2b4ff8e03393e2ba1feabb55de6ae2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Dec 2016 11:20:44 +0100 Subject: [PATCH 4/5] FIX Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email. --- htdocs/core/class/smtps.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index dd2726d2306..6dd5f8214c2 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1126,6 +1126,8 @@ class SMTPs $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host.=dol_getprefix().'-'.$host; + //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: ' . $this->getSubject() . "\r\n"; $_header .= 'Date: ' . date("r") . "\r\n"; From e4dd0208874d20508c9db3acc810680417ee1810 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Dec 2016 11:23:55 +0100 Subject: [PATCH 5/5] Fix bad concat --- htdocs/core/class/smtps.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 6dd5f8214c2..a46672443ac 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1126,7 +1126,7 @@ class SMTPs $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix - $host.=dol_getprefix().'-'.$host; + $host=dol_getprefix().'-'.$host; //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: ' . $this->getSubject() . "\r\n";