commit
93db4eb3c7
@ -1,3 +1,7 @@
|
|||||||
|
## 2018-10-25 v.2.3.13
|
||||||
|
* Добавлен функционал для активации модуля в маркетплейсе retailCRM
|
||||||
|
* Исправлен баг при генерации каталога с подстановкой схемы
|
||||||
|
|
||||||
## 2018-10-17 v.2.3.12
|
## 2018-10-17 v.2.3.12
|
||||||
* Исрпавлена некорректная выгрузка остатков по складам
|
* Исрпавлена некорректная выгрузка остатков по складам
|
||||||
* Исправлена отправка габаритов товаров в заказах
|
* Исправлена отправка габаритов товаров в заказах
|
||||||
|
@ -1483,6 +1483,7 @@ class ApiClient
|
|||||||
Client::METHOD_GET
|
Client::METHOD_GET
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit module configuration
|
* Edit module configuration
|
||||||
*
|
*
|
||||||
|
@ -322,6 +322,49 @@ class RCrmActions
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function sendConfiguration($api, $api_version, $active = true)
|
||||||
|
{
|
||||||
|
$scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
|
||||||
|
$baseUrl = $scheme . $_SERVER['HTTP_HOST'];
|
||||||
|
$integrationCode = 'bitrix';
|
||||||
|
$logo = 'https://s3.eu-central-1.amazonaws.com/retailcrm-billing/images/5af47fe682bf2-1c-bitrix-logo.svg';
|
||||||
|
$accountUrl = $baseUrl . '/bitrix/admin';
|
||||||
|
|
||||||
|
$clientId = COption::GetOptionString(self::$MODULE_ID, 'client_id', 0);
|
||||||
|
|
||||||
|
if (!$clientId) {
|
||||||
|
$clientId = uniqid();
|
||||||
|
COption::SetOptionString(self::$MODULE_ID, 'client_id', $clientId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$code = $integrationCode . '-' . $clientId;
|
||||||
|
|
||||||
|
if ($api_version == 'v4') {
|
||||||
|
$configuration = array(
|
||||||
|
'name' => GetMessage('API_MODULE_NAME'),
|
||||||
|
'code' => $code,
|
||||||
|
'logo' => $logo,
|
||||||
|
'configurationUrl' => $accountUrl,
|
||||||
|
'active' => $active
|
||||||
|
);
|
||||||
|
|
||||||
|
self::apiMethod($api, 'marketplaceSettingsEdit', __METHOD__, $configuration);
|
||||||
|
} else {
|
||||||
|
$configuration = array(
|
||||||
|
'clientId' => $clientId,
|
||||||
|
'code' => $code,
|
||||||
|
'integrationCode' => $integrationCode,
|
||||||
|
'active' => $active,
|
||||||
|
'name' => GetMessage('API_MODULE_NAME'),
|
||||||
|
'logo' => $logo,
|
||||||
|
'baseUrl' => $baseUrl,
|
||||||
|
'accountUrl' => $accountUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
self::apiMethod($api, 'integrationModulesEdit', __METHOD__, $configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function apiMethod($api, $methodApi, $method, $params, $site = null)
|
public static function apiMethod($api, $methodApi, $method, $params, $site = null)
|
||||||
{
|
{
|
||||||
switch ($methodApi) {
|
switch ($methodApi) {
|
||||||
|
@ -74,7 +74,7 @@ class RetailCrmICML
|
|||||||
$defaultSite = CSite::GetList($by = "def", $order = "desc", array('DEF' => 'Y'))->Fetch();
|
$defaultSite = CSite::GetList($by = "def", $order = "desc", array('DEF' => 'Y'))->Fetch();
|
||||||
$this->encodingDefault = $defaultSite["CHARSET"];
|
$this->encodingDefault = $defaultSite["CHARSET"];
|
||||||
|
|
||||||
$url = 'https://' . $this->serverName;
|
$url = 'https://' . $this->defaultServerName;
|
||||||
$curlHandler = curl_init();
|
$curlHandler = curl_init();
|
||||||
curl_setopt($curlHandler, CURLOPT_URL, $url);
|
curl_setopt($curlHandler, CURLOPT_URL, $url);
|
||||||
$responseBody = curl_exec($curlHandler);
|
$responseBody = curl_exec($curlHandler);
|
||||||
|
@ -1,2 +1 @@
|
|||||||
- Исправлена передача габаритов товаров в заказе
|
- Добавлен функционал для активации модуля в маркетплейсе retailCRM
|
||||||
- Исправлена передача остатков по складам
|
|
@ -69,6 +69,8 @@ class intaro_retailcrm extends CModule
|
|||||||
var $CRM_API_VERSION = 'api_version';
|
var $CRM_API_VERSION = 'api_version';
|
||||||
var $HISTORY_TIME = 'history_time';
|
var $HISTORY_TIME = 'history_time';
|
||||||
|
|
||||||
|
var $CLIENT_ID = 'client_id';
|
||||||
|
|
||||||
var $INSTALL_PATH;
|
var $INSTALL_PATH;
|
||||||
|
|
||||||
function intaro_retailcrm()
|
function intaro_retailcrm()
|
||||||
@ -1042,15 +1044,10 @@ class intaro_retailcrm extends CModule
|
|||||||
|
|
||||||
$api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0);
|
$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);
|
$api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0);
|
||||||
|
$api_version = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_VERSION, 0);
|
||||||
$this->RETAIL_CRM_API = new \RetailCrm\ApiClient($api_host, $api_key);
|
$this->RETAIL_CRM_API = new \RetailCrm\ApiClient($api_host, $api_key);
|
||||||
try {
|
|
||||||
$this->RETAIL_CRM_API->statisticUpdate();
|
RCrmActions::sendConfiguration($this->RETAIL_CRM_API, $api_version);
|
||||||
} catch (\RetailCrm\Exception\CurlException $e) {
|
|
||||||
RCrmActions::eventLog(
|
|
||||||
'intaro.retailcrm/install/index.php', 'RetailCrm\ApiClient::statisticUpdate::CurlException',
|
|
||||||
$e->getCode() . ': ' . $e->getMessage()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$APPLICATION->IncludeAdminFile(
|
$APPLICATION->IncludeAdminFile(
|
||||||
GetMessage('MODULE_INSTALL_TITLE'), $this->INSTALL_PATH . '/step6.php'
|
GetMessage('MODULE_INSTALL_TITLE'), $this->INSTALL_PATH . '/step6.php'
|
||||||
@ -1062,6 +1059,27 @@ class intaro_retailcrm extends CModule
|
|||||||
{
|
{
|
||||||
global $APPLICATION;
|
global $APPLICATION;
|
||||||
|
|
||||||
|
$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);
|
||||||
|
$api_version = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_VERSION, 0);
|
||||||
|
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/Http/Client.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/Response/ApiResponse.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/Exception/InvalidJsonException.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/Exception/CurlException.php');
|
||||||
|
|
||||||
|
if ($api_version == 'v4') {
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/ApiClient_v4.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/order/RetailCrmOrder_v4.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/history/RetailCrmHistory_v4.php');
|
||||||
|
} elseif ($api_version == 'v5') {
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/ApiClient_v5.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/order/RetailCrmOrder_v5.php');
|
||||||
|
include($this->INSTALL_PATH . '/../classes/general/history/RetailCrmHistory_v5.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
$retail_crm_api = new \RetailCrm\ApiClient($api_host, $api_key);
|
||||||
|
|
||||||
CAgent::RemoveAgent("RCrmActions::orderAgent();", $this->MODULE_ID);
|
CAgent::RemoveAgent("RCrmActions::orderAgent();", $this->MODULE_ID);
|
||||||
CAgent::RemoveAgent("RetailCrmInventories::inventoriesUpload();", $this->MODULE_ID);
|
CAgent::RemoveAgent("RetailCrmInventories::inventoriesUpload();", $this->MODULE_ID);
|
||||||
CAgent::RemoveAgent("RetailCrmPrices::pricesUpload();", $this->MODULE_ID);
|
CAgent::RemoveAgent("RetailCrmPrices::pricesUpload();", $this->MODULE_ID);
|
||||||
@ -1108,6 +1126,7 @@ class intaro_retailcrm extends CModule
|
|||||||
|
|
||||||
COption::RemoveOption($this->MODULE_ID, $this->CRM_API_VERSION);
|
COption::RemoveOption($this->MODULE_ID, $this->CRM_API_VERSION);
|
||||||
COption::RemoveOption($this->MODULE_ID, $this->HISTORY_TIME);
|
COption::RemoveOption($this->MODULE_ID, $this->HISTORY_TIME);
|
||||||
|
COption::RemoveOption($this->MODULE_ID, $this->CLIENT_ID);
|
||||||
|
|
||||||
UnRegisterModuleDependences("sale", "OnOrderUpdate", $this->MODULE_ID, "RetailCrmEvent", "onUpdateOrder");
|
UnRegisterModuleDependences("sale", "OnOrderUpdate", $this->MODULE_ID, "RetailCrmEvent", "onUpdateOrder");
|
||||||
UnRegisterModuleDependences("main", "OnAfterUserUpdate", $this->MODULE_ID, "RetailCrmEvent", "OnAfterUserUpdate");
|
UnRegisterModuleDependences("main", "OnAfterUserUpdate", $this->MODULE_ID, "RetailCrmEvent", "OnAfterUserUpdate");
|
||||||
@ -1131,12 +1150,14 @@ class intaro_retailcrm extends CModule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RCrmActions::sendConfiguration($retail_crm_api, $api_version, false);
|
||||||
|
|
||||||
$this->DeleteFiles();
|
$this->DeleteFiles();
|
||||||
|
|
||||||
UnRegisterModule($this->MODULE_ID);
|
UnRegisterModule($this->MODULE_ID);
|
||||||
|
|
||||||
$APPLICATION->IncludeAdminFile(
|
$APPLICATION->IncludeAdminFile(
|
||||||
GetMessage('MODULE_UNINSTALL_TITLE'), $this->INSTALL_PATH . '/unstep1.php'
|
GetMessage('MODULE_UNINSTALL_TITLE'), $this->INSTALL_PATH . '/unstep1.php'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
$arModuleVersion = array(
|
$arModuleVersion = array(
|
||||||
"VERSION" => "2.3.12",
|
"VERSION" => "2.3.13",
|
||||||
"VERSION_DATE" => "2018-10-17 13:50:00"
|
"VERSION_DATE" => "2018-10-25 10:40:00"
|
||||||
);
|
);
|
||||||
|
2
intaro.retailcrm/lang/ru/classes/general/RCrmActions.php
Normal file
2
intaro.retailcrm/lang/ru/classes/general/RCrmActions.php
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
$MESS ['API_MODULE_NAME'] = '1С-Битрикс';
|
Loading…
Reference in New Issue
Block a user