diff --git a/migrations/Version20231012132143.php b/migrations/Version20231012132143.php new file mode 100644 index 0000000..0e894b8 --- /dev/null +++ b/migrations/Version20231012132143.php @@ -0,0 +1,36 @@ +addSql('ALTER TABLE disposition ADD status VARCHAR(64) NOT NULL'); + } + + public function postUp(Schema $schema): void + { + $this->connection->executeQuery('UPDATE disposition SET status=\'new\''); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE disposition DROP status'); + } +} diff --git a/src/Controller/Admin/Assignment/DetailController.php b/src/Controller/Admin/Assignment/DetailController.php index 2925fbd..a070847 100644 --- a/src/Controller/Admin/Assignment/DetailController.php +++ b/src/Controller/Admin/Assignment/DetailController.php @@ -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'), ]); } diff --git a/src/Entity/Disposition.php b/src/Entity/Disposition.php index 5dd5b78..e1079f1 100644 --- a/src/Entity/Disposition.php +++ b/src/Entity/Disposition.php @@ -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; diff --git a/src/Form/TeamerJobProfileType.php b/src/Form/TeamerJobProfileType.php index 46d4960..182584c 100644 --- a/src/Form/TeamerJobProfileType.php +++ b/src/Form/TeamerJobProfileType.php @@ -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) { diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 566b82a..cc490a1 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -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 diff --git a/templates/_partials/_assignment_info_compact.html.twig b/templates/_partials/_assignment_info_compact.html.twig new file mode 100644 index 0000000..c0fa15b --- /dev/null +++ b/templates/_partials/_assignment_info_compact.html.twig @@ -0,0 +1,49 @@ +
| + Name + | ++ Anmerkungen + | ++ Status + | ++ | ||||
|---|---|---|---|---|---|---|---|
| - Name - | -- Anmerkungen - | -- Status - | -+ | + + {{ application.teamer }} + + | ++ {{ application.requests|nl2br|default('-') }} + | ++ {{ ('label.application.status.' ~ application.status)|trans }} + | +
+
+ {% if is_granted('DISPOSE', application) %}
+
+ {% endif %}
+ {% if is_granted('REJECT', application) %}
+
+ {% endif %}
+ {% if is_granted('DELETE', application) %}
+
+ {% endif %}
+
+ |
| - - {{ application.teamer }} - - | -- {{ application.requests|nl2br|default('-') }} - | -- {{ ('label.application.status.' ~ application.status)|trans }} - | -
-
- {% if is_granted('DISPOSE', application) %}
-
- {% endif %}
- {% if is_granted('REJECT', application) %}
-
- {% endif %}
- {% if is_granted('DELETE', application) %}
-
- {% endif %}
-
- |
- ||||
| - Bisher liegen keine Bewerbungen vor... - | -|||||||
| + Name + | ++ Anmerkungen + | ++ Status + | ++ |
|---|---|---|---|
| + + {{ disposition.teamer }} + + | ++ {{ disposition.remarks|nl2br|default('-') }} + | ++ {{ ('label.disposition.status.' ~ disposition.status)|trans }} + | +
+
+
+ |
+
| + Es gibt noch keine Einteilungen... + | +|||