feat: admin mode for teamer profile form to override disabled fields

This commit is contained in:
Björn Fromme
2024-11-25 15:34:45 +01:00
parent b405643732
commit febf90c0db
3 changed files with 16 additions and 5 deletions
@@ -53,7 +53,10 @@ class IndexController extends AbstractController
// Validate teamer data to show missing data right away
$errors = $this->validator->validate($teamer, null, ['profile_preflight']);
$form = $this->createForm(TeamerProfileType::class, $teamer, ['upload_session' => $uploadSession]);
$form = $this->createForm(TeamerProfileType::class, $teamer, [
'upload_session' => $uploadSession,
'admin_mode' => $this->isGranted('IS_IMPERSONATOR'),
]);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
@@ -59,7 +59,11 @@ class SkillsController extends AbstractController
$selectableJobProfiles[$profile->getId()] = $requiredTrainingsSatisfied && $requiredLicensesSatisfied;
}
$form = $this->createForm(TeamerJobProfileType::class, $teamer, ['job_profiles' => $jobProfiles, 'selectable_job_profiles' => $selectableJobProfiles]);
$form = $this->createForm(TeamerJobProfileType::class, $teamer, [
'job_profiles' => $jobProfiles,
'selectable_job_profiles' => $selectableJobProfiles,
'admin_mode' => $this->isGranted('IS_IMPERSONATOR'),
]);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {