From 8d0fc9161e5c868e7984b67aa11292eff35b63b9 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 14 Oct 2024 12:39:45 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B9=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D1=83=D0=BB=D1=8F,=20php=20=D0=B8=20cms=20=D0=B2=20get-=D0=B7?= =?UTF-8?q?=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D1=85=20=D0=BA=20CRM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ VERSION | 2 +- retailcrm/lib/api/RetailcrmHttpClient.php | 15 +++++++++++++-- retailcrm/retailcrm.php | 3 +-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9fb443..a38232a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v3.6.12 +* Добавлена передача версий модуля, php и cms в get-запросах к CRM + ## v3.6.11 * Добавлены подсказки в настройках модуля diff --git a/VERSION b/VERSION index e8b6c77..8b7b0b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.11 +3.6.12 diff --git a/retailcrm/lib/api/RetailcrmHttpClient.php b/retailcrm/lib/api/RetailcrmHttpClient.php index f6419a4..4475ada 100644 --- a/retailcrm/lib/api/RetailcrmHttpClient.php +++ b/retailcrm/lib/api/RetailcrmHttpClient.php @@ -43,6 +43,7 @@ class RetailcrmHttpClient protected $url; protected $defaultParameters; + protected $versionData; /** * Client constructor. @@ -61,7 +62,13 @@ class RetailcrmHttpClient } $this->url = $url; - $this->defaultParameters = $defaultParameters; + $this->defaultParameters = $defaultParameters; + $this->versionData = [ + 'php_version' => function_exists('phpversion') ? phpversion() : '', + 'cms_source' => 'PrestaShop', + 'module_version' => RetailCRM::VERSION, + 'cms_version' => _PS_VERSION_ + ]; } /** @@ -106,7 +113,11 @@ class RetailcrmHttpClient ); } - $parameters = array_merge($this->defaultParameters, $parameters); + if (self::METHOD_GET === $method) { + $parameters = array_merge($this->defaultParameters, $parameters, $this->versionData); + } else { + $parameters = array_merge($this->defaultParameters, $parameters); + } $url = $this->url . $path; diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index d9e77dc..c573401 100755 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -48,8 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php'; class RetailCRM extends Module { - const VERSION = '3.6.11'; - + const VERSION = '3.6.12'; const API_URL = 'RETAILCRM_ADDRESS'; const API_KEY = 'RETAILCRM_API_TOKEN'; const DELIVERY = 'RETAILCRM_API_DELIVERY';