1
0
mirror of synced 2024-11-22 21:36:10 +03:00

fix getLocationIDbyCODE

This commit is contained in:
user 2015-03-04 11:11:07 +03:00
parent 50196887e4
commit 8ff572ec56

View File

@ -214,7 +214,10 @@ class ICrmOrderActions
} else { } else {
$prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']); $prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
if ($prop['TYPE'] == 'LOCATION') { 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']; $ar['VALUE'] = $ar['VALUE']['CITY_NAME_LANG'];
} }
@ -847,7 +850,8 @@ class ICrmOrderActions
if (is_string($value) === false) { if (is_string($value) === false) {
return false; return false;
} elseif ($location = CSaleLocation::GetList(array(), array("LID" => LANGUAGE_ID, "CITY_NAME" => $value))->Fetch()) { } 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 { } else {
return false; return false;
} }