• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/ui/task.php
  • Класс: BitrixTasksUITask
  • Вызов: Task::makeActionUrl
static function makeActionUrl($path, $taskId = 0, $actionId = 'edit', $userId = 0): string
{
	if ((string)$path === '')
	{
		return '';
	}

	$actionId = ($actionId === 'edit' ? 'edit' : 'view');
	$userId = (int)$userId;
	if (!$userId)
	{
		$userId = UtilUser::getId();
	}

	$map = [
		'action' => $actionId,
		'ACTION' => $actionId,
		'user_id' => $userId,
		'USER_ID' => $userId,
	];
	// special case, leave task placeholder un-replaced
	if ($taskId !== false)
	{
		$map['task_id'] = (int)$taskId;
		$map['TASK_ID'] = (int)$taskId;
	}

	return CComponentEngine::MakePathFromTemplate($path, $map);
}