From a04e4a78a4c9af11a1bbc7bd8644255493cbaeeb Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sat, 27 Jun 2020 17:47:49 +0200 Subject: [PATCH 01/15] Add new feature: Assign Items Add controller AssignController.php add service AssignService.php and Form to assign user to items in edit form --- src/Controller/AssignController.php | 41 ++++++++++++++ src/Controller/AuditTomController.php | 6 +- src/Controller/VvtController.php | 8 ++- src/Entity/AuditTom.php | 17 ++++++ src/Entity/User.php | 74 ++++++++++++++++++++++++ src/Entity/VVT.php | 17 ++++++ src/Form/Type/AssignType.php | 43 ++++++++++++++ src/Service/AssignService.php | 82 +++++++++++++++++++++++++++ templates/assign/__assign.html.twig | 15 +++++ templates/assign/index.html.twig | 33 +++++++++++ templates/audit_tom/edit.html.twig | 9 ++- templates/vvt/edit.html.twig | 14 ++++- 12 files changed, 352 insertions(+), 7 deletions(-) create mode 100644 src/Controller/AssignController.php create mode 100644 src/Form/Type/AssignType.php create mode 100644 src/Service/AssignService.php create mode 100644 templates/assign/__assign.html.twig create mode 100644 templates/assign/index.html.twig diff --git a/src/Controller/AssignController.php b/src/Controller/AssignController.php new file mode 100644 index 00000000..24f5c7e7 --- /dev/null +++ b/src/Controller/AssignController.php @@ -0,0 +1,41 @@ +render('assign/index.html.twig', [ + 'controller_name' => 'AssignController', + ]); + } + + /** + * @Route("/assign/vvt", name="assign_vvt") + */ + public function assignVvt(Request $request, AssignService $assignService) + { + + $res = $assignService->assignVvt($request); + return $this->redirect($request->headers->get('referer')); + } + + /** + * @Route("/assign/audit", name="assign_audit") + */ + public function assignAudit(Request $request, AssignService $assignService) + { + + $res = $assignService->assignAudit($request); + return $this->redirect($request->headers->get('referer')); + } +} diff --git a/src/Controller/AuditTomController.php b/src/Controller/AuditTomController.php index a5f37ace..46b42289 100644 --- a/src/Controller/AuditTomController.php +++ b/src/Controller/AuditTomController.php @@ -13,6 +13,7 @@ use App\Entity\AuditTomStatus; use App\Entity\AuditTomZiele; use App\Form\Type\AuditTomType; +use App\Service\AssignService; use App\Service\SecurityService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; @@ -87,7 +88,7 @@ public function addAuditTom(ValidatorInterface $validator, Request $request, Sec /** * @Route("/audit-tom/edit", name="audit_tom_edit") */ - public function EditAuditTom(ValidatorInterface $validator, Request $request, SecurityService $securityService) + public function EditAuditTom(ValidatorInterface $validator, Request $request, SecurityService $securityService, AssignService $assignService) { $team = $this->getUser()->getTeam(); $audit = $this->getDoctrine()->getRepository(AuditTom::class)->find($request->get('tom')); @@ -126,6 +127,8 @@ public function EditAuditTom(ValidatorInterface $validator, Request $request, Se $form = $this->createForm(AuditTomType::class, $newAudit, ['abteilungen' => $abteilungen, 'ziele' => $ziele, 'status' => $status]); $form->remove('nummer'); $form->handleRequest($request); + $assign = $assignService->createForm($audit, $team); + $errors = array(); if ($form->isSubmitted() && $form->isValid()) { $audit->setActiv(false); @@ -142,6 +145,7 @@ public function EditAuditTom(ValidatorInterface $validator, Request $request, Se } return $this->render('audit_tom/edit.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'A-Frage bearbeiten', 'audit' => $audit, diff --git a/src/Controller/VvtController.php b/src/Controller/VvtController.php index e6ed527a..8fdf87d1 100644 --- a/src/Controller/VvtController.php +++ b/src/Controller/VvtController.php @@ -11,6 +11,7 @@ use App\Entity\VVT; use App\Entity\VVTDsfa; use App\Form\Type\VvtDsfaType; +use App\Service\AssignService; use App\Service\SecurityService; use App\Service\VVTService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -79,7 +80,7 @@ public function addVvt(ValidatorInterface $validator, Request $request, VVTServi /** * @Route("/vvt/edit", name="vvt_edit") */ - public function editVvt(ValidatorInterface $validator, Request $request, VVTService $VVTService, SecurityService $securityService) + public function editVvt(ValidatorInterface $validator, Request $request, VVTService $VVTService, SecurityService $securityService, AssignService $assignService) { $team = $this->getUser()->getTeam(); $vvt = $this->getDoctrine()->getRepository(VVT::class)->find($request->get('id')); @@ -87,12 +88,12 @@ public function editVvt(ValidatorInterface $validator, Request $request, VVTServ if ($securityService->teamDataCheck($vvt, $team) === false) { return $this->redirectToRoute('vvt'); } - $newVvt = $VVTService->cloneVvt($vvt, $this->getUser()); $form = $VVTService->createForm($newVvt, $team); - $form->remove('nummer'); $form->handleRequest($request); + $assign = $assignService->createForm($vvt, $team); + $errors = array(); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); @@ -117,6 +118,7 @@ public function editVvt(ValidatorInterface $validator, Request $request, VVTServ return $this->render('vvt/edit.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Verarbeitungstätigkeit bearbeiten', 'vvt' => $vvt, diff --git a/src/Entity/AuditTom.php b/src/Entity/AuditTom.php index 39365cf3..9d31877f 100644 --- a/src/Entity/AuditTom.php +++ b/src/Entity/AuditTom.php @@ -115,6 +115,11 @@ class AuditTom */ private $kategorie; + /** + * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedAudits") + */ + private $assignedUser; + public function __construct() { $this->ziele = new ArrayCollection(); @@ -333,4 +338,16 @@ public function setKategorie(string $kategorie): self return $this; } + + public function getAssignedUser(): ?User + { + return $this->assignedUser; + } + + public function setAssignedUser(?User $assignedUser): self + { + $this->assignedUser = $assignedUser; + + return $this; + } } diff --git a/src/Entity/User.php b/src/Entity/User.php index 1c3967ed..c70aafa4 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -85,6 +85,16 @@ class User extends BaseUser */ private $akademieKurses; + /** + * @ORM\OneToMany(targetEntity=VVT::class, mappedBy="assignedUser") + */ + private $assignedVvts; + + /** + * @ORM\OneToMany(targetEntity=AuditTom::class, mappedBy="assignedUser") + */ + private $assignedAudits; + public function __construct() { @@ -97,6 +107,8 @@ public function __construct() $this->toms = new ArrayCollection(); $this->vorfalls = new ArrayCollection(); $this->akademieKurses = new ArrayCollection(); + $this->assignedVvts = new ArrayCollection(); + $this->assignedAudits = new ArrayCollection(); } public function getTeam(): ?Team @@ -383,4 +395,66 @@ public function removeAkademieKurse(AkademieKurse $akademieKurse): self return $this; } + /** + * @return Collection|VVT[] + */ + public function getAssignedVvts(): Collection + { + return $this->assignedVvts; + } + + public function addAssignedVvt(VVT $assignedVvt): self + { + if (!$this->assignedVvts->contains($assignedVvt)) { + $this->assignedVvts[] = $assignedVvt; + $assignedVvt->setAssignedUser($this); + } + + return $this; + } + + public function removeAssignedVvt(VVT $assignedVvt): self + { + if ($this->assignedVvts->contains($assignedVvt)) { + $this->assignedVvts->removeElement($assignedVvt); + // set the owning side to null (unless already changed) + if ($assignedVvt->getAssignedUser() === $this) { + $assignedVvt->setAssignedUser(null); + } + } + + return $this; + } + + /** + * @return Collection|AuditTom[] + */ + public function getAssignedAudits(): Collection + { + return $this->assignedAudits; + } + + public function addAssignedAudit(AuditTom $assignedAudit): self + { + if (!$this->assignedAudits->contains($assignedAudit)) { + $this->assignedAudits[] = $assignedAudit; + $assignedAudit->setAssignedUser($this); + } + + return $this; + } + + public function removeAssignedAudit(AuditTom $assignedAudit): self + { + if ($this->assignedAudits->contains($assignedAudit)) { + $this->assignedAudits->removeElement($assignedAudit); + // set the owning side to null (unless already changed) + if ($assignedAudit->getAssignedUser() === $this) { + $assignedAudit->setAssignedUser(null); + } + } + + return $this; + } + } diff --git a/src/Entity/VVT.php b/src/Entity/VVT.php index e983e3df..223d8cf9 100644 --- a/src/Entity/VVT.php +++ b/src/Entity/VVT.php @@ -205,6 +205,11 @@ class VVT private $beurteilungEintrittString; private $beurteilungSchadenString; + /** + * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedVvts") + */ + private $assignedUser; + public function __construct() { $this->grundlage = new ArrayCollection(); @@ -757,4 +762,16 @@ public function removeProdukt(Produkte $produkt): self return $this; } + + public function getAssignedUser(): ?User + { + return $this->assignedUser; + } + + public function setAssignedUser(?User $assignedUser): self + { + $this->assignedUser = $assignedUser; + + return $this; + } } diff --git a/src/Form/Type/AssignType.php b/src/Form/Type/AssignType.php new file mode 100644 index 00000000..41a50b17 --- /dev/null +++ b/src/Form/Type/AssignType.php @@ -0,0 +1,43 @@ +add('user', EntityType::class, [ + 'choice_label' => 'email', + 'class' => User::class, + 'choices' => $options['user'], + 'label' => 'Elemtent zuweisen', + 'translation_domain' => 'form', + 'multiple' => false, + 'required' => false + ]) + ->add('submit', SubmitType::class, ['attr' => array('class' => 'btn btn-outline-primary btn-sm'), 'label' => 'Zuweisen', 'translation_domain' => 'form']); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'user' => array(), + ]); + + } +} diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php new file mode 100644 index 00000000..691ffb27 --- /dev/null +++ b/src/Service/AssignService.php @@ -0,0 +1,82 @@ +em = $entityManager; + $this->formBuilder = $formBuilder; + $this->router = $router; + } + + function createForm($data, Team $team) + { + $form = $this->formBuilder->create(AssignType::class, $data, ['user' => $team->getMembers()]); + return $form; + } + + function assignVvt($request) + { + try { + $vvt = $this->em->getRepository(VVT::class)->find($request->get('id')); + + if ($vvt->getAssignedUser() == null) { + $data = $request->get('assign'); + $user = $this->em->getRepository(User::class)->find($data['user']); + $vvt->setAssignedUser($user); + } else { + $vvt->setAssignedUser(null); + } + $this->em->persist($vvt); + $this->em->flush(); + + return true; + } catch (\Exception $exception) { + return false; + } + } + + function assignAudit($request) + { + try { + $audit = $this->em->getRepository(AuditTom::class)->find($request->get('id')); + + if ($audit->getAssignedUser() == null) { + $data = $request->get('assign'); + $user = $this->em->getRepository(User::class)->find($data['user']); + $audit->setAssignedUser($user); + } else { + $audit->setAssignedUser(null); + } + $this->em->persist($audit); + $this->em->flush(); + + return true; + } catch (\Exception $exception) { + return false; + } + } +} diff --git a/templates/assign/__assign.html.twig b/templates/assign/__assign.html.twig new file mode 100644 index 00000000..5e5351af --- /dev/null +++ b/templates/assign/__assign.html.twig @@ -0,0 +1,15 @@ +{% if data.assignedUser is null %} + {{ form_start(assignForm,{'action': path(path,{'id':data.id})}) }} +
+
+ {{ form_widget(assignForm.user) }} +
+
+ {{ form_widget(assignForm.submit) }} +
+
+ {{ form_end(assignForm) }} +{% else %} + {{ data.assignedUser.email }} Zuweisung + entfernen +{% endif %} \ No newline at end of file diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig new file mode 100644 index 00000000..f155579e --- /dev/null +++ b/templates/assign/index.html.twig @@ -0,0 +1,33 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello AssignController!{% endblock %} + +{% block body %} + + +
+

Hello {{ controller_name }}! ✅

+ + This friendly message is coming from: + +
+{% endblock %} diff --git a/templates/audit_tom/edit.html.twig b/templates/audit_tom/edit.html.twig index c3ce0e84..6f9e11af 100644 --- a/templates/audit_tom/edit.html.twig +++ b/templates/audit_tom/edit.html.twig @@ -12,8 +12,15 @@ {% endblock %} {% block body %} +
+
+

{{ title }} (Nummer: {{ audit.nummer }})

+
+
+ {{ include('assign/__assign.html.twig',{'data':audit,'path':'assign_audit'}) }} +
+
-

{{ title }} (Nummer: {{ audit.nummer }})

{{ include('audit_tom/__form.html.twig') }}
diff --git a/templates/vvt/edit.html.twig b/templates/vvt/edit.html.twig index bea214f1..8c61a65b 100644 --- a/templates/vvt/edit.html.twig +++ b/templates/vvt/edit.html.twig @@ -24,8 +24,18 @@ {% endblock %} {% block body %} -

{{ title }} {% if not activNummer %} id: {{ vvt.nummer }}{% endif %}

- {% if vvt.activDsfa is not null %}

Datenschutzfolgeabschätzung vorhanden

{% endif %} +
+
+

{{ title }} {% if not activNummer %} id: {{ vvt.nummer }}{% endif %}

+ {% if vvt.activDsfa is not null %}

Datenschutzfolgeabschätzung vorhanden

{% endif %} +
+
+ {{ include('assign/__assign.html.twig',{'data':vvt,'path':'assign_vvt'}) }} +
+
+ + {{ include('vvt/__form.html.twig') }}

Erstellt von: {{ vvt.user.email }}

{% if vvt.previous %} From dc332d94b9d6fde5d3fe4b719256a2e8edd570ac Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 00:21:46 +0200 Subject: [PATCH 02/15] Add assignments to dashboard and own view render for all assignments of the user --- public/icons/prozess.svg | 14 +++++++ public/icons/pruefung.svg | 3 ++ src/Controller/AssignController.php | 28 ++++++++++--- src/Controller/DashboardController.php | 10 ++++- src/Service/AssignService.php | 14 ++++--- templates/assign/__assign.html.twig | 4 +- templates/assign/index.html.twig | 58 ++++++++++++++------------ templates/base/__sidenav.html.twig | 3 ++ templates/dashboard/index.html.twig | 38 +++++++++++++++++ 9 files changed, 130 insertions(+), 42 deletions(-) create mode 100644 public/icons/prozess.svg create mode 100644 public/icons/pruefung.svg diff --git a/public/icons/prozess.svg b/public/icons/prozess.svg new file mode 100644 index 00000000..cdd08ff7 --- /dev/null +++ b/public/icons/prozess.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/icons/pruefung.svg b/public/icons/pruefung.svg new file mode 100644 index 00000000..3290c45d --- /dev/null +++ b/public/icons/pruefung.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Controller/AssignController.php b/src/Controller/AssignController.php index 24f5c7e7..b894d1aa 100644 --- a/src/Controller/AssignController.php +++ b/src/Controller/AssignController.php @@ -2,7 +2,11 @@ namespace App\Controller; +use App\Entity\AuditTom; +use App\Entity\VVT; use App\Service\AssignService; +use App\Service\SecurityService; +use Doctrine\Common\Collections\ArrayCollection; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -14,28 +18,42 @@ class AssignController extends AbstractController */ public function index() { + $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); + $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); + $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); + return $this->render('assign/index.html.twig', [ - 'controller_name' => 'AssignController', + 'assign' => $assign ]); } /** * @Route("/assign/vvt", name="assign_vvt") */ - public function assignVvt(Request $request, AssignService $assignService) + public function assignVvt(Request $request, AssignService $assignService, SecurityService $securityService) { + $team = $this->getUser()->getTeam(); + $vvt = $this->getDoctrine()->getRepository(VVT::class)->find($request->get('id')); + if ($securityService->teamDataCheck($vvt, $team) === false) { + return $this->redirectToRoute('vvt'); + } - $res = $assignService->assignVvt($request); + $res = $assignService->assignVvt($request, $vvt); return $this->redirect($request->headers->get('referer')); } /** * @Route("/assign/audit", name="assign_audit") */ - public function assignAudit(Request $request, AssignService $assignService) + public function assignAudit(Request $request, AssignService $assignService, SecurityService $securityService) { + $team = $this->getUser()->getTeam(); + $audit = $this->getDoctrine()->getRepository(AuditTom::class)->find($request->get('id')); + if ($securityService->teamDataCheck($audit, $team) === false) { + return $this->redirectToRoute('audit_tom'); + } - $res = $assignService->assignAudit($request); + $res = $assignService->assignAudit($request, $audit); return $this->redirect($request->headers->get('referer')); } } diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index dce20f33..c6f25df7 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -14,6 +14,7 @@ use App\Entity\Tom; use App\Entity\VVT; use App\Entity\VVTDsfa; +use Doctrine\Common\Collections\ArrayCollection; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; @@ -59,7 +60,7 @@ public function dashboard() $kristischeVvts = $query->getResult(); $qb = $this->getDoctrine()->getRepository(VVTDsfa::class)->createQueryBuilder('dsfa'); - $qb->innerJoin('dsfa.vvt','vvt') + $qb->innerJoin('dsfa.vvt', 'vvt') ->andWhere('vvt.activ = 1') ->andWhere('dsfa.activ = 1') ->andWhere('dsfa.dsb IS NULL OR dsfa.ergebnis IS NULL') @@ -68,6 +69,10 @@ public function dashboard() $query = $qb->getQuery(); $openDsfa = $query->getResult(); + $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); + $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); + $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); + return $this->render('dashboard/index.html.twig', [ 'controller_name' => 'DashboardController', 'team' => $team, @@ -80,7 +85,8 @@ public function dashboard() 'kVvt' => $kristischeVvts, 'openDsfa' => $openDsfa, 'tom' => $tom, - 'av' => $av + 'av' => $av, + 'assign' => $assign ]); } } diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php index 691ffb27..58ee8aad 100644 --- a/src/Service/AssignService.php +++ b/src/Service/AssignService.php @@ -38,15 +38,16 @@ function createForm($data, Team $team) return $form; } - function assignVvt($request) + function assignVvt($request, VVT $vvt) { try { - $vvt = $this->em->getRepository(VVT::class)->find($request->get('id')); if ($vvt->getAssignedUser() == null) { $data = $request->get('assign'); $user = $this->em->getRepository(User::class)->find($data['user']); - $vvt->setAssignedUser($user); + if ($vvt->getTeam() === $user->getTeam()) { + $vvt->setAssignedUser($user); + } } else { $vvt->setAssignedUser(null); } @@ -59,15 +60,16 @@ function assignVvt($request) } } - function assignAudit($request) + function assignAudit($request, AuditTom $audit) { try { - $audit = $this->em->getRepository(AuditTom::class)->find($request->get('id')); if ($audit->getAssignedUser() == null) { $data = $request->get('assign'); $user = $this->em->getRepository(User::class)->find($data['user']); - $audit->setAssignedUser($user); + if ($audit->getTeam() === $user->getTeam()) { + $audit->setAssignedUser($user); + } } else { $audit->setAssignedUser(null); } diff --git a/templates/assign/__assign.html.twig b/templates/assign/__assign.html.twig index 5e5351af..5f9ed71b 100644 --- a/templates/assign/__assign.html.twig +++ b/templates/assign/__assign.html.twig @@ -10,6 +10,6 @@ {{ form_end(assignForm) }} {% else %} - {{ data.assignedUser.email }} Zuweisung - entfernen + {{ data.assignedUser.email }} X {% endif %} \ No newline at end of file diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig index f155579e..03977d13 100644 --- a/templates/assign/index.html.twig +++ b/templates/assign/index.html.twig @@ -1,33 +1,37 @@ {% extends 'base.html.twig' %} -{% block title %}Hello AssignController!{% endblock %} +{% block CTA %} +{% endblock %} {% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: - +

Meine Zuweisungen

+ {% endblock %} diff --git a/templates/base/__sidenav.html.twig b/templates/base/__sidenav.html.twig index 10173902..2d273519 100644 --- a/templates/base/__sidenav.html.twig +++ b/templates/base/__sidenav.html.twig @@ -9,6 +9,9 @@
  • Dashboard
  • +
  • + Meine Zuweisungen +
  • {% endif %} {% if app.user.akademieUser %}
  • diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index d007af16..07acea6d 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -117,6 +117,44 @@ + + + +
    Letzte Änderungen From 16e0238e87151b55591adaa93939b510f5a09347 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 08:48:45 +0200 Subject: [PATCH 03/15] Change Dashboard assignments --- templates/dashboard/index.html.twig | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index 07acea6d..76f5b395 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -119,33 +119,33 @@
    - Offene Aufgaben + Meine Zuweisungen
    {% for a in assign|slice(0, 9) %} {% if a.activ == 1 %} - -
    - From 03d023d44beea7475b0ee59988d66961c1f7aad7 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 09:26:32 +0200 Subject: [PATCH 04/15] Add Snack notifiaction by edit --- config/packages/oneup_flysystem.yaml | 2 +- config/packages/vich_uploader.yaml | 2 +- config/services.yaml | 2 +- src/Controller/DatenweitergabeController.php | 17 +++++------- src/Controller/VvtController.php | 8 +++--- src/Entity/Datenweitergabe.php | 28 ++++++++++---------- src/Form/Type/DatenweitergabeType.php | 8 +++--- templates/base/__snack.html.twig | 3 +++ templates/datenweitergabe/__form.html.twig | 12 ++++----- templates/datenweitergabe/edit.html.twig | 2 +- templates/vvt/edit.html.twig | 2 ++ 11 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 templates/base/__snack.html.twig diff --git a/config/packages/oneup_flysystem.yaml b/config/packages/oneup_flysystem.yaml index 6fa3b024..93397a80 100644 --- a/config/packages/oneup_flysystem.yaml +++ b/config/packages/oneup_flysystem.yaml @@ -3,7 +3,7 @@ oneup_flysystem: adapters: asset_adapter: local: - directory: '%kernel.project_dir%/public%app.path.product_images%' + directory: '%kernel.project_dir%/public%app.path.images%' intern_adapter: local: directory: '%kernel.project_dir%/data' diff --git a/config/packages/vich_uploader.yaml b/config/packages/vich_uploader.yaml index 805ae381..344aa281 100644 --- a/config/packages/vich_uploader.yaml +++ b/config/packages/vich_uploader.yaml @@ -3,7 +3,7 @@ vich_uploader: storage: flysystem mappings: profil_picture: - uri_prefix: '%app.path.product_images%' + uri_prefix: '%app.path.images%' upload_destination: intern_adapter namer: vich_uploader.namer_uniqid delete_on_update: true diff --git a/config/services.yaml b/config/services.yaml index 62138117..75f9f9e9 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,7 +4,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: - app.path.product_images: /uploads/images/products + app.path.images: /uploads/images/products secret: '%env(APP_SECRET)%' projectRoot: '%kernel.root_dir%' akademieEmail: '%env(AKADEMIE_EMAIL)%' diff --git a/src/Controller/DatenweitergabeController.php b/src/Controller/DatenweitergabeController.php index fd10fe41..42e18e6d 100644 --- a/src/Controller/DatenweitergabeController.php +++ b/src/Controller/DatenweitergabeController.php @@ -175,11 +175,7 @@ public function EditDatenweitergabe(ValidatorInterface $validator, Request $requ $em->persist($newDaten); $em->persist($daten); $em->flush(); - if ($newDaten->getArt() === 1) { - return $this->redirectToRoute('datenweitergabe'); - } else { - return $this->redirectToRoute('auftragsverarbeitung'); - } + return $this->redirectToRoute('datenweitergabe_edit', array('id' => $newDaten->getId(), 'snack' => 'Erfolgreich gespeichert')); } } return $this->render('datenweitergabe/edit.html.twig', [ @@ -188,7 +184,8 @@ public function EditDatenweitergabe(ValidatorInterface $validator, Request $requ 'title' => 'Datenweitergabe bearbeiten', 'daten' => $daten, 'activ' => $daten->getActiv(), - 'activNummer' => false + 'activNummer' => false, + 'snack' => $request->get('snack') ]); } @@ -199,19 +196,19 @@ public function EditDatenweitergabe(ValidatorInterface $validator, Request $requ public function downloadArticleReference(FilesystemInterface $internFileSystem, Datenweitergabe $datenweitergabe, SecurityService $securityService) { - $stream = $internFileSystem->read($datenweitergabe->getImage()); + $stream = $internFileSystem->read($datenweitergabe->getUpload()); $team = $this->getUser()->getTeam(); - if ($securityService->teamCheck($team) === false) { + if ($securityService->teamDataCheck($datenweitergabe, $team) === false) { return $this->redirectToRoute('dashboard'); } - $type = $internFileSystem->getMimetype($datenweitergabe->getImage()); + $type = $internFileSystem->getMimetype($datenweitergabe->getUpload()); $response = new Response($stream); $response->headers->set('Content-Type', $type); $disposition = HeaderUtils::makeDisposition( HeaderUtils::DISPOSITION_ATTACHMENT, - preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $datenweitergabe->getImage()) + preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $datenweitergabe->getUpload()) ); $response->headers->set('Content-Disposition', $disposition); diff --git a/src/Controller/VvtController.php b/src/Controller/VvtController.php index 8fdf87d1..18c71c13 100644 --- a/src/Controller/VvtController.php +++ b/src/Controller/VvtController.php @@ -112,7 +112,7 @@ public function editVvt(ValidatorInterface $validator, Request $request, VVTServ $em->persist($newVvt); $em->persist($vvt); $em->flush(); - return $this->redirectToRoute('vvt'); + return $this->redirectToRoute('vvt_edit', ['id' => $newVvt->getId(), 'snack' => 'Erfolgreich gespeichert']); } } @@ -124,6 +124,7 @@ public function editVvt(ValidatorInterface $validator, Request $request, VVTServ 'vvt' => $vvt, 'activ' => $vvt->getActiv(), 'activNummer' => false, + 'snack' => $request->get('snack') ]); } @@ -153,7 +154,7 @@ public function newVvtDsfa(ValidatorInterface $validator, Request $request, VVTS $em = $this->getDoctrine()->getManager(); $em->persist($dsfa); $em->flush(); - return $this->redirectToRoute('vvt'); + return $this->redirectToRoute('vvt_edit', ['id' => $dsfa->getVvt()->getId(), 'snack' => 'DSFA angelegt']); } } return $this->render('vvt/editDsfa.html.twig', [ @@ -192,7 +193,7 @@ public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVT $em->persist($newDsfa); $em->persist($dsfa); $em->flush(); - return $this->redirectToRoute('vvt'); + return $this->redirectToRoute('vvt_dsfa_edit', ['id' => $newDsfa->getId(), 'snack' => 'Erfolgreich gepeichert']); } } @@ -202,6 +203,7 @@ public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVT 'title' => 'Datenschutzfolgeabschätzung bearbeiten', 'dsfa' => $dsfa, 'activ' => $dsfa->getActiv(), + 'snack' => $request->get('snack') ]); } } diff --git a/src/Entity/Datenweitergabe.php b/src/Entity/Datenweitergabe.php index 19fa4ce5..15851f72 100644 --- a/src/Entity/Datenweitergabe.php +++ b/src/Entity/Datenweitergabe.php @@ -2,14 +2,14 @@ namespace App\Entity; +use Ambta\DoctrineEncryptBundle\Configuration\Encrypted; use App\Repository\DatenweitergabeRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\Validator\Constraints as Assert; use Vich\UploaderBundle\Mapping\Annotation as Vich; -use Symfony\Component\HttpFoundation\File\File; -use Ambta\DoctrineEncryptBundle\Configuration\Encrypted; /** * @ORM\Entity(repositoryClass=DatenweitergabeRepository::class) @@ -123,13 +123,13 @@ class Datenweitergabe * @ORM\Column(type="string", length=255,nullable=true) * @var string */ - private $image; + private $upload; /** - * @Vich\UploadableField(mapping="profil_picture", fileNameProperty="image") + * @Vich\UploadableField(mapping="profil_picture", fileNameProperty="upload") * @var File */ - private $imageFile; + private $uploadFile; /** * @ORM\ManyToMany(targetEntity=VVT::class, mappedBy="datenweitergaben") @@ -316,32 +316,32 @@ public function setUser(?User $user): self return $this; } - public function setImageFile(File $image = null) + public function setUploadFile(File $upload = null) { - $this->imageFile = $image; + $this->uploadFile = $upload; // VERY IMPORTANT: // It is required that at least one field changes if you are using Doctrine, // otherwise the event listeners won't be called and the file is lost - if ($image) { + if ($upload) { // if 'updatedAt' is not defined in your entity, use another property $this->updatedAt = new \DateTime('now'); } } - public function getImageFile() + public function getUploadFile() { - return $this->imageFile; + return $this->uploadFile; } - public function setImage($image) + public function setUpload($upload) { - $this->image = $image; + $this->upload = $upload; } - public function getImage() + public function getUpload() { - return $this->image; + return $this->upload; } public function getUpdatedAt(): ?\DateTimeInterface diff --git a/src/Form/Type/DatenweitergabeType.php b/src/Form/Type/DatenweitergabeType.php index 6e59c033..b7e4d4e6 100644 --- a/src/Form/Type/DatenweitergabeType.php +++ b/src/Form/Type/DatenweitergabeType.php @@ -57,17 +57,17 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'choices' => $options['stand'], 'label'=>'Stand der Verhandlung', 'translation_domain' => 'form', - 'multiple' =>false, + 'multiple' => false, ]) ->add('grundlage', EntityType::class, [ 'choice_label' => 'name', 'class' => DatenweitergabeGrundlagen::class, 'choices' => $options['grundlage'], - 'label'=>'Grundlage für die Verarbeitung', + 'label' => 'Grundlage für die Verarbeitung', 'translation_domain' => 'form', - 'multiple' =>false, + 'multiple' => false, ]) - ->add('imageFile', VichImageType::class, [ + ->add('uploadFile', VichImageType::class, [ 'required' => false, 'allow_delete' => false, 'delete_label' => 'Löschen', diff --git a/templates/base/__snack.html.twig b/templates/base/__snack.html.twig new file mode 100644 index 00000000..de53395a --- /dev/null +++ b/templates/base/__snack.html.twig @@ -0,0 +1,3 @@ +{% if snack is defined and snack is not null %} +
    {{ snack }}
    +{% endif %} \ No newline at end of file diff --git a/templates/datenweitergabe/__form.html.twig b/templates/datenweitergabe/__form.html.twig index 9885a531..1c9d9d72 100644 --- a/templates/datenweitergabe/__form.html.twig +++ b/templates/datenweitergabe/__form.html.twig @@ -72,16 +72,16 @@
    - {{ form_label(form.imageFile) }} + {{ form_label(form.uploadFile) }} {% if activ %} - {{ form_widget(form.imageFile) }} + {{ form_widget(form.uploadFile) }} {% else %} - {{ form_widget(form.imageFile, { 'disabled':'disabled' }) }} + {{ form_widget(form.uploadFile, { 'disabled':'disabled' }) }} {% endif %} - {% if daten.image %} - Anhang - herunterladen + {% if daten.upload %} + AVV + herunterladen {% endif %}
    diff --git a/templates/datenweitergabe/edit.html.twig b/templates/datenweitergabe/edit.html.twig index c073e818..05e5824b 100644 --- a/templates/datenweitergabe/edit.html.twig +++ b/templates/datenweitergabe/edit.html.twig @@ -14,7 +14,7 @@ {% block body %}

    {{ title }}

    - + {{ include('base/__snack.html.twig') }}
    {{ include('datenweitergabe/__form.html.twig') }}
    diff --git a/templates/vvt/edit.html.twig b/templates/vvt/edit.html.twig index 8c61a65b..7e7f4666 100644 --- a/templates/vvt/edit.html.twig +++ b/templates/vvt/edit.html.twig @@ -30,10 +30,12 @@ class="small"> id: {{ vvt.nummer }}{% endif %} {% if vvt.activDsfa is not null %}

    Datenschutzfolgeabschätzung vorhanden

    {% endif %}
    +
    {{ include('assign/__assign.html.twig',{'data':vvt,'path':'assign_vvt'}) }}
    + {{ include('base/__snack.html.twig') }} {{ include('vvt/__form.html.twig') }} From 90e101003d245ba04908d3b93cfa4dfa95368d89 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 12:18:15 +0200 Subject: [PATCH 05/15] Sorting Add sorting in Assign List Add filter in assign list --- src/Controller/AssignController.php | 8 +++--- src/Service/AssignService.php | 22 +++++++++++++++++ templates/assign/index.html.twig | 13 +++++++--- templates/base/__sidenav.html.twig | 2 +- templates/dashboard/index.html.twig | 38 ++++++++++++++++++----------- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/src/Controller/AssignController.php b/src/Controller/AssignController.php index b894d1aa..78783c45 100644 --- a/src/Controller/AssignController.php +++ b/src/Controller/AssignController.php @@ -6,7 +6,6 @@ use App\Entity\VVT; use App\Service\AssignService; use App\Service\SecurityService; -use Doctrine\Common\Collections\ArrayCollection; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -16,11 +15,10 @@ class AssignController extends AbstractController /** * @Route("/assign", name="assign") */ - public function index() + public function index(Request $request, AssignService $assignService) { - $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); - $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); - $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); + + $assign = $assignService->assign($request, $this->getUser()); return $this->render('assign/index.html.twig', [ 'assign' => $assign diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php index 58ee8aad..3a8291c9 100644 --- a/src/Service/AssignService.php +++ b/src/Service/AssignService.php @@ -14,6 +14,7 @@ use App\Entity\User; use App\Entity\VVT; use App\Form\Type\AssignType; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Routing\RouterInterface; @@ -32,6 +33,27 @@ public function __construct(EntityManagerInterface $entityManager, FormFactoryIn $this->router = $router; } + function assign($request, User $user) + { + $assignVvt = array(); + $assignAudit = array(); + $assign = array(); + try { + if ($request->get('vvt')) { + $assignVvt = $user->getAssignedVvts()->toarray(); + } + if ($request->get('audit')) { + $assignAudit = $user->getAssignedAudits()->toarray(); + } + + $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); + return $assign; + + } catch (\Exception $exception) { + return $assign; + } + } + function createForm($data, Team $team) { $form = $this->formBuilder->create(AssignType::class, $data, ['user' => $team->getMembers()]); diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig index 03977d13..c88984d5 100644 --- a/templates/assign/index.html.twig +++ b/templates/assign/index.html.twig @@ -5,15 +5,20 @@ {% block body %}

    Meine Zuweisungen

    + Alle Zuweisungen + Meine Verarbeitungen + Meine Auditfragen
  • - Meine Zuweisungen + Meine Zuweisungen
  • {% endif %} {% if app.user.akademieUser %} diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index 76f5b395..4414d1f9 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -74,7 +74,8 @@ @@ -84,7 +85,8 @@ @@ -123,12 +125,18 @@
    - {% for a in assign|slice(0, 9) %} + {% for a in assign|slice(0, 9)|sort((a, b) => b.createdAt <=> a.createdAt) %} {% if a.activ == 1 %} - -
    + +
    @@ -164,21 +173,22 @@
    Auditfragen
    +
    Verarbeitungsverzeichnisse
    +
    From 88e32ce048f45852b13e562e66e2140e870a9a5f Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 15:04:27 +0200 Subject: [PATCH 06/15] Add assignement NotificationService.php Add Colors for items in style.css to increase consicentcy --- .env | 1 + config/services.yaml | 1 + public/css/style.css | 83 ++++++++++++++++++++-- src/Service/AssignService.php | 12 +++- src/Service/NotificationService.php | 17 ++++- templates/akademie/index.html.twig | 2 +- templates/assign/index.html.twig | 8 +-- templates/base/__sidenav.html.twig | 6 +- templates/bericht/index.html.twig | 30 ++++---- templates/dashboard/index.html.twig | 25 +++---- templates/email/assignementAudit.html.twig | 32 +++++++++ templates/email/assignementVvt.html.twig | 32 +++++++++ 12 files changed, 201 insertions(+), 48 deletions(-) create mode 100644 templates/email/assignementAudit.html.twig create mode 100644 templates/email/assignementVvt.html.twig diff --git a/.env b/.env index 1f96a8ef..e4ffabff 100644 --- a/.env +++ b/.env @@ -40,6 +40,7 @@ defaultEmailAdress=test@test.com defaultEmailName=test AKADEMIE_EMAIL=akademie@lokal.lokal +DEFAULT_EMAIL=notification@lokal.lokal DEV_EMAIL=dev@lokal.lokal ###> symfony/swiftmailer-bundle ### diff --git a/config/services.yaml b/config/services.yaml index 75f9f9e9..160baa3e 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -8,6 +8,7 @@ parameters: secret: '%env(APP_SECRET)%' projectRoot: '%kernel.root_dir%' akademieEmail: '%env(AKADEMIE_EMAIL)%' + defaultEmail: '%env(DEFAULT_EMAIL)%' cronToken: '%env(CRON_TOKEN)%' cronIPAdress: '%env(CRON_IPADRESS)%' diff --git a/public/css/style.css b/public/css/style.css index db523ba6..4250f1db 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,7 +1,67 @@ /* - DEMO STYLE + Default Style */ +:root { + --main-color: rgb(0, 88, 176); + --main-color-hover: rgb(0, 158, 251); + --main-color-activ: rgb(179, 230, 255); + --sec-color: rgb(245, 26, 32); + --sec-color-hover: rgb(201, 2, 0); + --sec-color-activ: rgb(244, 105, 104); + --contrast-base: rgb(85, 83, 80); + --contrast-dark: rgb(23, 21, 18); + --contrast-light: rgb(144, 142, 140); + --contrast-extra-light: rgb(232, 228, 226); + --contrast-white: rgb(253, 253, 253); +} + +/* Background Colors items*/ +.bg-vvt { + background-color: #34ce57; + color: black !important; +} + +.bg-dsfa { + background-color: #00e676; + color: whitesmoke !important; +} + +.bg-audit { + background-color: #00e5ff; + color: black !important; +} + +.bg-tom { + background-color: #0e4377; + color: whitesmoke !important; +} + +.bg-daten { + background-color: #6f42c1; + color: whitesmoke !important; +} + +.bg-av { + background-color: #7e57c2; + color: whitesmoke !important; +} + +.bg-kontakt { + background-color: #6a1b9a; + color: whitesmoke !important; +} + +.bg-akademie { + background-color: #ba8b00; + color: black !important; +} + +.bg-vorfall { + background-color: #ff1744; + color: whitesmoke !important; +} + /* poppins-regular - latin */ @font-face { font-family: 'Poppins'; @@ -9,15 +69,14 @@ font-weight: 400; src: url('../fonts/poppins-v9-latin-regular.eot'); /* IE9 Compat Modes */ src: local('Poppins Regular'), local('Poppins-Regular'), - url('../fonts/poppins-v9-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('../fonts/poppins-v9-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/poppins-v9-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../fonts/poppins-v9-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ url('../fonts/poppins-v9-latin-regular.woff') format('woff'), /* Modern Browsers */ url('../fonts/poppins-v9-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('../fonts/poppins-v9-latin-regular.svg#Poppins') format('svg'); /* Legacy iOS */ } body { font-family: 'Poppins'; - background: #fafafa; + background: var(--contrast-extra-light); } p { @@ -71,7 +130,7 @@ a:focus { #sidebar { min-width: 250px; max-width: 250px; - background: #b9bbbe; + background: var(--contrast-light); color: #fff; transition: all 0.3s; } @@ -82,7 +141,7 @@ a:focus { #sidebar .sidebar-header { padding: 20px; - background: #b9bbbe; + background: var(--contrast-light); } #sidebar ul.components { @@ -217,4 +276,16 @@ label.required:after { #footer { position: absolute; bottom: 0px; +} + +.btn-primary { + background-color: var(--main-color) !important; +} + +.btn-secondary { + background-color: var(--sec-color) !important; +} + +.btn-info { + background-color: var(--contrast-base) !important; } \ No newline at end of file diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php index 3a8291c9..dbb6fd71 100644 --- a/src/Service/AssignService.php +++ b/src/Service/AssignService.php @@ -18,6 +18,7 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Routing\RouterInterface; +use Twig\Environment; class AssignService @@ -25,12 +26,16 @@ class AssignService private $em; private $formBuilder; private $router; + private $notificationService; + private $twig; - public function __construct(EntityManagerInterface $entityManager, FormFactoryInterface $formBuilder, RouterInterface $router) + public function __construct(EntityManagerInterface $entityManager, FormFactoryInterface $formBuilder, RouterInterface $router, NotificationService $notificationService, Environment $engine) { $this->em = $entityManager; $this->formBuilder = $formBuilder; $this->router = $router; + $this->notificationService = $notificationService; + $this->twig = $engine; } function assign($request, User $user) @@ -69,6 +74,8 @@ function assignVvt($request, VVT $vvt) $user = $this->em->getRepository(User::class)->find($data['user']); if ($vvt->getTeam() === $user->getTeam()) { $vvt->setAssignedUser($user); + $content = $this->twig->render('email/assignementVvt.html.twig', ['assign' => $vvt->getName(), 'data' => $vvt]); + $this->notificationService->sendNotificationAssign($content, $user); } } else { $vvt->setAssignedUser(null); @@ -76,6 +83,7 @@ function assignVvt($request, VVT $vvt) $this->em->persist($vvt); $this->em->flush(); + return true; } catch (\Exception $exception) { return false; @@ -91,6 +99,8 @@ function assignAudit($request, AuditTom $audit) $user = $this->em->getRepository(User::class)->find($data['user']); if ($audit->getTeam() === $user->getTeam()) { $audit->setAssignedUser($user); + $content = $this->twig->render('email/assignementAudit.html.twig', ['assign' => $audit->getFrage(), 'data' => $audit]); + $this->notificationService->sendNotificationAssign($content, $user); } } else { $audit->setAssignedUser(null); diff --git a/src/Service/NotificationService.php b/src/Service/NotificationService.php index 610b1609..d9a94b27 100644 --- a/src/Service/NotificationService.php +++ b/src/Service/NotificationService.php @@ -10,6 +10,7 @@ use App\Entity\AkademieBuchungen; +use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; @@ -32,7 +33,7 @@ public function __construct(EntityManagerInterface $entityManager, MailerService function sendNotificationAkademie(AkademieBuchungen $buchung, $content) { $this->mailer->sendEmail( - 'Datenschutzcenter', + 'Akademie Datenschutzcenter', $this->parameterBag->get('akademieEmail'), $buchung->getUser()->getEmail(), 'Ihnen wurde ein neuer Kurs zugewiesen', @@ -41,4 +42,18 @@ function sendNotificationAkademie(AkademieBuchungen $buchung, $content) return true; } + + function sendNotificationAssign($content, User $user) + { + $this->mailer->sendEmail( + 'Datenschutzcenter', + $this->parameterBag->get('defaultEmail'), + $user->getEmail(), + 'Ihnen wurde ein Element zum Bearbeiten zugewiesen', + $content + ); + + return true; + } + } diff --git a/templates/akademie/index.html.twig b/templates/akademie/index.html.twig index a300b819..6441d52d 100644 --- a/templates/akademie/index.html.twig +++ b/templates/akademie/index.html.twig @@ -23,7 +23,7 @@ {{ b.zugewiesen|date('d.m.Y') }} {{ b.start|date('d.m.Y') }} {% if b.abgeschlossen %} + class="btn btn-sm bg-akademie"> Zertifikat{% else %}Nein{% endif %} {% endfor %} diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig index c88984d5..9f2bd452 100644 --- a/templates/assign/index.html.twig +++ b/templates/assign/index.html.twig @@ -6,20 +6,20 @@ {% block body %}

    Meine Zuweisungen

    Alle Zuweisungen - Meine Verarbeitungen - Meine Auditfragen + Meine Verarbeitungen + Meine Auditfragen
    {% for a in assign|sort((a, b) => b.createdAt <=> a.createdAt) %} {% if a.activ == 1 %} -
    +
    {% if a.name is defined %}{% elseif a.frage is defined %} {% endif %} + style="width: 30px" src="{{ asset('icons/pruefung.svg') }}">{% endif %}
    {% if a.name is defined %}{{ a.name }}{% elseif a.frage is defined %}{{ a.frage }}{% endif %} diff --git a/templates/base/__sidenav.html.twig b/templates/base/__sidenav.html.twig index 427d4dd0..2ed710f7 100644 --- a/templates/base/__sidenav.html.twig +++ b/templates/base/__sidenav.html.twig @@ -80,9 +80,9 @@ diff --git a/templates/bericht/index.html.twig b/templates/bericht/index.html.twig index 52b47233..e0c7422d 100644 --- a/templates/bericht/index.html.twig +++ b/templates/bericht/index.html.twig @@ -11,10 +11,10 @@ @@ -22,10 +22,10 @@ @@ -33,10 +33,10 @@ @@ -44,19 +44,19 @@

    Auditfragen

    - PDF von allen Auditfragen erstellen - PDF von allen Auditfragen inkl. Historie erstellen - Alle relevanten Auditfragen exportieren - Alle unbearbeiteten Auditfragen exportieren @@ -64,11 +64,11 @@

    TOM

    - Allgemeine Globale TOM erstellen - Alle TOMs erstellen @@ -76,17 +76,17 @@ diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index 4414d1f9..127dda85 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -13,24 +13,15 @@
    @@ -129,10 +120,10 @@ {% if a.activ == 1 %} diff --git a/templates/email/assignementAudit.html.twig b/templates/email/assignementAudit.html.twig new file mode 100644 index 00000000..4f14ddbc --- /dev/null +++ b/templates/email/assignementAudit.html.twig @@ -0,0 +1,32 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + {{ assign }} +{% endblock %} + +{% block content %} +

    + -- Neue Auditfrage zugewiesen -- +

    + + Hallo! + +

    + Ihnen wurde eine Auditfrage zum Bearbeiten zugewiesen. +

    + + Auditfrage: {{ assign }} + + +

    + Klicken Sie hier um direkt zu Element + zu gelangen. +

    + +

    + Wenn Sie Fragen zum Datenschutz und den Hintergründen diese Nachricht, melden Sie sich bei Ihrem + Datenschutzbeauftragten, den Datenschutzkoordinatoren oder bei der Geschäftsführung.
    + E-Mail: {{ data.team.email }}
    + Telefon: {{ data.team.telefon }} +

    + +{% endblock %} diff --git a/templates/email/assignementVvt.html.twig b/templates/email/assignementVvt.html.twig new file mode 100644 index 00000000..07c12e56 --- /dev/null +++ b/templates/email/assignementVvt.html.twig @@ -0,0 +1,32 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + {{ assign }} +{% endblock %} + +{% block content %} +

    + -- Neue Verarbeitung zugewiesen -- +

    + + Hallo! + +

    + Ihnen wurde eine Verarbeitung zum Bearbeiten zugewiesen. +

    + + Verarbeitung: {{ assign }} + + +

    + Klicken Sie hier um direkt zu Element + zu gelangen. +

    + +

    + Wenn Sie Fragen zum Datenschutz und den Hintergründen diese Nachricht, melden Sie sich bei Ihrem + Datenschutzbeauftragten, den Datenschutzkoordinatoren oder bei der Geschäftsführung.
    + E-Mail: {{ data.team.email }}
    + Telefon: {{ data.team.telefon }} +

    + +{% endblock %} From 9e88c486ee859b66e43f9c02849f611604a2e40b Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 15:13:58 +0200 Subject: [PATCH 07/15] Cleanup twigs --- templates/assign/__assignItem.html.twig | 41 +++++++++++++++++++++ templates/assign/index.html.twig | 25 +------------ templates/dashboard/__assign.html.twig | 48 +++++++++++++++++++++++++ templates/dashboard/index.html.twig | 45 +---------------------- 4 files changed, 91 insertions(+), 68 deletions(-) create mode 100644 templates/assign/__assignItem.html.twig create mode 100644 templates/dashboard/__assign.html.twig diff --git a/templates/assign/__assignItem.html.twig b/templates/assign/__assignItem.html.twig new file mode 100644 index 00000000..732712bc --- /dev/null +++ b/templates/assign/__assignItem.html.twig @@ -0,0 +1,41 @@ + +
    +
    +
    + {% if a.name is defined %} + + {% elseif a.frage is defined %} + + {% endif %} +
    +
    + {% if a.name is defined %} + {{ a.name }} + {% elseif a.frage is defined %} + {{ a.frage }} + {% endif %} +
    +
    + Erstellt am: {{ a.createdAt|date('d.m.Y') }} +
    +
    + {{ a.nummer }} +
    +
    + {{ a.status.name }} +
    +
    +
    +
    \ No newline at end of file diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig index 9f2bd452..5be81a9e 100644 --- a/templates/assign/index.html.twig +++ b/templates/assign/index.html.twig @@ -12,30 +12,7 @@ {% for a in assign|sort((a, b) => b.createdAt <=> a.createdAt) %} {% if a.activ == 1 %} - -
    -
    -
    - {% if a.name is defined %}{% elseif a.frage is defined %} - {% endif %} -
    -
    - {% if a.name is defined %}{{ a.name }}{% elseif a.frage is defined %}{{ a.frage }}{% endif %} -
    -
    - Erstellt am: {{ a.createdAt|date('d.m.Y') }} -
    -
    - {{ a.nummer }} -
    -
    - {{ a.status.name }} -
    -
    -
    -
    + {{ include('assign/__assignItem.html.twig') }} {% endif %} {% endfor %}
    diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig new file mode 100644 index 00000000..3a371fa7 --- /dev/null +++ b/templates/dashboard/__assign.html.twig @@ -0,0 +1,48 @@ + +
    + +
    + Meine Zuweisungen +
    + + + +
    + \ No newline at end of file diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index 127dda85..2907bc6d 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -108,50 +108,7 @@
    - -
    - -
    - Meine Zuweisungen -
    - - - -
    - + {{ include('dashboard/__assign.html.twig') }}
    From 939aaaead37e823849ebb12fa1238c4783980c1c Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 15:40:31 +0200 Subject: [PATCH 08/15] Add assign Dsfa and assign datenweitergabe --- src/Controller/AssignController.php | 32 ++++++++ src/Controller/DatenweitergabeController.php | 5 +- src/Controller/VvtController.php | 4 +- src/Entity/Datenweitergabe.php | 17 +++++ src/Entity/User.php | 74 +++++++++++++++++++ src/Entity/VVTDsfa.php | 19 ++++- src/Service/AssignService.php | 49 ++++++++++++ templates/datenweitergabe/edit.html.twig | 14 +++- templates/email/assignementAudit.html.twig | 4 +- .../assignementDatenweitergabe.html.twig | 32 ++++++++ templates/email/assignementDsfa.html.twig | 35 +++++++++ templates/email/assignementVvt.html.twig | 4 +- templates/vvt/editDsfa.html.twig | 10 ++- 13 files changed, 286 insertions(+), 13 deletions(-) create mode 100644 templates/email/assignementDatenweitergabe.html.twig create mode 100644 templates/email/assignementDsfa.html.twig diff --git a/src/Controller/AssignController.php b/src/Controller/AssignController.php index 78783c45..a2ab3aa6 100644 --- a/src/Controller/AssignController.php +++ b/src/Controller/AssignController.php @@ -3,7 +3,9 @@ namespace App\Controller; use App\Entity\AuditTom; +use App\Entity\Datenweitergabe; use App\Entity\VVT; +use App\Entity\VVTDsfa; use App\Service\AssignService; use App\Service\SecurityService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -54,4 +56,34 @@ public function assignAudit(Request $request, AssignService $assignService, Secu $res = $assignService->assignAudit($request, $audit); return $this->redirect($request->headers->get('referer')); } + + /** + * @Route("/assign/daten", name="assign_datenweitergabe") + */ + public function assignDatenweitergabe(Request $request, AssignService $assignService, SecurityService $securityService) + { + $team = $this->getUser()->getTeam(); + $daten = $this->getDoctrine()->getRepository(Datenweitergabe::class)->find($request->get('id')); + if ($securityService->teamDataCheck($daten, $team) === false) { + return $this->redirectToRoute('datenweitergabe'); + } + + $res = $assignService->assignDatenweitergabe($request, $daten); + return $this->redirect($request->headers->get('referer')); + } + + /** + * @Route("/assign/dsfa", name="assign_dsfa") + */ + public function assignDsfa(Request $request, AssignService $assignService, SecurityService $securityService) + { + $team = $this->getUser()->getTeam(); + $dsfa = $this->getDoctrine()->getRepository(VVTDsfa::class)->find($request->get('id')); + if ($securityService->teamDataCheck($dsfa->getVvt(), $team) === false) { + return $this->redirectToRoute('vvt'); + } + + $res = $assignService->assignDsfa($request, $dsfa); + return $this->redirect($request->headers->get('referer')); + } } diff --git a/src/Controller/DatenweitergabeController.php b/src/Controller/DatenweitergabeController.php index 42e18e6d..3f5219be 100644 --- a/src/Controller/DatenweitergabeController.php +++ b/src/Controller/DatenweitergabeController.php @@ -9,6 +9,7 @@ namespace App\Controller; use App\Entity\Datenweitergabe; +use App\Service\AssignService; use App\Service\DatenweitergabeService; use App\Service\SecurityService; use League\Flysystem\FilesystemInterface; @@ -141,7 +142,7 @@ public function addAuftragsverarbeitung(ValidatorInterface $validator, Request $ /** * @Route("/datenweitergabe/edit", name="datenweitergabe_edit") */ - public function EditDatenweitergabe(ValidatorInterface $validator, Request $request, SecurityService $securityService, DatenweitergabeService $datenweitergabeService) + public function EditDatenweitergabe(ValidatorInterface $validator, Request $request, SecurityService $securityService, DatenweitergabeService $datenweitergabeService, AssignService $assignService) { $team = $this->getUser()->getTeam(); $daten = $this->getDoctrine()->getRepository(Datenweitergabe::class)->find($request->get('id')); @@ -157,6 +158,7 @@ public function EditDatenweitergabe(ValidatorInterface $validator, Request $requ $form = $datenweitergabeService->createForm($newDaten, $team); $form->remove('nummer'); $form->handleRequest($request); + $assign = $assignService->createForm($daten, $team); $errors = array(); if ($form->isSubmitted() && $form->isValid()) { @@ -180,6 +182,7 @@ public function EditDatenweitergabe(ValidatorInterface $validator, Request $requ } return $this->render('datenweitergabe/edit.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Datenweitergabe bearbeiten', 'daten' => $daten, diff --git a/src/Controller/VvtController.php b/src/Controller/VvtController.php index 18c71c13..a8948709 100644 --- a/src/Controller/VvtController.php +++ b/src/Controller/VvtController.php @@ -169,7 +169,7 @@ public function newVvtDsfa(ValidatorInterface $validator, Request $request, VVTS /** * @Route("/vvt/dsfa/edit", name="vvt_dsfa_edit") */ - public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVTService $VVTService, SecurityService $securityService) + public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVTService $VVTService, SecurityService $securityService, AssignService $assignService) { $team = $this->getUser()->getTeam(); $dsfa = $this->getDoctrine()->getRepository(VVTDsfa::class)->find($request->get('dsfa')); @@ -182,6 +182,7 @@ public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVT $form = $this->createForm(VvtDsfaType::class, $newDsfa); $form->handleRequest($request); + $assign = $assignService->createForm($dsfa, $team); $errors = array(); if ($form->isSubmitted() && $form->isValid()) { @@ -199,6 +200,7 @@ public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVT return $this->render('vvt/editDsfa.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Datenschutzfolgeabschätzung bearbeiten', 'dsfa' => $dsfa, diff --git a/src/Entity/Datenweitergabe.php b/src/Entity/Datenweitergabe.php index 15851f72..aedb3875 100644 --- a/src/Entity/Datenweitergabe.php +++ b/src/Entity/Datenweitergabe.php @@ -136,6 +136,11 @@ class Datenweitergabe */ private $verfahren; + /** + * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedDatenweitergaben") + */ + private $assignedUser; + public function __construct() { $this->verfahren = new ArrayCollection(); @@ -383,4 +388,16 @@ public function removeVerfahren(VVT $verfahren): self return $this; } + + public function getAssignedUser(): ?User + { + return $this->assignedUser; + } + + public function setAssignedUser(?User $assignedUser): self + { + $this->assignedUser = $assignedUser; + + return $this; + } } diff --git a/src/Entity/User.php b/src/Entity/User.php index c70aafa4..1c550f61 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -95,6 +95,16 @@ class User extends BaseUser */ private $assignedAudits; + /** + * @ORM\OneToMany(targetEntity=Datenweitergabe::class, mappedBy="assignedUser") + */ + private $assignedDatenweitergaben; + + /** + * @ORM\OneToMany(targetEntity=VVTDsfa::class, mappedBy="assignedUser") + */ + private $assignedDsfa; + public function __construct() { @@ -109,6 +119,8 @@ public function __construct() $this->akademieKurses = new ArrayCollection(); $this->assignedVvts = new ArrayCollection(); $this->assignedAudits = new ArrayCollection(); + $this->assignedDatenweitergaben = new ArrayCollection(); + $this->assignedDsfa = new ArrayCollection(); } public function getTeam(): ?Team @@ -457,4 +469,66 @@ public function removeAssignedAudit(AuditTom $assignedAudit): self return $this; } + /** + * @return Collection|Datenweitergabe[] + */ + public function getAssignedDatenweitergaben(): Collection + { + return $this->assignedDatenweitergaben; + } + + public function addAssignedDatenweitergaben(Datenweitergabe $assignedDatenweitergaben): self + { + if (!$this->assignedDatenweitergaben->contains($assignedDatenweitergaben)) { + $this->assignedDatenweitergaben[] = $assignedDatenweitergaben; + $assignedDatenweitergaben->setAssignedUser($this); + } + + return $this; + } + + public function removeAssignedDatenweitergaben(Datenweitergabe $assignedDatenweitergaben): self + { + if ($this->assignedDatenweitergaben->contains($assignedDatenweitergaben)) { + $this->assignedDatenweitergaben->removeElement($assignedDatenweitergaben); + // set the owning side to null (unless already changed) + if ($assignedDatenweitergaben->getAssignedUser() === $this) { + $assignedDatenweitergaben->setAssignedUser(null); + } + } + + return $this; + } + + /** + * @return Collection|VVTDsfa[] + */ + public function getAssignedDsfa(): Collection + { + return $this->assignedDsfa; + } + + public function addAssignedDsfa(VVTDsfa $assignedDsfa): self + { + if (!$this->assignedDsfa->contains($assignedDsfa)) { + $this->assignedDsfa[] = $assignedDsfa; + $assignedDsfa->setAssignedUser($this); + } + + return $this; + } + + public function removeAssignedDsfa(VVTDsfa $assignedDsfa): self + { + if ($this->assignedDsfa->contains($assignedDsfa)) { + $this->assignedDsfa->removeElement($assignedDsfa); + // set the owning side to null (unless already changed) + if ($assignedDsfa->getAssignedUser() === $this) { + $assignedDsfa->setAssignedUser(null); + } + } + + return $this; + } + } diff --git a/src/Entity/VVTDsfa.php b/src/Entity/VVTDsfa.php index 7a0565b5..a4f07ce2 100644 --- a/src/Entity/VVTDsfa.php +++ b/src/Entity/VVTDsfa.php @@ -2,10 +2,10 @@ namespace App\Entity; +use Ambta\DoctrineEncryptBundle\Configuration\Encrypted; use App\Repository\VVTDsfaRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; -use Ambta\DoctrineEncryptBundle\Configuration\Encrypted; /** * @ORM\Entity(repositoryClass=VVTDsfaRepository::class) @@ -94,6 +94,11 @@ class VVTDsfa */ private $user; + /** + * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedDsfa") + */ + private $assignedUser; + public function getId(): ?int { @@ -243,4 +248,16 @@ public function setUser(?User $user): self return $this; } + + public function getAssignedUser(): ?User + { + return $this->assignedUser; + } + + public function setAssignedUser(?User $assignedUser): self + { + $this->assignedUser = $assignedUser; + + return $this; + } } diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php index dbb6fd71..6be98b3a 100644 --- a/src/Service/AssignService.php +++ b/src/Service/AssignService.php @@ -10,9 +10,11 @@ use App\Entity\AuditTom; +use App\Entity\Datenweitergabe; use App\Entity\Team; use App\Entity\User; use App\Entity\VVT; +use App\Entity\VVTDsfa; use App\Form\Type\AssignType; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; @@ -113,4 +115,51 @@ function assignAudit($request, AuditTom $audit) return false; } } + + function assignDatenweitergabe($request, Datenweitergabe $datenweitergabe) + { + try { + if ($datenweitergabe->getAssignedUser() == null) { + $data = $request->get('assign'); + $user = $this->em->getRepository(User::class)->find($data['user']); + if ($datenweitergabe->getTeam() === $user->getTeam()) { + $datenweitergabe->setAssignedUser($user); + $content = $this->twig->render('email/assignementDatenweitergabe.html.twig', ['assign' => $datenweitergabe->getGegenstand(), 'data' => $datenweitergabe]); + $this->notificationService->sendNotificationAssign($content, $user); + } + } else { + $datenweitergabe->setAssignedUser(null); + } + $this->em->persist($datenweitergabe); + $this->em->flush(); + + return true; + } catch (\Exception $exception) { + return false; + } + } + + function assignDsfa($request, VVTDsfa $dsfa) + { + //try { + + if ($dsfa->getAssignedUser() == null) { + $data = $request->get('assign'); + $user = $this->em->getRepository(User::class)->find($data['user']); + if ($dsfa->getVvt()->getTeam() === $user->getTeam()) { + $dsfa->setAssignedUser($user); + $content = $this->twig->render('email/assignementDsfa.html.twig', ['assign' => $dsfa->getVvt()->getName(), 'data' => $dsfa]); + $this->notificationService->sendNotificationAssign($content, $user); + } + } else { + $dsfa->setAssignedUser(null); + } + $this->em->persist($dsfa); + $this->em->flush(); + + return true; + //} catch (\Exception $exception) { + // return false; + //} + } } diff --git a/templates/datenweitergabe/edit.html.twig b/templates/datenweitergabe/edit.html.twig index 05e5824b..3690b85a 100644 --- a/templates/datenweitergabe/edit.html.twig +++ b/templates/datenweitergabe/edit.html.twig @@ -12,8 +12,14 @@ {% endblock %} {% block body %} - -

    {{ title }}

    +
    +
    +

    {{ title }}

    +
    +
    + {{ include('assign/__assign.html.twig',{'data':daten,'path':'assign_datenweitergabe'}) }} +
    +
    {{ include('base/__snack.html.twig') }}
    {{ include('datenweitergabe/__form.html.twig') }} @@ -27,5 +33,5 @@ {% endif %} {% endblock %} -{% block javascript %} -{% endblock %} + {% block javascript %} + {% endblock %} diff --git a/templates/email/assignementAudit.html.twig b/templates/email/assignementAudit.html.twig index 4f14ddbc..a8602439 100644 --- a/templates/email/assignementAudit.html.twig +++ b/templates/email/assignementAudit.html.twig @@ -1,11 +1,11 @@ {% extends 'email/base.html.twig' %} {% block header %} - {{ assign }} + -- Neue Auditfrage zum Bearbeiten zugewiesen -- {% endblock %} {% block content %}

    - -- Neue Auditfrage zugewiesen -- + {{ assign }}

    Hallo! diff --git a/templates/email/assignementDatenweitergabe.html.twig b/templates/email/assignementDatenweitergabe.html.twig new file mode 100644 index 00000000..f0231a79 --- /dev/null +++ b/templates/email/assignementDatenweitergabe.html.twig @@ -0,0 +1,32 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + -- Neue Datenweitergabe zum Bearbeiten zugewiesen -- +{% endblock %} + +{% block content %} +

    + {{ assign }} +

    + + Hallo! + +

    + Ihnen wurde eine Datenweitergabe zum Bearbeiten zugewiesen. +

    + + Datenweitergabe: {{ assign }} + + +

    + Klicken Sie hier um direkt zu Element + zu gelangen. +

    + +

    + Wenn Sie Fragen zum Datenschutz und den Hintergründen diese Nachricht, melden Sie sich bei Ihrem + Datenschutzbeauftragten, den Datenschutzkoordinatoren oder bei der Geschäftsführung.
    + E-Mail: {{ data.team.email }}
    + Telefon: {{ data.team.telefon }} +

    + +{% endblock %} diff --git a/templates/email/assignementDsfa.html.twig b/templates/email/assignementDsfa.html.twig new file mode 100644 index 00000000..88ae0b48 --- /dev/null +++ b/templates/email/assignementDsfa.html.twig @@ -0,0 +1,35 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + -- Neue DSFA zum Bearbeiten zugewiesen -- +{% endblock %} + +{% block content %} +

    + {{ assign }} +

    + + Hallo! + +

    + Ihnen wurde eine Datenschutzfolgeabschätzung zur Verarbeitung {{ assign }} zum Bearbeiten zugewiesen. +

    +

    + DSFA zur Verarbeitung: {{ assign }} +

    +

    + Grundlage: {{ data.beschreibung|nl2br }} +

    + +

    + Klicken Sie hier um direkt zu Element + zu gelangen. +

    + +

    + Wenn Sie Fragen zum Datenschutz und den Hintergründen diese Nachricht, melden Sie sich bei Ihrem + Datenschutzbeauftragten, den Datenschutzkoordinatoren oder bei der Geschäftsführung.
    + E-Mail: {{ data.vvt.team.email }}
    + Telefon: {{ data.vvt.team.telefon }} +

    + +{% endblock %} diff --git a/templates/email/assignementVvt.html.twig b/templates/email/assignementVvt.html.twig index 07c12e56..d8baf5b5 100644 --- a/templates/email/assignementVvt.html.twig +++ b/templates/email/assignementVvt.html.twig @@ -1,11 +1,11 @@ {% extends 'email/base.html.twig' %} {% block header %} - {{ assign }} + -- Neue Verarbeitung zum Bearbeiten zugewiesen -- {% endblock %} {% block content %}

    - -- Neue Verarbeitung zugewiesen -- + {{ assign }}

    Hallo! diff --git a/templates/vvt/editDsfa.html.twig b/templates/vvt/editDsfa.html.twig index 3cc7be79..c173f7c5 100644 --- a/templates/vvt/editDsfa.html.twig +++ b/templates/vvt/editDsfa.html.twig @@ -1,8 +1,14 @@ {% extends 'base.html.twig' %} {% block body %} - -

    {{ title }} zu {{ dsfa.vvt.name }}

    +
    +
    +

    {{ title }} zu {{ dsfa.vvt.name }}

    +
    +
    + {{ include('assign/__assign.html.twig',{'data':dsfa,'path':'assign_dsfa'}) }} +
    +
    {{ form_start(form) }}
    From fdb5357a9bda418f98ce48bad9167ad2637ecd86 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 17:14:30 +0200 Subject: [PATCH 09/15] Add assign Dsfa and assign datenweitergabe Changed Dashboard and Meine Zuweisungen Twig to Tabs --- public/css/style.css | 4 + public/icons/data.svg | 10 ++ public/icons/dsfa.svg | 11 ++ src/Controller/AssignController.php | 10 +- src/Controller/DashboardController.php | 9 +- src/Service/AssignService.php | 20 +++- templates/assign/__assignItem.html.twig | 20 +++- templates/assign/index.html.twig | 126 ++++++++++++++++++-- templates/base/__sidenav.html.twig | 2 +- templates/bericht/index.html.twig | 22 ++-- templates/dashboard/__assign.html.twig | 151 ++++++++++++++++++------ 11 files changed, 321 insertions(+), 64 deletions(-) create mode 100644 public/icons/data.svg create mode 100644 public/icons/dsfa.svg diff --git a/public/css/style.css b/public/css/style.css index 4250f1db..86fe56b3 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -278,6 +278,10 @@ label.required:after { bottom: 0px; } + +/* --------------------------------------------------- + Custom Buttons +----------------------------------------------------- */ .btn-primary { background-color: var(--main-color) !important; } diff --git a/public/icons/data.svg b/public/icons/data.svg new file mode 100644 index 00000000..74965193 --- /dev/null +++ b/public/icons/data.svg @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/icons/dsfa.svg b/public/icons/dsfa.svg new file mode 100644 index 00000000..62f733a9 --- /dev/null +++ b/public/icons/dsfa.svg @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Controller/AssignController.php b/src/Controller/AssignController.php index a2ab3aa6..1a49ac1f 100644 --- a/src/Controller/AssignController.php +++ b/src/Controller/AssignController.php @@ -20,10 +20,16 @@ class AssignController extends AbstractController public function index(Request $request, AssignService $assignService) { - $assign = $assignService->assign($request, $this->getUser()); + $assignDatenweitergabe = $this->getUser()->getAssignedDatenweitergaben()->toarray(); + $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); + $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); + $assignDsfa = $this->getUser()->getAssignedDsfa()->toarray(); return $this->render('assign/index.html.twig', [ - 'assign' => $assign + 'assignDaten' => $assignDatenweitergabe, + 'assignVvt' => $assignVvt, + 'assignAudit' => $assignAudit, + 'assignDsfa' => $assignDsfa ]); } diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index c6f25df7..2485f252 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -14,7 +14,6 @@ use App\Entity\Tom; use App\Entity\VVT; use App\Entity\VVTDsfa; -use Doctrine\Common\Collections\ArrayCollection; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; @@ -71,7 +70,8 @@ public function dashboard() $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); - $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); + $assignDsfa = $this->getUser()->getAssignedDsfa()->toarray(); + $assignDatenweitergabe = $this->getUser()->getAssignedDatenweitergaben()->toarray(); return $this->render('dashboard/index.html.twig', [ 'controller_name' => 'DashboardController', @@ -86,7 +86,10 @@ public function dashboard() 'openDsfa' => $openDsfa, 'tom' => $tom, 'av' => $av, - 'assign' => $assign + 'assignDaten' => $assignDatenweitergabe, + 'assignVvt' => $assignVvt, + 'assignAudit' => $assignAudit, + 'assignDsfa' => $assignDsfa ]); } } diff --git a/src/Service/AssignService.php b/src/Service/AssignService.php index 6be98b3a..f88cb7e7 100644 --- a/src/Service/AssignService.php +++ b/src/Service/AssignService.php @@ -42,18 +42,28 @@ public function __construct(EntityManagerInterface $entityManager, FormFactoryIn function assign($request, User $user) { - $assignVvt = array(); - $assignAudit = array(); + $assignDatenweitergabe = $user->getAssignedDatenweitergaben()->toarray(); + $assignVvt = $user->getAssignedVvts()->toarray(); + $assignAudit = $user->getAssignedAudits()->toarray(); + $assignDsfa = $user->getAssignedDsfa()->toarray(); + $assign = array(); try { if ($request->get('vvt')) { - $assignVvt = $user->getAssignedVvts()->toarray(); + $assignVvt = array(); } if ($request->get('audit')) { - $assignAudit = $user->getAssignedAudits()->toarray(); + $assignAudit = array(); + } + if ($request->get('dsfa')) { + $assignDsfa = array(); } + if ($request->get('daten')) { + $assignDatenweitergabe = array(); + } + + $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt, $assignDsfa, $assignDatenweitergabe)); - $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt)); return $assign; } catch (\Exception $exception) { diff --git a/templates/assign/__assignItem.html.twig b/templates/assign/__assignItem.html.twig index 732712bc..4d952f07 100644 --- a/templates/assign/__assignItem.html.twig +++ b/templates/assign/__assignItem.html.twig @@ -10,6 +10,10 @@ class="card card-body bg-vvt mb-1" {% elseif a.frage is defined %} class="card card-body bg-audit mb-1" + {% elseif a.grundlage is defined %} + class="card card-body bg-daten mb-1" + {% elseif a.beschreibung is defined %} + class="card card-body bg-dsfa mb-1" {% endif %} >
    @@ -18,6 +22,10 @@ {% elseif a.frage is defined %} + {% elseif a.grundlage is defined %} + + {% elseif a.beschreibung is defined %} + {% endif %}
    @@ -25,16 +33,24 @@ {{ a.name }} {% elseif a.frage is defined %} {{ a.frage }} + {% elseif a.grundlage is defined %} + {{ a.grundlage }} + {% elseif a.beschreibung is defined %} + {{ a.beschreibung }} {% endif %}
    Erstellt am: {{ a.createdAt|date('d.m.Y') }}
    - {{ a.nummer }} + {% if a.nummer is defined %} + {{ a.nummer }} + {% endif %}
    - {{ a.status.name }} + {% if a.status is defined %} + {{ a.status.name }} + {% endif %}
    diff --git a/templates/assign/index.html.twig b/templates/assign/index.html.twig index 5be81a9e..a274ffad 100644 --- a/templates/assign/index.html.twig +++ b/templates/assign/index.html.twig @@ -5,15 +5,125 @@ {% block body %}

    Meine Zuweisungen

    - Alle Zuweisungen - Meine Verarbeitungen - Meine Auditfragen
    + - {% for a in assign|sort((a, b) => b.createdAt <=> a.createdAt) %} - {% if a.activ == 1 %} - {{ include('assign/__assignItem.html.twig') }} - {% endif %} - {% endfor %} +
    +
    + {% for a in assignAudit %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.frage }} +
    +
    + {{ a.status.name }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignVvt %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.name }} +
    +
    + {{ a.status.name }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignDsfa %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.beschreibung }} +
    +
    + {{ a.vvt.name }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignDaten %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.gegenstand }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    {% endblock %} diff --git a/templates/base/__sidenav.html.twig b/templates/base/__sidenav.html.twig index 2ed710f7..d00470e7 100644 --- a/templates/base/__sidenav.html.twig +++ b/templates/base/__sidenav.html.twig @@ -10,7 +10,7 @@ Dashboard
  • - Meine Zuweisungen + Meine Zuweisungen
  • {% endif %} {% if app.user.akademieUser %} diff --git a/templates/bericht/index.html.twig b/templates/bericht/index.html.twig index e0c7422d..44c872da 100644 --- a/templates/bericht/index.html.twig +++ b/templates/bericht/index.html.twig @@ -32,7 +32,7 @@
    -

    Auftragsdatenverarbeitung (AVV)

    +

    Auftragsverarbeitung (AV)

    PDF von allen AVVs erstellen @@ -76,20 +76,24 @@ - + {% if app.user.adminUser %} + + {% endif %}
    {% endblock %} \ No newline at end of file diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig index 3a371fa7..b2e1426a 100644 --- a/templates/dashboard/__assign.html.twig +++ b/templates/dashboard/__assign.html.twig @@ -6,40 +6,123 @@
    - {% for a in assign|slice(0, 9)|sort((a, b) => b.createdAt <=> a.createdAt) %} - {% if a.activ == 1 %} - -
    -
    - {% if a.name is defined %} - - {% elseif a.frage is defined %} - - {% endif %} -
    -
    - {% if a.name is defined %} - {{ a.name }} - {% elseif a.frage is defined %} - {{ a.frage }} - {% endif %} -
    -
    - {{ a.status.name }} -
    -
    -
    - {% endif %} - {% endfor %} - Alle Zuweisungen + + +
    +
    + {% for a in assignAudit|slice(0, 3)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.frage }} +
    +
    + {{ a.status.name }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignVvt|slice(0, 3)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.name }} +
    +
    + {{ a.status.name }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignDsfa|slice(0, 3)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.beschreibung }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignDaten|slice(0, 3)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.gegenstand }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + Alle Zuweisungen anzeigen
    From 668b98696942cd5e3e99fc3f260e0f8efc979dbf Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 17:38:36 +0200 Subject: [PATCH 10/15] Changed Akademie Email --- templates/email/base.html.twig | 2 +- templates/email/errinnerungKurs.html.twig | 4 ++-- templates/email/neuerKurs.html.twig | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/email/base.html.twig b/templates/email/base.html.twig index f1b45b19..a9d90395 100644 --- a/templates/email/base.html.twig +++ b/templates/email/base.html.twig @@ -54,7 +54,7 @@
    - Powered by Open Datenschutzcenter + Powered by Open Datenschutzcenter
    diff --git a/templates/email/errinnerungKurs.html.twig b/templates/email/errinnerungKurs.html.twig index dd15b0e7..6779a382 100644 --- a/templates/email/errinnerungKurs.html.twig +++ b/templates/email/errinnerungKurs.html.twig @@ -1,11 +1,11 @@ {% extends 'email/base.html.twig' %} {% block header %} - {{ buchung.kurs.title }} + -- Kurs noch nicht abgeschlossen -- {% endblock %} {% block content %}

    - -- Kurs noch nicht abgeschlossen -- + {{ buchung.kurs.title }}

    Hallo, diff --git a/templates/email/neuerKurs.html.twig b/templates/email/neuerKurs.html.twig index 3558cbcc..dff39895 100644 --- a/templates/email/neuerKurs.html.twig +++ b/templates/email/neuerKurs.html.twig @@ -1,11 +1,11 @@ {% extends 'email/base.html.twig' %} {% block header %} - {{ buchung.kurs.title }} + -- Neuer Kurs verfügbar -- {% endblock %} {% block content %}

    - -- Neuer Kurs verfügbar -- + {{ buchung.kurs.title }}

    Hallo! From 95808e48dde8f293e8e9cb56faf3909e47a5005f Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Sun, 28 Jun 2020 17:44:33 +0200 Subject: [PATCH 11/15] Changed Kurs overview --- templates/kurs/__indexTabel.html.twig | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/kurs/__indexTabel.html.twig b/templates/kurs/__indexTabel.html.twig index d9980cae..02d68ffe 100644 --- a/templates/kurs/__indexTabel.html.twig +++ b/templates/kurs/__indexTabel.html.twig @@ -7,7 +7,6 @@ # Titel Erstellt/Update am - Buchungen Aktionen @@ -17,7 +16,6 @@ {{ t.id }} {{ t.title }} {{ t.createdAt|date('d.m.Y') }} - {{ t.buchungen|length }} Anmelden {% if app.user == t.user %} Date: Sun, 28 Jun 2020 22:33:47 +0200 Subject: [PATCH 12/15] Add Snackbar to edited forms Refactor assigned on dashboard --- public/css/style.css | 67 ++++++++++++++++++++++++ public/js/script.js | 10 ++++ src/Controller/AuditTomController.php | 3 +- src/Controller/KontaktController.php | 3 +- src/Controller/TomController.php | 5 +- src/Controller/VorfallController.php | 3 +- src/Controller/VvtController.php | 2 +- src/Service/TomService.php | 7 ++- templates/audit_tom/edit.html.twig | 1 + templates/base/__snack.html.twig | 2 +- templates/dashboard/__assign.html.twig | 8 +-- templates/datenweitergabe/edit.html.twig | 3 +- templates/kontakt/edit.html.twig | 1 + templates/tom/__history.html.twig | 4 +- templates/tom/edit.html.twig | 1 + templates/vorfall/edit.html.twig | 1 + templates/vvt/edit.html.twig | 4 +- templates/vvt/editDsfa.html.twig | 2 + 18 files changed, 111 insertions(+), 16 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 86fe56b3..c971ac12 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -292,4 +292,71 @@ label.required:after { .btn-info { background-color: var(--contrast-base) !important; +} + + +#snackbar { + visibility: hidden; + width: 100%; + + background-color: var(--contrast-base); + color: #fff; + text-align: center; + border-radius: 2px; + padding: 16px; + position: fixed; + z-index: 1; + right: 0; + bottom: 30px; + font-size: 17px; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } +} + +@keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } +} + +@-webkit-keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} + +@keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } } \ No newline at end of file diff --git a/public/js/script.js b/public/js/script.js index f75e8a4f..0c82bf72 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1,3 +1,13 @@ +jQuery(document).ready(function () { + setTimeout(function () { + var x = document.getElementById("snackbar"); + x.className = "show"; + setTimeout(function () { + x.className = x.className.replace("show", ""); + }, 3000); + }, 2000) +}); + jQuery(document).ready(function () { $('#sidebarCollapse').on('click', function () { $('#sidebar').toggleClass('active'); diff --git a/src/Controller/AuditTomController.php b/src/Controller/AuditTomController.php index 46b42289..ee5a2732 100644 --- a/src/Controller/AuditTomController.php +++ b/src/Controller/AuditTomController.php @@ -140,7 +140,7 @@ public function EditAuditTom(ValidatorInterface $validator, Request $request, Se $em->persist($newAudit); $em->persist($audit); $em->flush(); - return $this->redirectToRoute('audit_tom_edit', array('tom'=>$newAudit->getId())); + return $this->redirectToRoute('audit_tom_edit', array('tom' => $newAudit->getId(), 'snack' => 'Erfolgreich gepeichert')); } } return $this->render('audit_tom/edit.html.twig', [ @@ -152,6 +152,7 @@ public function EditAuditTom(ValidatorInterface $validator, Request $request, Se 'activ' => $audit->getActiv(), 'activNummer' => false, 'nextAudit' => $nextAudit, + 'snack' => $request->get('snack') ]); } diff --git a/src/Controller/KontaktController.php b/src/Controller/KontaktController.php index bc5ccb07..5a4fd3e7 100644 --- a/src/Controller/KontaktController.php +++ b/src/Controller/KontaktController.php @@ -92,13 +92,14 @@ public function editKontakt(ValidatorInterface $validator, Request $request, Sec $em = $this->getDoctrine()->getManager(); $em->persist($data); $em->flush(); - return $this->redirectToRoute('kontakt'); + return $this->redirectToRoute('kontakt_edit', ['id' => $kontakt->getId(), 'snack' => 'Erfolgreich gepeichert']); } } return $this->render('kontakt/edit.html.twig', [ 'form' => $form->createView(), 'errors' => $errors, 'title' => 'Kontakt erstellen', + 'snack' => $request->get('snack') ]); } } diff --git a/src/Controller/TomController.php b/src/Controller/TomController.php index 396d1fae..c740effa 100644 --- a/src/Controller/TomController.php +++ b/src/Controller/TomController.php @@ -100,7 +100,7 @@ public function EditTom(ValidatorInterface $validator, Request $request, Securit $em->persist($newTom); $em->persist($tom); $em->flush(); - return $this->redirectToRoute('tom'); + return $this->redirectToRoute('tom_edit', ['tom' => $newTom->getId(), 'snack' => 'Erfolgreich gepeichert']); } } return $this->render('tom/edit.html.twig', [ @@ -109,7 +109,8 @@ public function EditTom(ValidatorInterface $validator, Request $request, Securit 'title' => 'TOM bearbeiten', 'tom' => $tom, 'activ' => $tom->getActiv(), - 'activTitel' => false + 'activTitel' => false, + 'snack' => $request->get('snack') ]); } diff --git a/src/Controller/VorfallController.php b/src/Controller/VorfallController.php index 320096ef..c97a14bf 100644 --- a/src/Controller/VorfallController.php +++ b/src/Controller/VorfallController.php @@ -99,7 +99,7 @@ public function EditVorfall(ValidatorInterface $validator, Request $request, Sec $em->persist($newVorgang); $em->persist($vorgang); $em->flush(); - return $this->redirectToRoute('vorfall'); + return $this->redirectToRoute('vorfall_edit', ['id' => $newVorgang->getId(), 'snack' => 'Erfolgreich gespeichert']); } } return $this->render('vorfall/edit.html.twig', [ @@ -108,6 +108,7 @@ public function EditVorfall(ValidatorInterface $validator, Request $request, Sec 'title' => 'Datenschutzvorfall bearbeiten', 'vorfall' => $vorgang, 'activ' => $vorgang->getActiv(), + 'snack' => $request->get('snack') ]); } } diff --git a/src/Controller/VvtController.php b/src/Controller/VvtController.php index a8948709..585b6996 100644 --- a/src/Controller/VvtController.php +++ b/src/Controller/VvtController.php @@ -194,7 +194,7 @@ public function editVvtDsfa(ValidatorInterface $validator, Request $request, VVT $em->persist($newDsfa); $em->persist($dsfa); $em->flush(); - return $this->redirectToRoute('vvt_dsfa_edit', ['id' => $newDsfa->getId(), 'snack' => 'Erfolgreich gepeichert']); + return $this->redirectToRoute('vvt_dsfa_edit', ['dsfa' => $newDsfa->getId(), 'snack' => 'Erfolgreich gepeichert']); } } diff --git a/src/Service/TomService.php b/src/Service/TomService.php index a56f5aa5..ba7ef0b9 100644 --- a/src/Service/TomService.php +++ b/src/Service/TomService.php @@ -41,7 +41,12 @@ function cloneTom(Tom $tom, User $user) $newTom->setPrevious($tom); $newTom->setCreatedAt(new \DateTime()); $newTom->setUser($user); - + foreach ($tom->getVvts() as $vvt) { + if ($vvt->getActiv()) { + $vvt->setTomLink($newTom); + $this->em->persist($vvt); + } + } return $newTom; } } diff --git a/templates/audit_tom/edit.html.twig b/templates/audit_tom/edit.html.twig index 6f9e11af..160e4c14 100644 --- a/templates/audit_tom/edit.html.twig +++ b/templates/audit_tom/edit.html.twig @@ -31,6 +31,7 @@ {{ include('audit_tom/__history.html.twig', {'p':audit.previous}) }}
    {% endif %} + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} diff --git a/templates/base/__snack.html.twig b/templates/base/__snack.html.twig index de53395a..98f1e9bf 100644 --- a/templates/base/__snack.html.twig +++ b/templates/base/__snack.html.twig @@ -1,3 +1,3 @@ {% if snack is defined and snack is not null %} -
    {{ snack }}
    +
    {{ snack }}
    {% endif %} \ No newline at end of file diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig index b2e1426a..4a5170bb 100644 --- a/templates/dashboard/__assign.html.twig +++ b/templates/dashboard/__assign.html.twig @@ -35,7 +35,7 @@
    - {% for a in assignAudit|slice(0, 3)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% for a in assignAudit |slice(0, 6)|sort((a, b) => b.createdAt <=> a.createdAt) %} {% if a.activ %}
    @@ -56,7 +56,7 @@ {% endfor %}
    {{ form_end(form) }} + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} diff --git a/templates/tom/__history.html.twig b/templates/tom/__history.html.twig index 9ce3d65d..a5ca47f1 100644 --- a/templates/tom/__history.html.twig +++ b/templates/tom/__history.html.twig @@ -1,4 +1,4 @@ -{{ p.createdAt|date('d.m.Y H:i') }} -- {{ p.titel }}-- {{ p.user.email }} +{{ p.createdAt|date('d.m.Y H:i') }} -- {{ p.titel }}-- {{ p.user.email }} {% if p.previous %} - {{ include('audit_tom/__history.html.twig', {'p':p.previous}) }} + {{ include('tom/__history.html.twig', {'p':p.previous}) }} {% endif %} \ No newline at end of file diff --git a/templates/tom/edit.html.twig b/templates/tom/edit.html.twig index be1fefb0..6a50f60a 100644 --- a/templates/tom/edit.html.twig +++ b/templates/tom/edit.html.twig @@ -21,6 +21,7 @@ {{ include('tom/__history.html.twig', {'p':tom.previous}) }}
    {% endif %} + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} diff --git a/templates/vorfall/edit.html.twig b/templates/vorfall/edit.html.twig index e824304c..f13694c6 100644 --- a/templates/vorfall/edit.html.twig +++ b/templates/vorfall/edit.html.twig @@ -24,6 +24,7 @@ {{ include('vorfall/__history.html.twig', {'p':vorfall.previous}) }}
    {% endif %} + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} diff --git a/templates/vvt/edit.html.twig b/templates/vvt/edit.html.twig index 7e7f4666..9c548aa8 100644 --- a/templates/vvt/edit.html.twig +++ b/templates/vvt/edit.html.twig @@ -35,7 +35,6 @@ {{ include('assign/__assign.html.twig',{'data':vvt,'path':'assign_vvt'}) }}
    - {{ include('base/__snack.html.twig') }} {{ include('vvt/__form.html.twig') }} @@ -46,6 +45,9 @@ {{ include('vvt/__history.html.twig', {'p':vvt.previous}) }}
    {% endif %} + + {{ include('base/__snack.html.twig') }} + {% endblock %} {% block javascript %} diff --git a/templates/vvt/editDsfa.html.twig b/templates/vvt/editDsfa.html.twig index c173f7c5..13782b96 100644 --- a/templates/vvt/editDsfa.html.twig +++ b/templates/vvt/editDsfa.html.twig @@ -76,6 +76,8 @@ {{ include('vvt/__dsfaHistory.html.twig', {'p':dsfa.previous}) }}
    {% endif %} + + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} From 6fe1bef7a9e7930515b0092dae836e63d143f7a3 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Mon, 29 Jun 2020 09:39:41 +0200 Subject: [PATCH 13/15] Changed Icons --- public/icons/data.svg | 23 +++++++++++++++++------ public/icons/prozess.svg | 21 +++++++++------------ templates/vvt/index.html.twig | 4 ++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/public/icons/data.svg b/public/icons/data.svg index 74965193..cb6b0558 100644 --- a/public/icons/data.svg +++ b/public/icons/data.svg @@ -1,10 +1,21 @@ - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/icons/prozess.svg b/public/icons/prozess.svg index cdd08ff7..473d764b 100644 --- a/public/icons/prozess.svg +++ b/public/icons/prozess.svg @@ -1,14 +1,11 @@ - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/templates/vvt/index.html.twig b/templates/vvt/index.html.twig index a8b604cb..6c905af4 100644 --- a/templates/vvt/index.html.twig +++ b/templates/vvt/index.html.twig @@ -2,12 +2,12 @@ {% block CTA %} - Neue Tätigkeit anlegen + Neue Verarbeitung anlegen {% endblock %} {% block body %} -

    Verzeichnis der Verarb.-Tätigkeiten

    +

    Verzeichnis der Verarbeitungen

    From 83b300c49978eb4884a1d60cd950461a92563ad1 Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Mon, 29 Jun 2020 10:59:58 +0200 Subject: [PATCH 14/15] Changed Icons --- public/css/style.css | 2 +- templates/dashboard/__assign.html.twig | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index c971ac12..4321d69c 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -24,7 +24,7 @@ .bg-dsfa { background-color: #00e676; - color: whitesmoke !important; + color: black !important; } .bg-audit { diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig index 4a5170bb..d52295f1 100644 --- a/templates/dashboard/__assign.html.twig +++ b/templates/dashboard/__assign.html.twig @@ -41,7 +41,7 @@
    - +
    {{ a.frage }} @@ -62,7 +62,7 @@
    - +
    {{ a.name }} @@ -86,7 +86,7 @@
    - +
    {{ a.beschreibung }} @@ -107,7 +107,7 @@
    - +
    {{ a.gegenstand }} From 193032eadac31854530607437d887775dd8744ee Mon Sep 17 00:00:00 2001 From: "andreas.holzmann" Date: Mon, 29 Jun 2020 19:13:53 +0200 Subject: [PATCH 15/15] Responsiv assignment --- public/icons/online-learning.svg | 8 ++++ src/Controller/DashboardController.php | 6 ++- .../AkademieBuchungenRepository.php | 12 ++++- templates/base/__sidenav.html.twig | 4 +- templates/dashboard/__assign.html.twig | 46 +++++++++++++++---- 5 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 public/icons/online-learning.svg diff --git a/public/icons/online-learning.svg b/public/icons/online-learning.svg new file mode 100644 index 00000000..079bd9ea --- /dev/null +++ b/public/icons/online-learning.svg @@ -0,0 +1,8 @@ + + + + + + + diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index 2485f252..1d97072e 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -8,6 +8,7 @@ namespace App\Controller; +use App\Entity\AkademieBuchungen; use App\Entity\AuditTom; use App\Entity\Datenweitergabe; use App\Entity\Kontakte; @@ -73,6 +74,8 @@ public function dashboard() $assignDsfa = $this->getUser()->getAssignedDsfa()->toarray(); $assignDatenweitergabe = $this->getUser()->getAssignedDatenweitergaben()->toarray(); + $buchungen = $this->getDoctrine()->getRepository(AkademieBuchungen::class)->findActivBuchungenByUser($this->getUser()); + return $this->render('dashboard/index.html.twig', [ 'controller_name' => 'DashboardController', 'team' => $team, @@ -89,7 +92,8 @@ public function dashboard() 'assignDaten' => $assignDatenweitergabe, 'assignVvt' => $assignVvt, 'assignAudit' => $assignAudit, - 'assignDsfa' => $assignDsfa + 'assignDsfa' => $assignDsfa, + 'akademie' => $buchungen ]); } } diff --git a/src/Repository/AkademieBuchungenRepository.php b/src/Repository/AkademieBuchungenRepository.php index 3a0f9709..bf3a0e2f 100644 --- a/src/Repository/AkademieBuchungenRepository.php +++ b/src/Repository/AkademieBuchungenRepository.php @@ -3,8 +3,8 @@ namespace App\Repository; use App\Entity\AkademieBuchungen; +use App\Entity\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\DBAL\Types\DateType; use Doctrine\Persistence\ManagerRegistry; /** @@ -58,6 +58,16 @@ public function findMyBuchungenByUser($value) ->getResult(); } + public function findActivBuchungenByUser(User $user) + { + return $this->createQueryBuilder('a') + ->andWhere('a.user = :user') + ->andWhere('a.abgeschlossen = 0') + ->setParameter('user', $user) + ->getQuery() + ->getResult(); + } + public function findBuchungenByTeam($team, $kurs) { return $this->createQueryBuilder('a') diff --git a/templates/base/__sidenav.html.twig b/templates/base/__sidenav.html.twig index d00470e7..5807a283 100644 --- a/templates/base/__sidenav.html.twig +++ b/templates/base/__sidenav.html.twig @@ -81,7 +81,9 @@ diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig index d52295f1..aa472992 100644 --- a/templates/dashboard/__assign.html.twig +++ b/templates/dashboard/__assign.html.twig @@ -8,33 +8,59 @@
    -
    + +
    {% for a in assignAudit |slice(0, 6)|sort((a, b) => b.createdAt <=> a.createdAt) %} {% if a.activ %}