• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/worktimeviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationWorktimeViolationBuilder
  • Вызов: WorktimeViolationBuilder::buildEditStartViolations
private function buildEditStartViolations($checkAllowedDelta = true)
{
	$record = $this->getRecord();

	if (!($this->issetProperty($record->getRecordedStartTimestamp()) &&
		  $this->issetProperty($record->getActualStartTimestamp()))
	)
	{
		return [];
	}
	$allowedDiff = 0;
	if ($checkAllowedDelta)
	{
		$allowedDiff = $this->getViolationRules()->getMaxAllowedToEditWorkTime();
	}
	if (abs($record->getActualStartTimestamp() - $record->getRecordedStartTimestamp()) > $allowedDiff)
	{
		return [
			$this->createViolation(
				WorktimeViolation::TYPE_EDITED_START,
				$record->getRecordedStartTimestamp(),
				$record->getRecordedStartTimestamp() - $record->getActualStartTimestamp()
			),
		];
	}
	return [];
}