WIP: Adjust model, remove manager branch in navigation

This commit is contained in:
Björn Fromme
2023-10-07 17:34:40 +02:00
parent 25a90b04aa
commit 8740041e7a
30 changed files with 302 additions and 152 deletions
@@ -5,10 +5,12 @@ namespace App\Controller\Admin\Application;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class IndexController extends AbstractController
{
#[Route('/admin/application', name: 'app_admin_application_index')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(): Response
{
return $this->render('admin/application/index.html.twig');
@@ -5,10 +5,12 @@ namespace App\Controller\Admin\Document;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class IndexController extends AbstractController
{
#[Route('/admin/document', name: 'app_admin_document_index')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(): Response
{
return $this->render('admin/document/index.html.twig');
+1 -1
View File
@@ -10,7 +10,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
class IndexController extends AbstractController
{
#[Route('/admin', name: 'app_admin_index')]
#[IsGranted('ROLE_ADMIN')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(): Response
{
return $this->render('admin/index.html.twig');
@@ -19,7 +19,7 @@ class IndexController extends AbstractController
}
#[Route('/admin/teamer', name: 'app_admin_teamer_index')]
#[IsGranted('ROLE_ADMIN')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Request $request): Response
{
$query = $this
@@ -1,19 +0,0 @@
<?php
namespace App\Controller\Common\Assignment;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class CreateController extends AbstractController
{
#[Route('/assignment/create', name: 'app_common_assignment_create')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Request $request): Response
{
}
}
@@ -1,18 +0,0 @@
<?php
namespace App\Controller\Manager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class IndexController extends AbstractController
{
#[Route('/manager', name: 'app_manager_index')]
#[IsGranted('ROLE_MANAGER')]
public function index(): Response
{
return $this->render('manager/index.html.twig');
}
}
@@ -2,6 +2,7 @@
namespace App\Controller\Teamer\Profile;
use App\Entity\JobProfile;
use App\Entity\User;
use App\Form\TeamerJobProfileType;
use App\Repository\JobProfileRepository;
@@ -34,15 +35,21 @@ class SkillsController extends AbstractController
$selectableJobProfiles = [];
foreach ($jobProfiles as $profile) {
$selectableJobProfiles[$profile->getId()] = true;
if (null !== $profile->getRequiredTraining() && null === $teamer->getTrainingAttendance($profile->getRequiredTraining())) {
$selectableJobProfiles[$profile->getId()] = false;
}
foreach ($profile->getRequiredLicenses() as $license) {
if (null === $teamer->getLicenseOfType($license)) {
$selectableJobProfiles[$profile->getId()] = false;
/** @var JobProfile $profile */
$jobProfileIsSelectable = false;
foreach ($profile->getRequiredTrainings() as $training) {
if (null !== $teamer->getTrainingAttendance($training)) {
$jobProfileIsSelectable = true;
break;
}
}
foreach ($profile->getRequiredLicenses() as $license) {
if (null !== $teamer->getLicenseOfType($license)) {
$jobProfileIsSelectable = true;
break;
}
}
$selectableJobProfiles[$profile->getId()] = $jobProfileIsSelectable;
}
$form = $this->createForm(TeamerJobProfileType::class, $teamer, ['job_profiles' => $jobProfiles, 'selectable_job_profiles' => $selectableJobProfiles]);