From 7856d7942b462dcf4bb9bcd06efc1268245e1242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A2=D1=8B?= =?UTF-8?q?=D1=89=D0=B8=D1=86=D0=BA=D0=B8=D0=B9?= Date: Tue, 25 Oct 2016 17:56:50 +0300 Subject: [PATCH] v.2.0.9 --- CHANGELOG.md | 4 ++++ .../general/history/RetailCrmHistory.php | 19 ++++++++++++++++--- intaro.retailcrm/description.ru | 4 ++-- intaro.retailcrm/install/version.php | 4 ++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35b27a3b..4ff8b378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2016-10-25 v.2.0.9 +* Исправлена ошибка с неверной кодировкой ФИО +* Исправлена ошибка с отсутствием местоположения + ## 2016-10-20 v.2.0.8 * Исправлена ошибка с отсутствием LID * Изменены методы для совместимости с ранними версиями sale 16 версии diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory.php index 69908a07..dc091e25 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory.php @@ -539,10 +539,23 @@ class RetailCrmHistory foreach ($optionsOrderProps[$personType] as $key => $orderProp) { if (array_key_exists($key, $order)) { $somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']); - self::setProp($somePropValue, RCrmActions::fromJSON($order[$key])); + if ($key == 'fio') { + self::setProp($somePropValue, $order[$key]); + } else { + self::setProp($somePropValue, RCrmActions::fromJSON($order[$key])); + } } elseif (array_key_exists($key, $order['delivery']['address'])) { - if ($propsKey[$key]['TYPE'] == 'LOCATION') { - $parameters['filter']['NAME'] = RCrmActions::fromJSON($order['delivery']['address'][$key]); + if ($propsKey[$orderProp]['TYPE'] == 'LOCATION') { + $parameters = array(); + $loc = explode('.', $order['delivery']['address'][$key]); + if (count($loc) == 1) { + $parameters['filter']['NAME'] = RCrmActions::fromJSON(trim($loc[0])); + } elseif (count($loc) == 2) { + $parameters['filter']['NAME'] = RCrmActions::fromJSON(trim($loc[1])); + } else{ + RCrmActions::eventLog('RetailCrmHistory::orderHistory', 'RetailCrmHistory::setProp', 'Error location ' . $order['delivery']['address'][$key] . ' not found add in order id=' . $order['externalId']); + continue; + } $parameters['filter']['LANGUAGE_ID'] = 'ru'; $location = \Bitrix\Sale\Location\LocationTable::getListFast($parameters)->fetch(); $somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']); diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index a7220437..64a0522c 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,2 +1,2 @@ -- Исправлена ошибка с отсутствием LID -- Изменены методы для совместимости с ранними версиями sale 16 версии \ No newline at end of file +- Исправлена ошибка с неверной кодировкой ФИО +- Исправлена ошибка с отсутствием местоположения \ No newline at end of file diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index b107c8e6..e442a4e0 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ "2.0.8", - "VERSION_DATE" => "2016-10-20 19:00:00" + "VERSION" => "2.0.9", + "VERSION_DATE" => "2016-10-25 17:00:00" );