1
0
mirror of synced 2024-11-26 07:16:08 +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']))); CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => self::fromJSON($order['deliveryAddress']['text'])));
break; break;
case 'LOCATION': if (isset($order['deliveryAddress']['city'])) { 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'])); $cityId = self::getLocationCityId(self::fromJSON($order['deliveryAddress']['city']));
if (!$cityId) if (!$cityId)
break; break;
CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => $cityId)); CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => $cityId));
break;
}
CSaleOrderPropsValue::Update($ar['ID'], array('VALUE' => self::fromJSON($order['deliveryAddress']['city'])));
} }
break; break;
} }
@ -1174,8 +1182,14 @@ class ICrmOrderActions
case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['text']: $resOrderDeliveryAddress['text'] = self::toJSON($ar['VALUE']); case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['text']: $resOrderDeliveryAddress['text'] = self::toJSON($ar['VALUE']);
break; break;
case 'LOCATION': if(!isset($resOrderDeliveryAddress['city']) && !$resOrderDeliveryAddress['city']) { 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'] = CSaleLocation::GetByID($ar['VALUE']);
$resOrderDeliveryAddress['city'] = self::toJSON($resOrderDeliveryAddress['city']['CITY_NAME_LANG']); $resOrderDeliveryAddress['city'] = self::toJSON($resOrderDeliveryAddress['city']['CITY_NAME_LANG']);
break;
}
$resOrderDeliveryAddress['city'] = self::toJSON($ar['VALUE']);
break;
} }
break; break;
case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['fio']: $contactNameArr = self::explodeFIO($ar['VALUE']); case $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']]['fio']: $contactNameArr = self::explodeFIO($ar['VALUE']);