weekly quick-entry form (#2793)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user