1
0
mirror of synced 2024-11-22 13:26:10 +03:00

fix locations

This commit is contained in:
Grisha Pomadchin 2014-04-16 14:34:05 +04:00
parent 9e4b72c3ae
commit c5c0804ee7

View File

@ -664,10 +664,18 @@ class ICrmOrderActions
CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => self::fromJSON($order['deliveryAddress']['text'])));
break;
case 'LOCATION': if (isset($order['deliveryAddress']['city'])) {
$prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
if($prop['TYPE'] == 'LOCATION') {
$cityId = self::getLocationCityId(self::fromJSON($order['deliveryAddress']['city']));
if (!$cityId)
break;
CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => $cityId));
break;
}
CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => self::fromJSON($order['deliveryAddress']['city'])));
}
break;
}
@ -1174,8 +1182,14 @@ class ICrmOrderActions
case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['text']: $resOrderDeliveryAddress['text'] = self::toJSON($ar['VALUE']);
break;
case 'LOCATION': if(!isset($resOrderDeliveryAddress['city']) && !$resOrderDeliveryAddress['city']) {
$prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
if($prop['TYPE'] == 'LOCATION') {
$resOrderDeliveryAddress['city'] = CSaleLocation::GetByID($ar['VALUE']);
$resOrderDeliveryAddress['city'] = self::toJSON($resOrderDeliveryAddress['city']['CITY_NAME_LANG']);
break;
}
$resOrderDeliveryAddress['city'] = self::toJSON($ar['VALUE']);
break;
}
break;
case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['fio']: $contactNameArr = self::explodeFIO($ar['VALUE']);