• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/iblockdocument.php
  • Класс: CIBlockDocument
  • Вызов: CIBlockDocument::GetDocumentFieldTypes
static function GetDocumentFieldTypes($documentType)
{
	$iblockId = intval(mb_substr($documentType, mb_strlen("iblock_")));
	if ($iblockId <= 0)
		throw new CBPArgumentOutOfRangeException("documentType", $documentType);

	$arResult = array(
		"string" => array("Name" => GetMessage("BPCGHLP_PROP_STRING"), "BaseType" => "string"),
		"text" => array("Name" => GetMessage("BPCGHLP_PROP_TEXT"), "BaseType" => "text"),
		"int" => array("Name" => GetMessage("BPCGHLP_PROP_INT"), "BaseType" => "int"),
		"double" => array("Name" => GetMessage("BPCGHLP_PROP_DOUBLE"), "BaseType" => "double"),
		"select" => array("Name" => GetMessage("BPCGHLP_PROP_SELECT"), "BaseType" => "select", "Complex" => true),
		"bool" => array("Name" => GetMessage("BPCGHLP_PROP_BOOL"), "BaseType" => "bool"),
		"date" => array("Name" => GetMessage("BPCGHLP_PROP_DATA"), "BaseType" => "date"),
		"datetime" => array("Name" => GetMessage("BPCGHLP_PROP_DATETIME"), "BaseType" => "datetime"),
		"user" => array("Name" => GetMessage("BPCGHLP_PROP_USER"), "BaseType" => "user"),
		"file" => array("Name" => GetMessage("BPCGHLP_PROP_FILE"), "BaseType" => "file"),
	);

	$ignoredTypes = array('map_yandex', 'directory', 'SectionAuto', 'SKU', 'EAutocomplete');

	//TODO: remove class_exists, add version_control
	if (class_exists('BitrixBizprocBaseTypeInternalSelect'))
	{
		$arResult[BitrixBizprocFieldType::INTERNALSELECT] = array(
			"Name" => GetMessage("BPCGHLP_PROP_SELECT_INTERNAL"),
			"BaseType" => "string",
			"Complex" => true,
		);
	}

	foreach (CIBlockProperty::GetUserType() as  $ar)
	{
		if(in_array($ar["USER_TYPE"], $ignoredTypes))
		{
			continue;
		}

		$t = $ar["PROPERTY_TYPE"].":".$ar["USER_TYPE"];

		if($t == "S:ECrm")
		{
			$t = "E:ECrm";
		}

		if (COption::GetOptionString("bizproc", "SkipNonPublicCustomTypes", "N") == "Y"
			&& !array_key_exists("GetPublicEditHTML", $ar) || $t == "S:UserID" || $t == "S:DateTime" || $t == "S:Date")
			continue;

		$arResult[$t] = array("Name" => $ar["DESCRIPTION"], "BaseType" => "string", 'typeClass' => 'BitrixIblockBizprocTypeUserTypeProperty');
		if ($t == "S:employee")
		{
			if (COption::GetOptionString("bizproc", "employee_compatible_mode", "N") != "Y")
				$arResult[$t]["BaseType"] = "user";
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeUserTypePropertyEmployee';
		}
		elseif ($t == "E:EList")
		{
			$arResult[$t]["BaseType"] = "string";
			$arResult[$t]["Complex"] = true;
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeUserTypePropertyElist';
		}
		elseif ($t == 'S:HTML')
		{
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeUserTypePropertyHtml';
		}
		elseif($t == 'S:DiskFile')
		{
			$arResult[$t]["BaseType"] = "int";
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeUserTypePropertyDiskFile';
		}
		elseif($t == 'E:ECrm')
		{
			$arResult[$t]["BaseType"] = "string";
			$arResult[$t]["Complex"] = true;
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeECrm';
		}
		elseif($t == 'S:Money')
		{
			$arResult[$t]["BaseType"] = "string";
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeMoney';
		}
		elseif($t == 'N:Sequence')
		{
			$arResult[$t]["BaseType"] = "int";
			$arResult[$t]['typeClass'] = 'BitrixIblockBizprocTypeSequence';
		}
	}

	return $arResult;
}