is::getAccessibleTaskIdsSql

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. is
  4. getAccessibleTaskIdsSql
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/runtime/task.php
  • Класс: BitrixTasksInternalsRunTimeis
  • Вызов: is::getAccessibleTaskIdsSql
static function getAccessibleTaskIdsSql(array $parameters)
{
	$result = [];

	$parameters = static::checkParameters($parameters);
	$filter = static::getForwardedFilter($parameters['APPLY_FILTER'] ?? null, $parameters);
	$runtimeOptions = [];

	if ($parameters['MAKE_ACCESS_FILTER'] ?? null)
	{
		$runtimeOptions = $parameters['ACCESS_FILTER_RUNTIME_OPTIONS'];
	}

	// todo: where 1 = 0 here if $parameters['USER_ID'] is 0

	$queries = [
		static::getAccessibleGroupTasksQuery($parameters, $filter, $runtimeOptions),
		static::getAccessibleSubEmployeesTasksQuery($parameters, $filter, $runtimeOptions),
		static::getAccessibleMyTasksQuery($parameters, $filter, $runtimeOptions)
	];

	foreach ($queries as $query)
	{
		if (!empty($query))
		{
			$result[] = $query;
		}
	}

	if (count($result) == 1)
	{
		$result[] = "n/*eliminate possible duplicates*/nSELECT 0 as TASK_ID";
	}

	return "n".implode("nnUNIONnn", $result)."n";
}

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