• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/fixedscheduleviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationFixedScheduleViolationBuilder
  • Вызов: FixedScheduleViolationBuilder::buildRelativeStartViolations
private function buildRelativeStartViolations($recordedStartSeconds)
{
	$violations = [];
	$violationsConfig = $this->getViolationRules();
	$startFrom = $violationsConfig->getRelativeStartFrom();
	if (ViolationRules::isViolationConfigured($startFrom))
	{
		if ($recordedStartSeconds < $startFrom)
		{
			$violations[] = $this->createViolation(
				WorktimeViolation::TYPE_EARLY_START,
				$this->getRecord()->getRecordedStartTimestamp(),
				$recordedStartSeconds - $startFrom
			);
		}
	}

	$startTo = $violationsConfig->getRelativeStartTo();
	if (ViolationRules::isViolationConfigured($startTo))
	{
		if ($recordedStartSeconds > $startTo)
		{
			$violations[] = $this->createViolation(
				WorktimeViolation::TYPE_LATE_START,
				$this->getRecord()->getRecordedStartTimestamp(),
				$recordedStartSeconds - $startTo
			);
		}
	}
	return $violations;
}