• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/worktimeservice.php
  • Класс: BitrixTimemanServiceWorktimeWorktimeService
  • Вызов: WorktimeService::stopWorktime
public function stopWorktime($recordForm)
{
	$this->recordForm = clone $recordForm;
	if ($this->recordForm->getFirstEventName() === null)
	{
		$this->recordForm->getFirstEventForm()->eventName = WorktimeEventTable::EVENT_TYPE_STOP;
		if ($this->recordForm->recordedStopSeconds !== null ||
			$this->recordForm->recordedStopTimestamp !== null ||
			$this->recordForm->recordedStopTime !== null
		)
		{
			$this->recordForm->getFirstEventForm()->eventName = WorktimeEventTable::EVENT_TYPE_STOP_WITH_ANOTHER_TIME;
		}
	}
	return $this->processWorktimeAction($this->recordForm,
		function () use ($recordForm) {
			$stopActions = $this->buildActionList($recordForm->userId)->getStopActions();
			if (empty($stopActions))
			{
				$stopActions[] = WorktimeAction::createStopAction($recordForm->userId);
				$this->actionList->fillActions($stopActions);
			}
			return $this->checkActionEligibility($stopActions);
		}
	);
}