1
0
mirror of synced 2024-11-22 05:16:09 +03:00
This commit is contained in:
МЫ 2013-08-14 10:44:27 +04:00
commit 29bf585826
4 changed files with 513 additions and 501 deletions

View File

@ -94,6 +94,12 @@ class ICrmOrderActions
return true;
}
$resOrders[] = $order;
$lastOrderId = $arOrder['ID'];
}
if (!empty($resOrders)) {
$orders = $api->orderUpload($resOrders);
// error pushing orders
@ -187,7 +193,8 @@ class ICrmOrderActions
*
* w+ event in bitrix log
*/
private static function eventLog($auditType, $itemId, $description) {
public static function eventLog($auditType, $itemId, $description) {
CEventLog::Add(array(
"SEVERITY" => "SECURITY",
@ -346,8 +353,8 @@ class ICrmOrderActions
$createdAt = $createdAt->format('Y-m-d H:i:s');
$resOrder = self::clearArr(array(
'firstName' => $resOrder['contactName'][0],
'lastName' => $resOrder['contactName'][1],
'lastName' => $resOrder['contactName'][0],
'firstName' => $resOrder['contactName'][1],
'patronymic' => $resOrder['contactName'][2],
'phone' => $resOrder['phone'],
'email' => $resOrder['email'],
@ -374,7 +381,6 @@ class ICrmOrderActions
'order' => $resOrder,
'customer' => $customer
);
}
/**

View File

@ -254,14 +254,8 @@ class intaro_intarocrm extends CModule
$percent = 100 - round(($countLeft * 100 / $countAll), 1);
if(!$countLeft) {
$api_host = COption::GetOptionString($mid, $this->CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($mid, $this->CRM_API_KEY_OPTION, 0);
$this->INTARO_CRM_API = new \IntaroCrm\RestApi($api_host, $api_key);
$this->INTARO_CRM_API->statisticUpdate();
if(!$countLeft)
$finish = 1;
}
$APPLICATION->RestartBuffer();
header('Content-Type: application/x-javascript; charset='.LANG_CHARSET);
@ -379,6 +373,9 @@ class intaro_intarocrm extends CModule
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
RegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
//agent
$dateAgent = new DateTime();
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
@ -397,6 +394,12 @@ class intaro_intarocrm extends CModule
$this->CopyFiles();
// statistic update
$api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0);
$this->INTARO_CRM_API = new \IntaroCrm\RestApi($api_host, $api_key);
$this->INTARO_CRM_API->statisticUpdate();
$APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'),
$_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/step4.php'
@ -417,6 +420,9 @@ class intaro_intarocrm extends CModule
COption::RemoveOption($this->MODULE_ID, $this->CRM_PAYMENT);
COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_LAST_ID);
UnRegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
$this->DeleteFiles();
UnRegisterModule($this->MODULE_ID);

View File

@ -19,7 +19,7 @@ $defaultDelivTypes = array (
$defaultPayTypes = array (
1 => 'cash',
5 => 'bank-card',
5 => 'bank-transfer',
6 => 'bank-transfer'
);

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
'VERSION' => '0.3.6',
'VERSION_DATE' => '2013-07-29 18:40:00',
'VERSION' => '0.3.7',
'VERSION_DATE' => '2013-08-06 15:07:00',
);