• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/shiftedscheduleviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationShiftedScheduleViolationBuilder
  • Вызов: ShiftedScheduleViolationBuilder::buildMissedShiftViolation
public function buildMissedShiftViolation()
{
	$result = new WorktimeViolationResult();

	$schedule = $this->getSchedule();
	$shiftPlan = $this->getShiftPlan();
	$shift = $this->getShift();
	if (!$shiftPlan || !$shift || !$schedule || $this->getRecord())
	{
		return $result;
	}
	$userWasAbsent = $this->isUserWasAbsent($shiftPlan->getUserId(), $shift->buildUtcStartByShiftplan($shiftPlan));
	if ($userWasAbsent)
	{
		return $result;
	}
	if ($this->getViolationRules()->isMissedShiftsControlEnabled())
	{
		$violation = $this->createViolation(WorktimeViolation::TYPE_MISSED_SHIFT);
		$result->addViolation($violation);
	}

	return $result
		->setShift($shift)
		->setShiftPlan($shiftPlan)
		->setSchedule($shift->obtainSchedule());
}