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/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..160baa3e 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,10 +4,11 @@ # 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)%' + 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..4321d69c 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: black !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,87 @@ label.required:after { #footer { position: absolute; bottom: 0px; +} + + +/* --------------------------------------------------- + Custom Buttons +----------------------------------------------------- */ +.btn-primary { + background-color: var(--main-color) !important; +} + +.btn-secondary { + background-color: var(--sec-color) !important; +} + +.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/icons/data.svg b/public/icons/data.svg new file mode 100644 index 00000000..cb6b0558 --- /dev/null +++ b/public/icons/data.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + \ 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/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/public/icons/prozess.svg b/public/icons/prozess.svg new file mode 100644 index 00000000..473d764b --- /dev/null +++ b/public/icons/prozess.svg @@ -0,0 +1,11 @@ + + + + + + + + + + \ 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/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/AssignController.php b/src/Controller/AssignController.php new file mode 100644 index 00000000..1a49ac1f --- /dev/null +++ b/src/Controller/AssignController.php @@ -0,0 +1,95 @@ +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', [ + 'assignDaten' => $assignDatenweitergabe, + 'assignVvt' => $assignVvt, + 'assignAudit' => $assignAudit, + 'assignDsfa' => $assignDsfa + ]); + } + + /** + * @Route("/assign/vvt", name="assign_vvt") + */ + 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, $vvt); + return $this->redirect($request->headers->get('referer')); + } + + /** + * @Route("/assign/audit", name="assign_audit") + */ + 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, $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/AuditTomController.php b/src/Controller/AuditTomController.php index a5f37ace..ee5a2732 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); @@ -137,17 +140,19 @@ 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', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'A-Frage bearbeiten', 'audit' => $audit, 'activ' => $audit->getActiv(), 'activNummer' => false, 'nextAudit' => $nextAudit, + 'snack' => $request->get('snack') ]); } diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index dce20f33..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; @@ -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,13 @@ public function dashboard() $query = $qb->getQuery(); $openDsfa = $query->getResult(); + $assignVvt = $this->getUser()->getAssignedVvts()->toarray(); + $assignAudit = $this->getUser()->getAssignedAudits()->toarray(); + $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, @@ -80,7 +88,12 @@ public function dashboard() 'kVvt' => $kristischeVvts, 'openDsfa' => $openDsfa, 'tom' => $tom, - 'av' => $av + 'av' => $av, + 'assignDaten' => $assignDatenweitergabe, + 'assignVvt' => $assignVvt, + 'assignAudit' => $assignAudit, + 'assignDsfa' => $assignDsfa, + 'akademie' => $buchungen ]); } } diff --git a/src/Controller/DatenweitergabeController.php b/src/Controller/DatenweitergabeController.php index fd10fe41..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()) { @@ -175,20 +177,18 @@ 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', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Datenweitergabe bearbeiten', 'daten' => $daten, 'activ' => $daten->getActiv(), - 'activNummer' => false + 'activNummer' => false, + 'snack' => $request->get('snack') ]); } @@ -199,19 +199,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/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 e6ed527a..585b6996 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(); @@ -111,17 +112,19 @@ 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']); } } return $this->render('vvt/edit.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Verarbeitungstätigkeit bearbeiten', 'vvt' => $vvt, 'activ' => $vvt->getActiv(), 'activNummer' => false, + 'snack' => $request->get('snack') ]); } @@ -151,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', [ @@ -166,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')); @@ -179,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()) { @@ -190,16 +194,18 @@ 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', ['dsfa' => $newDsfa->getId(), 'snack' => 'Erfolgreich gepeichert']); } } return $this->render('vvt/editDsfa.html.twig', [ 'form' => $form->createView(), + 'assignForm' => $assign->createView(), 'errors' => $errors, 'title' => 'Datenschutzfolgeabschätzung bearbeiten', 'dsfa' => $dsfa, 'activ' => $dsfa->getActiv(), + 'snack' => $request->get('snack') ]); } } 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/Datenweitergabe.php b/src/Entity/Datenweitergabe.php index 19fa4ce5..aedb3875 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,19 +123,24 @@ 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") */ private $verfahren; + /** + * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedDatenweitergaben") + */ + private $assignedUser; + public function __construct() { $this->verfahren = new ArrayCollection(); @@ -316,32 +321,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 @@ -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 1c3967ed..1c550f61 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -85,6 +85,26 @@ class User extends BaseUser */ private $akademieKurses; + /** + * @ORM\OneToMany(targetEntity=VVT::class, mappedBy="assignedUser") + */ + private $assignedVvts; + + /** + * @ORM\OneToMany(targetEntity=AuditTom::class, mappedBy="assignedUser") + */ + private $assignedAudits; + + /** + * @ORM\OneToMany(targetEntity=Datenweitergabe::class, mappedBy="assignedUser") + */ + private $assignedDatenweitergaben; + + /** + * @ORM\OneToMany(targetEntity=VVTDsfa::class, mappedBy="assignedUser") + */ + private $assignedDsfa; + public function __construct() { @@ -97,6 +117,10 @@ public function __construct() $this->toms = new ArrayCollection(); $this->vorfalls = new ArrayCollection(); $this->akademieKurses = new ArrayCollection(); + $this->assignedVvts = new ArrayCollection(); + $this->assignedAudits = new ArrayCollection(); + $this->assignedDatenweitergaben = new ArrayCollection(); + $this->assignedDsfa = new ArrayCollection(); } public function getTeam(): ?Team @@ -383,4 +407,128 @@ 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; + } + + /** + * @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/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/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/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/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/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/src/Service/AssignService.php b/src/Service/AssignService.php new file mode 100644 index 00000000..f88cb7e7 --- /dev/null +++ b/src/Service/AssignService.php @@ -0,0 +1,175 @@ +em = $entityManager; + $this->formBuilder = $formBuilder; + $this->router = $router; + $this->notificationService = $notificationService; + $this->twig = $engine; + } + + function assign($request, User $user) + { + $assignDatenweitergabe = $user->getAssignedDatenweitergaben()->toarray(); + $assignVvt = $user->getAssignedVvts()->toarray(); + $assignAudit = $user->getAssignedAudits()->toarray(); + $assignDsfa = $user->getAssignedDsfa()->toarray(); + + $assign = array(); + try { + if ($request->get('vvt')) { + $assignVvt = array(); + } + if ($request->get('audit')) { + $assignAudit = array(); + } + if ($request->get('dsfa')) { + $assignDsfa = array(); + } + if ($request->get('daten')) { + $assignDatenweitergabe = array(); + } + + $assign = new ArrayCollection(array_merge($assignAudit, $assignVvt, $assignDsfa, $assignDatenweitergabe)); + + return $assign; + + } catch (\Exception $exception) { + return $assign; + } + } + + function createForm($data, Team $team) + { + $form = $this->formBuilder->create(AssignType::class, $data, ['user' => $team->getMembers()]); + return $form; + } + + function assignVvt($request, VVT $vvt) + { + try { + + if ($vvt->getAssignedUser() == null) { + $data = $request->get('assign'); + $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); + } + $this->em->persist($vvt); + $this->em->flush(); + + + return true; + } catch (\Exception $exception) { + return false; + } + } + + function assignAudit($request, AuditTom $audit) + { + try { + + if ($audit->getAssignedUser() == null) { + $data = $request->get('assign'); + $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); + } + $this->em->persist($audit); + $this->em->flush(); + + return true; + } catch (\Exception $exception) { + 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/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/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/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/__assign.html.twig b/templates/assign/__assign.html.twig new file mode 100644 index 00000000..5f9ed71b --- /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 }} X +{% endif %} \ No newline at end of file diff --git a/templates/assign/__assignItem.html.twig b/templates/assign/__assignItem.html.twig new file mode 100644 index 00000000..4d952f07 --- /dev/null +++ b/templates/assign/__assignItem.html.twig @@ -0,0 +1,57 @@ + +
+
+
+ {% if a.name is defined %} + + {% elseif a.frage is defined %} + + {% elseif a.grundlage is defined %} + + {% elseif a.beschreibung is defined %} + + {% endif %} +
+
+ {% if a.name is defined %} + {{ 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') }} +
+
+ {% if a.nummer is defined %} + {{ a.nummer }} + {% endif %} +
+
+ {% if a.status is defined %} + {{ a.status.name }} + {% 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..a274ffad --- /dev/null +++ b/templates/assign/index.html.twig @@ -0,0 +1,129 @@ +{% extends 'base.html.twig' %} + +{% block CTA %} +{% endblock %} + +{% block body %} +

Meine Zuweisungen

+
+ + +
+
+ {% 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/audit_tom/edit.html.twig b/templates/audit_tom/edit.html.twig index c3ce0e84..160e4c14 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') }}
@@ -24,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/__sidenav.html.twig b/templates/base/__sidenav.html.twig index 10173902..5807a283 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 %}
  • @@ -77,9 +80,11 @@ diff --git a/templates/base/__snack.html.twig b/templates/base/__snack.html.twig new file mode 100644 index 00000000..98f1e9bf --- /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/bericht/index.html.twig b/templates/bericht/index.html.twig index 52b47233..44c872da 100644 --- a/templates/bericht/index.html.twig +++ b/templates/bericht/index.html.twig @@ -11,10 +11,10 @@

    Verarbeitungstätigkeiten (VVT)

    - + PDF von allen VVTs erstellen - + PDF von allen VVTs inkl. Historie erstellen
    @@ -22,21 +22,21 @@

    Datenweitergaben (DW)

    - + PDF von allen DWs erstellen - + PDF von allen DWs inkl. Historie erstellen
    -

    Auftragsdatenverarbeitung (AVV)

    - +

    Auftragsverarbeitung (AV)

    +
    PDF von allen AVVs erstellen - + PDF von allen AVVs inkl. Historie erstellen
    @@ -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 @@
    {% endblock %} \ No newline at end of file diff --git a/templates/dashboard/__assign.html.twig b/templates/dashboard/__assign.html.twig new file mode 100644 index 00000000..aa472992 --- /dev/null +++ b/templates/dashboard/__assign.html.twig @@ -0,0 +1,157 @@ + +
    + +
    + Meine Zuweisungen +
    + +
    + + +
    + +
    + {% for a in assignAudit |slice(0, 6)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.frage }} +
    +
    + {{ a.status.name }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + {% for a in assignVvt|slice(0, 6)|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, 6)|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, 6)|sort((a, b) => b.createdAt <=> a.createdAt) %} + {% if a.activ %} + +
    +
    +
    + +
    +
    + {{ a.gegenstand }} +
    +
    + {{ a.createdAt|date('d.m.Y') }} +
    +
    +
    +
    + {% endif %} + {% endfor %} +
    +
    + Alle Zuweisungen + anzeigen + +
    + +
    + \ No newline at end of file diff --git a/templates/dashboard/index.html.twig b/templates/dashboard/index.html.twig index d007af16..2907bc6d 100644 --- a/templates/dashboard/index.html.twig +++ b/templates/dashboard/index.html.twig @@ -13,24 +13,15 @@
    @@ -74,7 +65,8 @@ @@ -84,7 +76,8 @@ @@ -115,8 +108,10 @@
    + {{ include('dashboard/__assign.html.twig') }} + -
    +
    Letzte Änderungen @@ -126,21 +121,22 @@
    Auditfragen
    +
    Verarbeitungsverzeichnisse
    +
    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..23bb5648 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('datenweitergabe/__form.html.twig') }} @@ -25,7 +31,8 @@ {{ include('datenweitergabe/__history.html.twig', {'p':daten.previous}) }}
    {% endif %} + {{ include('base/__snack.html.twig') }} {% endblock %} -{% block javascript %} -{% endblock %} + {% block javascript %} + {% endblock %} diff --git a/templates/email/assignementAudit.html.twig b/templates/email/assignementAudit.html.twig new file mode 100644 index 00000000..a8602439 --- /dev/null +++ b/templates/email/assignementAudit.html.twig @@ -0,0 +1,32 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + -- Neue Auditfrage zum Bearbeiten zugewiesen -- +{% endblock %} + +{% block content %} +

    + {{ assign }} +

    + + 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/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 new file mode 100644 index 00000000..d8baf5b5 --- /dev/null +++ b/templates/email/assignementVvt.html.twig @@ -0,0 +1,32 @@ +{% extends 'email/base.html.twig' %} +{% block header %} + -- Neue Verarbeitung zum Bearbeiten zugewiesen -- +{% endblock %} + +{% block content %} +

    + {{ assign }} +

    + + 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 %} 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! diff --git a/templates/kontakt/edit.html.twig b/templates/kontakt/edit.html.twig index 06327e30..09849894 100644 --- a/templates/kontakt/edit.html.twig +++ b/templates/kontakt/edit.html.twig @@ -31,6 +31,7 @@ {{ form_widget(form.save) }}
    {{ form_end(form) }} + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} 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 %}{{ 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 bea214f1..9c548aa8 100644 --- a/templates/vvt/edit.html.twig +++ b/templates/vvt/edit.html.twig @@ -24,8 +24,19 @@ {% 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 %} @@ -34,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 3cc7be79..13782b96 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) }}
    @@ -70,6 +76,8 @@ {{ include('vvt/__dsfaHistory.html.twig', {'p':dsfa.previous}) }}
    {% endif %} + + {{ include('base/__snack.html.twig') }} {% endblock %} {% block javascript %} 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