• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/intranet/internals/runtime/userdepartment.php
  • Класс: BitrixTasksIntegrationIntranetInternalsRuntimeUserDepartment
  • Вызов: UserDepartment::getUserDepartmentField
static function getUserDepartmentField(array $parameters = array())
{
	if(!static::includeModule() || !Loader::includeModule('iblock'))
	{
		return array();
	}

	if (!($iblockId = self::getStructureIblockId()))
	{
		return array();
	}

	if (!($ufId = self::getDepartmentUfId()))
	{
		return array();
	}

	return array(
		'runtime' => array(
			new FieldsRelationsReference(
				'U_UFV',
				UtmUserTable::getEntity(),
				Query::filter()
					->where('ref.FIELD_ID', '=', $ufId)
					->where('ref.VALUE_INT', '>', 0)
					->where('ref.VALUE_ID', '=', new ColumnExpression("this.{$parameters['REF_FIELD']}")),
				array('join_type' => 'inner')
			),
			new FieldsRelationsReference(
				'DEP',
				BitrixIblockSectionTable::getEntity(),
				Query::filter()
					->where('ref.IBLOCK_ID', '=', $iblockId)
					->where('ref.ID', '=', new ColumnExpression('this.U_UFV.VALUE_INT'))
					->where('ref.ACTIVE', '=', 'Y'),
				array('join_type' => 'inner')
			),
		),
	);
}