1
0
mirror of synced 2024-11-22 13:26:10 +03:00
This commit is contained in:
Grisha Pomadchin 2013-08-02 18:44:59 +04:00
parent f33f4c304f
commit b52e3062ca
2 changed files with 10 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class ICrmOrderActions
*/ */
public static function uploadOrders($steps = false, $pSize = 50) { public static function uploadOrders($steps = false, $pSize = 50) {
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, 0); // -- for test //COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, 0); // -- for test
if (!CModule::IncludeModule("iblock")) { if (!CModule::IncludeModule("iblock")) {
//handle err //handle err
@ -88,7 +88,7 @@ class ICrmOrderActions
// error pushing customers // error pushing customers
if ($api->getStatusCode() != 201) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError()); //self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError());
if ($api->getStatusCode() != 460) // some orders were sent if ($api->getStatusCode() != 460) // some orders were sent
return true; return true;
@ -129,7 +129,7 @@ class ICrmOrderActions
// error pushing customers // error pushing customers
if ($api->getStatusCode() != 201) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError()); //self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError());
if($api->getStatusCode() != 460) // some orders were sent if($api->getStatusCode() != 460) // some orders were sent
return false; // in pack mode return errors return false; // in pack mode return errors
@ -158,7 +158,7 @@ class ICrmOrderActions
// error pushing customers // error pushing customers
if ($api->getStatusCode() != 201) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError()); //self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::customerUpload', $api->getLastError());
if ($api->getStatusCode() != 460) // some orders were sent if ($api->getStatusCode() != 460) // some orders were sent
return false; // in pack mode return errors return false; // in pack mode return errors
@ -188,6 +188,7 @@ class ICrmOrderActions
* w+ event in bitrix log * w+ event in bitrix log
*/ */
private static function eventLog($auditType, $itemId, $description) { private static function eventLog($auditType, $itemId, $description) {
CEventLog::Add(array( CEventLog::Add(array(
"SEVERITY" => "SECURITY", "SEVERITY" => "SECURITY",
"AUDIT_TYPE_ID" => $auditType, "AUDIT_TYPE_ID" => $auditType,

View File

@ -0,0 +1,5 @@
<?
$arModuleVersion = array(
'VERSION' => '0.4.6',
'VERSION_DATE' => '2013-07-25 15:35:00',
);