weekly quick-entry form (#2793)

This commit is contained in:
Kevin Papst
2021-10-18 11:12:46 +02:00
committed by GitHub
parent 64893e0a95
commit 9ab098af86
105 changed files with 3356 additions and 778 deletions

View File

@@ -42,6 +42,18 @@ final class TimesheetLongRunningValidator extends ConstraintValidator
return;
}
// one year is currently the maximum that can be logged (which is already not logically)
// the database column could hold more data, but let's limit it here
if ($timesheet->getDuration() > 31536000) {
$this->context->buildViolation($constraint->maximumMessage)
->setTranslationDomain('validators')
->atPath('duration')
->setCode(TimesheetLongRunning::MAXIMUM)
->addViolation();
return;
}
$maxMinutes = $this->systemConfiguration->getTimesheetLongRunningDuration();
if ($maxMinutes <= 0) {