From 9245f35b83566722dcda7b48cfcb0880b2af6a9e Mon Sep 17 00:00:00 2001 From: iyzoer Date: Fri, 18 Aug 2017 14:39:18 +0300 Subject: [PATCH] fix validate form --- admin/controller/extension/module/retailcrm.php | 4 ++-- admin/language/en-gb/extension/module/retailcrm.php | 2 +- admin/language/ru-ru/extension/module/retailcrm.php | 2 +- system/library/retailcrm/RetailcrmProxy.php | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/admin/controller/extension/module/retailcrm.php b/admin/controller/extension/module/retailcrm.php index 9f4d30b..a6ae5ee 100644 --- a/admin/controller/extension/module/retailcrm.php +++ b/admin/controller/extension/module/retailcrm.php @@ -544,9 +544,9 @@ class ControllerExtensionModuleRetailcrm extends Controller ); } - $response = $this->retailcrm->statisticUpdate(); + $response = $this->retailcrm->getDeliveryTypes(); - if ($response['errorMsg'] == 'API method not found') { + if ($response == false) { $this->_error['warning'] = $this->language->get('text_error_api'); } diff --git a/admin/language/en-gb/extension/module/retailcrm.php b/admin/language/en-gb/extension/module/retailcrm.php index 1d59139..7ad2027 100644 --- a/admin/language/en-gb/extension/module/retailcrm.php +++ b/admin/language/en-gb/extension/module/retailcrm.php @@ -41,7 +41,7 @@ $_['field_email'] = 'Email'; $_['field_phone'] = 'Phone'; $_['text_require'] = 'Require'; $_['text_error_collector_fields']= 'Fill in the field names Daemon Collector'; -$_['text_error_api'] = 'The selected version of the API is unavailable'; +$_['text_error_api'] = 'The selected version of the API or method is unavailable'; $_['retailcrm_dict_delivery'] = 'Shipment methods'; $_['retailcrm_dict_status'] = 'Order statuses'; diff --git a/admin/language/ru-ru/extension/module/retailcrm.php b/admin/language/ru-ru/extension/module/retailcrm.php index 1e6c044..6bfdd57 100644 --- a/admin/language/ru-ru/extension/module/retailcrm.php +++ b/admin/language/ru-ru/extension/module/retailcrm.php @@ -41,7 +41,7 @@ $_['field_email'] = 'Email'; $_['field_phone'] = 'Телефон'; $_['text_require'] = 'Обязательно для заполнения'; $_['text_error_collector_fields']= 'Заполните названия полей формы Демон Collector'; -$_['text_error_api'] = 'Недоступна выбранная версия API'; +$_['text_error_api'] = 'Недоступна выбранная версия API или метод.'; $_['retailcrm_dict_delivery'] = 'Способы доставки'; $_['retailcrm_dict_status'] = 'Статусы'; diff --git a/system/library/retailcrm/RetailcrmProxy.php b/system/library/retailcrm/RetailcrmProxy.php index 591245a..70d199f 100644 --- a/system/library/retailcrm/RetailcrmProxy.php +++ b/system/library/retailcrm/RetailcrmProxy.php @@ -10,8 +10,9 @@ class RetailcrmProxy private $api; private $log; - public function __construct($url, $key, $log, $version = 'v4') + public function __construct($url, $key, $log, $version) { + if (!$version) $version = 'v4'; switch ($version) { case 'v5': $this->api = new RetailcrmApiClient5($url, $key);