• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/blocks/orderbuyer.php
  • Класс: BitrixSaleHelpersAdminBlocksOrderBuyer
  • Вызов: OrderBuyer::getOrderPropertiesHtml
static function getOrderPropertiesHtml(SaleOrder $order, $readonly = false)
{
	$propertyCollection = $order->getPropertyCollection();
	$result = "";

	foreach ($propertyCollection->getGroups() as $group)
	{
		$resultBody = "";

		$groupProperties = $propertyCollection->getPropertiesByGroupId($group['ID']);

		if(!is_array($groupProperties))
			continue;

		/** @var BitrixSalePropertyValue $property */
		foreach ($propertyCollection->getPropertiesByGroupId($group['ID']) as $property)
		{
			$propertyValue = $property->getValue();

			if ($readonly
				&& (
					!isset($propertyValue)
					|| (is_array($propertyValue) && empty($propertyValue))
					|| $propertyValue === ""
				)
			)
				continue;

			$p = $property->getProperty();

			if($p['IS_PHONE'] == 'Y' && $readonly)
			{
				$phoneVal = $property->getValue();

				if($phoneVal != '')
				{
					if(!is_array($phoneVal))
						$phoneVal = array($phoneVal);

					$showHtml = '';

					foreach($phoneVal as $number)
					{
						$number = str_replace("'", "", htmlspecialcharsbx($number));

						if($showHtml <> '')
							$showHtml .= ', ';

						$showHtml .= ''.
							$number.
							'';
					}
				}
				else
				{
					$showHtml = '';
				}
			}
			else
			{
				$showHtml = (($readonly) ? $property->getViewHtml() : $property->getEditHtml());
			}

			$resultBody .= '
				
					'.htmlspecialcharsbx($property->getName()).':
					
'.$showHtml.'
'; } if (!empty($resultBody)) { $result .= '
'.htmlspecialcharsbx($group['NAME']).'
'.$resultBody.'
'; } } return $result; }