From 8ff572ec56ff66b92886fd1fc066598560a4b22b Mon Sep 17 00:00:00 2001 From: user Date: Wed, 4 Mar 2015 11:11:07 +0300 Subject: [PATCH] fix getLocationIDbyCODE --- intaro.intarocrm/classes/general/ICrmOrderActions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 0c09c2b8..054a0e78 100644 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -214,7 +214,10 @@ class ICrmOrderActions } else { $prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']); if ($prop['TYPE'] == 'LOCATION') { - $ar['VALUE'] = CSaleLocation::GetByID(CSaleLocation::getLocationIDbyCODE($ar['VALUE'])); + $ar['VALUE'] = CSaleLocation::GetByID( + method_exists('CSaleLocation', 'getLocationIDbyCODE') ? + CSaleLocation::getLocationIDbyCODE($ar['VALUE']) : $ar['VALUE'] + ); $ar['VALUE'] = $ar['VALUE']['CITY_NAME_LANG']; } @@ -847,7 +850,8 @@ class ICrmOrderActions if (is_string($value) === false) { return false; } elseif ($location = CSaleLocation::GetList(array(), array("LID" => LANGUAGE_ID, "CITY_NAME" => $value))->Fetch()) { - return CSaleLocation::getLocationCODEbyID($location['ID']); + return method_exists('CSaleLocation', 'getLocationCODEbyID') ? + CSaleLocation::getLocationCODEbyID($location['ID']) : $location['ID']; } else { return false; }