From 1e16626047cd898f6782e57569be62851c4068ba Mon Sep 17 00:00:00 2001 From: Grisha Pomadchin Date: Wed, 24 Jul 2013 18:27:56 +0400 Subject: [PATCH] error codes update; --- .../classes/general/ICrmOrderActions.php | 12 +++++++----- intaro.intarocrm/install/version.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 80746eab..39e438f8 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -68,6 +68,7 @@ class ICrmOrderActions // pack mode enable / disable // can send data evry 500 rows if (!$steps) { + while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset $order = self::orderCreate($arOrder['ID'], $api, $arParams); @@ -79,12 +80,12 @@ class ICrmOrderActions $lastOrderId = $arOrder['ID']; } - + if (!empty($resOrders)) { $orders = $api->orderUpload($resOrders); - + // error pushing orders - if ($api->getStatusCode() != 200) { + if ($api->getStatusCode() != 201) { //handle err self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); @@ -92,6 +93,7 @@ class ICrmOrderActions return false; // in pack mode return errors } } + } else { // package mode (by default runs after install) $orderCount = 0; @@ -112,7 +114,7 @@ class ICrmOrderActions $orders = $api->orderUpload($resOrders); // error pushing orders - if ($api->getStatusCode() != 200) { + if ($api->getStatusCode() != 201) { //handle err self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); @@ -130,7 +132,7 @@ class ICrmOrderActions $orders = $api->orderUpload($resOrders); // error pushing orders - if ($api->getStatusCode() != 200) { + if ($api->getStatusCode() != 201) { //handle err self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); diff --git a/intaro.intarocrm/install/version.php b/intaro.intarocrm/install/version.php index e7a7ee90..f1760bb4 100755 --- a/intaro.intarocrm/install/version.php +++ b/intaro.intarocrm/install/version.php @@ -1,5 +1,5 @@ '0.3.5', - 'VERSION_DATE' => '2013-07-24 17:28:00', + 'VERSION_DATE' => '2013-07-24 18:27:00', );