CBPHelper::getFieldInputValuePrintable

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPHelper
  4. getFieldInputValuePrintable
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/helper.php
  • Класс: CBPHelper
  • Вызов: CBPHelper::getFieldInputValuePrintable
static function getFieldInputValuePrintable($documentType, $arFieldType, $fieldValue)
{
	$result = $fieldValue;

	switch ($arFieldType['Type'])
	{
		case "user":
			$result = CBPHelper::UsersArrayToString($fieldValue, null, $documentType);
			break;

		case "bool":
			if (is_array($fieldValue))
			{
				$result = array();
				foreach ($fieldValue as $r)
					$result[] = ((mb_strtoupper($r) == "Y") ? GetMessage("BPVDX_YES") : GetMessage("BPVDX_NO"));
			}
			else
			{
				$result = ((mb_strtoupper($fieldValue) == "Y") ? GetMessage("BPVDX_YES") : GetMessage("BPVDX_NO"));
			}
			break;

		case "file":
			if (is_array($fieldValue))
			{
				$result = array();
				foreach ($fieldValue as $r)
				{
					$r = intval($r);
					$dbImg = CFile::GetByID($r);
					if ($arImg = $dbImg->Fetch())
						$result[] = "[url=/bitrix/tools/bizproc_show_file.php?f=".urlencode($arImg["FILE_NAME"])."&i=".$r."]".htmlspecialcharsbx($arImg["ORIGINAL_NAME"])."[/url]";
				}
			}
			else
			{
				$fieldValue = intval($fieldValue);
				$dbImg = CFile::GetByID($fieldValue);
				if ($arImg = $dbImg->Fetch())
					$result = "[url=/bitrix/tools/bizproc_show_file.php?f=".urlencode($arImg["FILE_NAME"])."&i=".$fieldValue."]".htmlspecialcharsbx($arImg["ORIGINAL_NAME"])."[/url]";
			}
			break;
		case "select":
			if (isset($arFieldType["Options"][$fieldValue]))
				$result = $arFieldType["Options"][$fieldValue];

			break;
	}

	return $result;
}

Добавить комментарий