WIP: Implement disposition process

This commit is contained in:
Björn Fromme
2023-10-12 15:34:29 +02:00
parent 4b7afb109d
commit 191619c451
8 changed files with 260 additions and 93 deletions
@@ -5,6 +5,7 @@ namespace App\Controller\Admin\Assignment;
use App\Controller\Traits\ReturnUrlTrait;
use App\Entity\Assignment;
use App\Repository\ApplicationRepository;
use App\Repository\DispositionRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -15,8 +16,11 @@ class DetailController extends AbstractController
{
use ReturnUrlTrait;
public function __construct(private readonly ApplicationRepository $applicationRepository)
{}
public function __construct(
private readonly ApplicationRepository $applicationRepository,
private readonly DispositionRepository $dispositionRepository
) {
}
#[Route('/admin/assignment/detail/{uuid}', name: 'app_admin_assignment_detail')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
@@ -26,9 +30,14 @@ class DetailController extends AbstractController
'assignment' => $assignment,
]);
$dispositions = $this->dispositionRepository->findBy([
'assignment' => $assignment,
]);
return $this->render('admin/assignment/detail.html.twig', [
'assignment' => $assignment,
'applications' => $applications,
'dispositions' => $dispositions,
'returnUrl' => $this->getReturnUrl($request, 'app_admin_assignment_index'),
]);
}
+20
View File
@@ -15,6 +15,10 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
use BlameableEntity;
use TimestampableEntity;
public const STATUS_NEW = 'new';
public const STATUS_PENDING = 'pending';
public const STATUS_CONFIRMED = 'confirmed';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
@@ -23,6 +27,9 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(length: 64)]
private ?string $status;
#[ORM\ManyToOne(inversedBy: 'dispositions')]
private ?Assignment $assignment;
@@ -41,6 +48,7 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
public function __construct(Application $application)
{
$this->uuid = Uuid::v4();
$this->status = static::STATUS_NEW;
$this->assignment = $application->getAssignment();
$this->teamer = $application->getTeamer();
$this->remarks = $application->getRemarks();
@@ -56,6 +64,18 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
return $this->uuid;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): static
{
$this->status = $status;
return $this;
}
public function getAssignment(): ?Assignment
{
return $this->assignment;
+1 -1
View File
@@ -31,7 +31,7 @@ class TeamerJobProfileType extends AbstractType
$requirements[] = $training->getName();
}
foreach ($choice->getRequiredLicenses() as $license) {
$requirements[] = sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($license)));
$requirements[] = sprintf('Offizielle %slehrer:innenlizenz', ucfirst(strtolower($license)));
}
if ($requirements) {
+1 -1
View File
@@ -33,7 +33,7 @@ class AppRuntime implements RuntimeExtensionInterface
public function licenseLabel(string $type): string
{
return sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($type)));
return sprintf('Offizielle %slehrer:innenlizenz', ucfirst(strtolower($type)));
}
public function bpnCountryLabel(?string $token, string $property = 'name'): string