Task::stop

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. stop
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher/publicaction/task/dayplan/timer.php
  • Класс: BitrixTasksDispatcherPublicActionTaskDayPlanTimer
  • Вызов: Timer::stop
public function stop($taskId)
{
	$result = [];

	if (!TaskAccessController::can($this->userId, ActionDictionary::ACTION_TASK_TIME_TRACKING, (int)$taskId))
	{
		$this->addForbiddenError();
		return $result;
	}

	if($taskId = $this->checkTaskId($taskId))
	{
		$timer = CTaskTimerManager::getInstance(User::getId());
		if($timer->stop($taskId) === false)
		{
			$this->errors->add('ACTION_FAILED', 'Timer action failed');
		}
	}

	return $result;
}

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