- Модуль: report
- Путь к файлу: ~/bitrix/modules/report/classes/general/report_helper.php
- Класс: CReportHelper
- Вызов: CReportHelper::buildHTMLSelectTreePopup
static function buildHTMLSelectTreePopup($tree, $withReferencesChoose = false, $level = 0)
{
if (is_array($withReferencesChoose))
{
$filtrableGroups = $withReferencesChoose;
$isRefChoose = true;
}
else
{
$filtrableGroups = [];
$isRefChoose = $withReferencesChoose;
}
$html = '';
$i = 0;
foreach($tree as $treeElem)
{
$isLastElem = (++$i == count($tree));
$fieldDefinition = $treeElem['fieldName'];
$branch = $treeElem['branch'];
$fieldType = null;
$customColumnTypes = static::getCustomColumnTypes();
if (array_key_exists($fieldDefinition, $customColumnTypes))
{
$fieldType = $customColumnTypes[$fieldDefinition];
}
else
{
$fieldType = $treeElem['field'] ? static::getFieldDataType($treeElem['field']) : null;
}
// file fields is not filtrable
if ($isRefChoose && ($fieldType === 'file' || $fieldType === 'disk_file'))
{
continue;
}
// multiple money fields is not filtrable
if ($isRefChoose && $fieldType === 'money'
&& $treeElem['isUF'] === true
&& is_array($treeElem['ufInfo'])
&& isset($treeElem['ufInfo']['MULTIPLE'])
&& $treeElem['ufInfo']['MULTIPLE'] === 'Y')
{
continue;
}
if (empty($branch))
{
// single field
$htmlElem = static::buildSelectTreePopupElelemnt(
$treeElem['humanTitle'], $treeElem['fullHumanTitle'], $fieldDefinition, $fieldType,
($treeElem['isUF'] === true && is_array($treeElem['ufInfo'])) ? $treeElem['ufInfo'] : array()
);
if ($isLastElem && $level > 0)
{
$htmlElem = str_replace(
'