From fc7c0ce52188776dd34f0aeeb8e7c4ca3ce771b7 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 24 Sep 2018 16:23:44 +0200 Subject: [PATCH 1/7] FIX : need to filter on current entity on replenish --- htdocs/product/stock/replenish.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5a9b9888470..a8721d11c90 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -185,6 +185,7 @@ if ($action == 'order' && isset($_POST['valid'])) $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " WHERE fk_soc = ".$suppliersid[$i]; $sql.= " AND source = 42 AND fk_statut = 0"; + $sql.= " AND entity = ".$conf->entity; $sql.= " ORDER BY date_creation DESC"; $resql = $db->query($sql); if($resql && $db->num_rows($resql) > 0) { From d15c52db3b8e9614e868e02ed96761ffc8017611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Sep 2018 08:16:05 +0200 Subject: [PATCH 2/7] Update rssparser.class.php --- htdocs/core/class/rssparser.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 56e338b7eb8..1417b9a0e29 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -742,7 +742,7 @@ function xml2php($xml) } //Let see if the new child is not in the array - if($tab==false && in_array($key,array_keys($array))) + if($tab === false && in_array($key,array_keys($array))) { //If this element is already in the array we will create an indexed array $tmp = $array[$key]; @@ -751,7 +751,7 @@ function xml2php($xml) $array[$key][] = $child; $tab = true; } - elseif($tab == true) + elseif($tab === true) { //Add an element in an existing array $array[$key][] = $child; From a9f7bdead68054eac806b328383526373f5ded42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Sep 2018 15:22:08 +0200 Subject: [PATCH 3/7] fix Option MAIN_DISABLE_NOTES_TAB #9611 --- htdocs/core/tpl/bloc_showhide.tpl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index 2fe6204f3b9..3f9c1eb0a1d 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2013 Laurent Destailleur +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,7 +43,7 @@ print '});'."\n"; print '$("#show-'.$blocname.'").click(function(){'."\n"; print ' setShowHide(1);'."\n"; -print ' $("#'.$blocname.'").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n"; +print ' $("#'.$blocname.'_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n"; print ' $(this).hide();'."\n"; print ' $("#hide-'.$blocname.'").show();'."\n"; print '});'."\n"; From 92a3faeaf76df2b31e2fdc2302e3d33e0aa05abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Sep 2018 10:13:14 +0200 Subject: [PATCH 4/7] add try catch for swiftmailer --- htdocs/core/class/CMailFile.class.php | 36 +++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8313894f68c..9bd17a9670a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -407,18 +407,44 @@ class CMailFile // TODO if (! empty($moreinheader)) ... // Give the message a subject - $this->message->setSubject($this->encodetorfc2822($subject)); + try { + $this->message->setSubject($this->encodetorfc2822($subject)); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } // Set the From address with an associative array //$this->message->setFrom(array('john@doe.com' => 'John Doe')); - if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from)); + if (! empty($from)) { + try { + $result = $this->message->setFrom($this->getArrayAddress($from)); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } + } // Set the To addresses with an associative array - if (! empty($to)) $this->message->setTo($this->getArrayAddress($to)); + if (! empty($to)) { + try { + $result = $this->message->setTo($this->getArrayAddress($to)); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } + } - if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from)); + if (! empty($from)) { + try { + $result = $this->message->SetReplyTo($this->getArrayAddress($from)); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } + } - $this->message->setCharSet($conf->file->character_set_client); + try { + $result = $this->message->setCharSet($conf->file->character_set_client); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } if (! empty($this->html)) { From 1bac3a0ccfc4ce81a76eca8b3734b0d22d8f14ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Sep 2018 10:37:20 +0200 Subject: [PATCH 5/7] swiftmailer is doing encodetorfc2822 --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 9bd17a9670a..bb38563837a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -408,7 +408,7 @@ class CMailFile // Give the message a subject try { - $this->message->setSubject($this->encodetorfc2822($subject)); + $this->message->setSubject($subject); } catch (Exception $e) { $this->error = $e->getMessage(); } From af93fc74846f500b26c96a34b1b3729e0598ef19 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 26 Sep 2018 17:19:06 +0200 Subject: [PATCH 6/7] FIX: showOptionals: column mismatches --- htdocs/core/class/commonobject.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e9498d52d7d..47fabb6e2dc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4524,7 +4524,7 @@ abstract class CommonObject { if (is_array($params) && count($params)>0) { if (array_key_exists('colspan',$params)) { - $colspan=$params['colspan']; + $colspan=$params['colspan'] - 1; } }else { $colspan='3'; @@ -4581,6 +4581,12 @@ abstract class CommonObject if($extrafields->attribute_required[$key]) $label = ''.$label.''; + if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) + { + $out .= ' '; + $colspan--; + } + $out .= ''.$langs->trans($label).''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; $out .=''; From ff3f1e933ae21796a02eb5adcbc8a8a2ba3fc2b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Sep 2018 09:22:38 +0200 Subject: [PATCH 7/7] Update replenish.php --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a8721d11c90..891c4fab6f5 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -185,7 +185,7 @@ if ($action == 'order' && isset($_POST['valid'])) $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " WHERE fk_soc = ".$suppliersid[$i]; $sql.= " AND source = 42 AND fk_statut = 0"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (".getEntity('commande_fournisseur').")"; $sql.= " ORDER BY date_creation DESC"; $resql = $db->query($sql); if($resql && $db->num_rows($resql) > 0) {