From bebb9461d97034e9d1f8c3f482ac747c46c4e14b Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Mon, 11 Dec 2017 11:27:44 +0100 Subject: [PATCH 1/7] fix sort comment by id_sale --- modules/philea_magistor/script/recept_preparation.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/philea_magistor/script/recept_preparation.php b/modules/philea_magistor/script/recept_preparation.php index 291fd3c7..5d0bbd56 100644 --- a/modules/philea_magistor/script/recept_preparation.php +++ b/modules/philea_magistor/script/recept_preparation.php @@ -45,6 +45,7 @@ if( file_exists( $datFile ) ) { $order_details = array(); $details = array(); + $OP = array(); $content = file_get_contents( $datFile ); $lines = preg_split( '@\n@', $content ); @@ -73,6 +74,9 @@ if(!isset($details[(int)$id_order])) { $details[(int)$id_order] = array(); } + if(!isset($OP[(int)$id_order])) { + $OP[(int)$id_order] = $id_sale; + } // GET PRODUCT DETAIL FROM FILE $product = trim($data[7]); @@ -93,8 +97,9 @@ FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int) $id_order.' ') as $key => $row) { + $id_sale = (isset($OP[(int)$id_order]) && $OP[(int)$id_order]!=0)? (int)$OP[(int)$id_order]:$id_sale; if ($id_sale && !isset($order_details[$id_sale])) { - $order_details[$id_sale] = array(); + $order_details[$id_sale] = array(); } if ($id_sale && !isset($order_details[$id_sale][$id_order])) { $order_details[$id_sale][$id_order] = array(); From 66c4bfbdb948c051f0ba86e7633fabf359c34e86 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 12:33:36 +0100 Subject: [PATCH 2/7] Fix SoapClient emit 500 --- .../carriers/laposte/webservice_wsu.php | 19 +- .../logistics/carriers/wsdl/SlsServiceWS.wsdl | 1653 +++++++++++++++++ .../wsdl/PointRetraitServiceWS-2.0.wsdl | 436 +++++ 3 files changed, 2100 insertions(+), 8 deletions(-) create mode 100644 modules/logistics/carriers/wsdl/SlsServiceWS.wsdl create mode 100644 modules/soflexibilite/wsdl/PointRetraitServiceWS-2.0.wsdl diff --git a/modules/logistics/carriers/laposte/webservice_wsu.php b/modules/logistics/carriers/laposte/webservice_wsu.php index 061af4a1..62d964f1 100644 --- a/modules/logistics/carriers/laposte/webservice_wsu.php +++ b/modules/logistics/carriers/laposte/webservice_wsu.php @@ -382,14 +382,17 @@ class Parcel { 'exp_phone' => Configuration::get('LAPOSTEWS_EXP_PHONE'), ); - $c = new SoapClient( - 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', - array( - 'trace' => 0, - 'exceptions' => 1, - 'cache_wsdl' => 0? WSDL_CACHE_MEMORY: WSDL_CACHE_NONE, - ) - ); + try { + $c = new SoapClient( + 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', + array( + 'trace' => 0, + 'exceptions' => 1, + 'cache_wsdl' => 0? WSDL_CACHE_MEMORY: WSDL_CACHE_NONE, + ) + ); + } catch (Exception $e) {} + try { $exp_country = new Country((int) $carrier_config['exp_country']); if(in_array($exp_country->iso_code, array('GP', 'RE', 'MQ', 'YT', 'NC', 'PM', 'GF'))) { diff --git a/modules/logistics/carriers/wsdl/SlsServiceWS.wsdl b/modules/logistics/carriers/wsdl/SlsServiceWS.wsdl new file mode 100644 index 00000000..0f38487f --- /dev/null +++ b/modules/logistics/carriers/wsdl/SlsServiceWS.wsdl @@ -0,0 +1,1653 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/soflexibilite/wsdl/PointRetraitServiceWS-2.0.wsdl b/modules/soflexibilite/wsdl/PointRetraitServiceWS-2.0.wsdl new file mode 100644 index 00000000..aaecaee5 --- /dev/null +++ b/modules/soflexibilite/wsdl/PointRetraitServiceWS-2.0.wsdl @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +SO Colissimo (mon Service mes Options) WEB Service Point Retrait [Version 2] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 1d685e47cc3b74ae317cbbf79f6846b15fe68304 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 14:50:25 +0100 Subject: [PATCH 3/7] Use local wsdl file --- .../classes/SoFlexibiliteWebService.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/soflexibilite/classes/SoFlexibiliteWebService.php b/modules/soflexibilite/classes/SoFlexibiliteWebService.php index 27e2dbc7..717516c0 100644 --- a/modules/soflexibilite/classes/SoFlexibiliteWebService.php +++ b/modules/soflexibilite/classes/SoFlexibiliteWebService.php @@ -41,6 +41,15 @@ class SoFlexibiliteWebService $this->debug = false; $this->params = null; $this->ws = Configuration::get('SOFLEXIBILITE_WS'); + + // Use local wsdl file - temporary method + $useLocalWsdl = false; + if ($useLocalWsdl === true) { + if (file_exists(realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl')) { + $this->ws = realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl'; + } + } + $this->login = Configuration::get('SOFLEXIBILITE_LOGIN'); $this->password = Configuration::get('SOFLEXIBILITE_PASSWORD'); $this->options = array( @@ -60,10 +69,6 @@ class SoFlexibiliteWebService */ private function call($method, $params) { - ini_set('soap.wsdl_cache_enabled', 0); - ini_set('soap.wsdl_cache_ttl', 0); - libxml_disable_entity_loader(false); - $options = $this->options; $debug = $this->debug; @@ -71,10 +76,7 @@ class SoFlexibiliteWebService $client = new SoapClient($this->ws, $options); } catch (Exception $e) { if ($debug) { - echo '
'.print_r(libxml_get_errors(), true)."\n".
-                    var_dump(libxml_get_last_error())."\n".
-                    $e->getMessage().
-                    '
'; + echo '
'.$e->getMessage().'
'; } return false; From b4128a06299e949e1a7d901402423a304802e939 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 14:57:43 +0100 Subject: [PATCH 4/7] Enable flag to load locally the wsdl --- modules/soflexibilite/classes/SoFlexibiliteWebService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/soflexibilite/classes/SoFlexibiliteWebService.php b/modules/soflexibilite/classes/SoFlexibiliteWebService.php index 717516c0..d4430302 100644 --- a/modules/soflexibilite/classes/SoFlexibiliteWebService.php +++ b/modules/soflexibilite/classes/SoFlexibiliteWebService.php @@ -43,7 +43,7 @@ class SoFlexibiliteWebService $this->ws = Configuration::get('SOFLEXIBILITE_WS'); // Use local wsdl file - temporary method - $useLocalWsdl = false; + $useLocalWsdl = true; if ($useLocalWsdl === true) { if (file_exists(realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl')) { $this->ws = realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl'; From af269cc4b275a6a25ff05a28cbf320ee159bf814 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 15:18:32 +0100 Subject: [PATCH 5/7] CS --- modules/logistics/AdminLogistics.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/logistics/AdminLogistics.php b/modules/logistics/AdminLogistics.php index e2ca0a6c..cce2cb96 100644 --- a/modules/logistics/AdminLogistics.php +++ b/modules/logistics/AdminLogistics.php @@ -6,7 +6,9 @@ if(!defined('_PS_VERSION_')) { global $logistics_carriers; foreach(array_map(function($value) { return str_replace('.', '', $value); -}, array_diff(scandir(dirname(__FILE__).'/carriers'), array('.', '..'))) as $lg) { + }, + array_diff(scandir(dirname(__FILE__).'/carriers'), array('.', '..'))) as $lg +) { if(is_dir(dirname(__FILE__).'/carriers/'.$lg)) { include dirname(__FILE__).'/carriers/'.$lg.'/'.$lg.'.php'; $name = ucfirst($lg).'Carrier'; From 1a50acf40a02496732eae4ba506a5b528ba0e987 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 15:18:58 +0100 Subject: [PATCH 6/7] Prepare wsdl locally --- modules/logistics/carriers/laposte/webservice_wsu.php | 3 ++- modules/logistics/{carriers => }/wsdl/SlsServiceWS.wsdl | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename modules/logistics/{carriers => }/wsdl/SlsServiceWS.wsdl (100%) diff --git a/modules/logistics/carriers/laposte/webservice_wsu.php b/modules/logistics/carriers/laposte/webservice_wsu.php index 62d964f1..98977849 100644 --- a/modules/logistics/carriers/laposte/webservice_wsu.php +++ b/modules/logistics/carriers/laposte/webservice_wsu.php @@ -382,13 +382,14 @@ class Parcel { 'exp_phone' => Configuration::get('LAPOSTEWS_EXP_PHONE'), ); + $c = false; try { $c = new SoapClient( 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', array( 'trace' => 0, 'exceptions' => 1, - 'cache_wsdl' => 0? WSDL_CACHE_MEMORY: WSDL_CACHE_NONE, + 'cache_wsdl' => 0 ? WSDL_CACHE_MEMORY: WSDL_CACHE_NONE, ) ); } catch (Exception $e) {} diff --git a/modules/logistics/carriers/wsdl/SlsServiceWS.wsdl b/modules/logistics/wsdl/SlsServiceWS.wsdl similarity index 100% rename from modules/logistics/carriers/wsdl/SlsServiceWS.wsdl rename to modules/logistics/wsdl/SlsServiceWS.wsdl From a1752d2d689f44e2f950329c122c27fef6e7d900 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 11 Dec 2017 16:18:49 +0100 Subject: [PATCH 7/7] Config var --- modules/soflexibilite/classes/SoFlexibiliteWebService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/soflexibilite/classes/SoFlexibiliteWebService.php b/modules/soflexibilite/classes/SoFlexibiliteWebService.php index d4430302..a9843b39 100644 --- a/modules/soflexibilite/classes/SoFlexibiliteWebService.php +++ b/modules/soflexibilite/classes/SoFlexibiliteWebService.php @@ -43,7 +43,7 @@ class SoFlexibiliteWebService $this->ws = Configuration::get('SOFLEXIBILITE_WS'); // Use local wsdl file - temporary method - $useLocalWsdl = true; + $useLocalWsdl = Configuration::get('SOFLEXIBILITE_WSDL_LOCAL'); if ($useLocalWsdl === true) { if (file_exists(realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl')) { $this->ws = realpath(__DIR__.'/../').'/wsdl/PointRetraitServiceWS-2.0.wsdl';