From d2aa99fdad142619e12430b294b22c01d296989b Mon Sep 17 00:00:00 2001 From: Grisha Pomadchin Date: Mon, 5 Aug 2013 15:15:15 +0400 Subject: [PATCH] orderCreate upgrade --- .../classes/general/ICrmOrderActions.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 8019a41b..d038c82d 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -71,7 +71,7 @@ class ICrmOrderActions while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset - $order = self::orderCreate($arOrder['ID'], $api, $arParams); + $order = self::orderCreate($arOrder, $api, $arParams); if (!$order) continue; @@ -99,7 +99,7 @@ class ICrmOrderActions while ($arOrder = $dbOrder->GetNext()) { // here orders by id asc - $order = self::orderCreate($arOrder['ID'], $api, $arParams); + $order = self::orderCreate($arOrder, $api, $arParams); if (!$order) continue; @@ -179,18 +179,16 @@ class ICrmOrderActions else return; } - public static function orderCreate($orderId, $api, $arParams, $send = false) { - if(!$api || empty($arParams) || !$orderId) { // add cond to check $arParams + public static function orderCreate($arFields, $api, $arParams, $send = false) { + if(!$api || empty($arParams)) { // add cond to check $arParams return false; } - - $arFields = CSaleOrder::GetById($orderId); - + if (empty($arFields)) { //handle err self::eventLog('ICrmOrderActions::orderCreate', 'empty($arFields)', 'incorrect order'); - return false; + return true; } $rsUser = CUser::GetByID($arFields['USER_ID']);