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

View File

@ -254,14 +254,8 @@ class intaro_intarocrm extends CModule
$percent = 100 - round(($countLeft * 100 / $countAll), 1); $percent = 100 - round(($countLeft * 100 / $countAll), 1);
if(!$countLeft) { 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();
$finish = 1; $finish = 1;
}
$APPLICATION->RestartBuffer(); $APPLICATION->RestartBuffer();
header('Content-Type: application/x-javascript; charset='.LANG_CHARSET); header('Content-Type: application/x-javascript; charset='.LANG_CHARSET);
@ -379,6 +373,9 @@ class intaro_intarocrm extends CModule
RegisterModule($this->MODULE_ID); RegisterModule($this->MODULE_ID);
RegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
RegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
//agent //agent
$dateAgent = new DateTime(); $dateAgent = new DateTime();
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec; $intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
@ -397,6 +394,12 @@ class intaro_intarocrm extends CModule
$this->CopyFiles(); $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( $APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'), GetMessage('MODULE_INSTALL_TITLE'),
$_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/step4.php' $_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_PAYMENT);
COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_LAST_ID); 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(); $this->DeleteFiles();
UnRegisterModule($this->MODULE_ID); UnRegisterModule($this->MODULE_ID);

View File

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

View File

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