ListControls::getTaskPosition

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. ListControls
  4. getTaskPosition
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher/publicaction/ui/listcontrols.php
  • Класс: BitrixTasksDispatcherPublicActionUiListControls
  • Вызов: ListControls::getTaskPosition
private function getTaskPosition($taskId, array $getListParameters)
{
	$list = ManagerTask::getList(User::getId(), $getListParameters, array("PUBLIC_MODE" => true));
	$items = $list["DATA"];

	$result = array(
		"found" => false,
		"prevTaskId" => 0,
		"nextTaskId" => 0
	);

	foreach ($items as $i => $item)
	{
		$id = $item["ID"];
		if ($id == $taskId)
		{
			$result["found"] = true;
			if (isset($items[$i + 1]))
			{
				$result["nextTaskId"] = $items[$i + 1]["ID"];
			}

			break;
		}

		$result["prevTaskId"] = $id;
	}

	return $result;
}

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