• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/action/worktimeactionlist.php
  • Класс: BitrixTimemanServiceWorktimeActionWorktimeActionList
  • Вызов: WorktimeActionList::isEligibleToStart
private function isEligibleToStart(?WorktimeRecord $record)
{
	if (!$record || $record->getRecordedStartTimestamp() > TimeHelper::getInstance()->getUtcNowTimestamp())
	{
		return true;
	}

	if ($record->getRecordedStopTimestamp() > 0)
	{
		if ($this->recordManager->isEligibleToReopen())
		{
			$prevShift = $this->buildShiftWithDateByRecord($record);
			if ($prevShift && $this->userDateTime->getTimestamp() > $prevShift->getDateTimeEnd()->getTimestamp())
			{
				$shiftWithDate = $this->getRelevantShiftWithDate($this->userDateTime, $record);
				if ($shiftWithDate)
				{
					return true;
				}
			}
		}
		else
		{
			return true;
		}
	}
	return false;
}