• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/action/shiftsmanager.php
  • Класс: BitrixTimemanServiceWorktimeActionShiftsManager
  • Вызов: ShiftsManager::getScheduleToStart
public function getScheduleToStart($userDateTime)
{
	if ($this->activeSchedules->hasFlextime())
	{
		foreach ($this->activeSchedules->getAll() as $schedule)
		{
			if ($schedule->isFlextime())
			{
				return $schedule;
			}
		}
	}
	if ($shiftDate = $this->buildRelevantShiftWithDate($userDateTime))
	{
		return $shiftDate->getSchedule();
	}
	if ($shiftDate = $this->buildNextShiftWithDate($userDateTime))
	{
		return $shiftDate->getSchedule();
	}
	return $this->activeSchedules->count() === 0 ? null : reset($this->activeSchedules->getAll());
}