allow to restrict usage of global activities for projects (#3437)

This commit is contained in:
Kevin Papst
2022-07-23 01:17:24 +02:00
committed by GitHub
parent 8d695d03df
commit ed7f89cfe1
12 changed files with 140 additions and 11 deletions

View File

@@ -124,6 +124,14 @@ final class TimesheetBasicValidator extends ConstraintValidator
->addViolation();
}
if (!$project->isGlobalActivities() && $activity->isGlobal()) {
$context->buildViolation('Global activities are forbidden for the selected project.')
->atPath('activity')
->setTranslationDomain('validators')
->setCode(TimesheetBasic::PROJECT_DISALLOWS_GLOBAL_ACTIVITY)
->addViolation();
}
$pathStart = 'begin';
$pathEnd = 'end';