Commit f0a0f46f authored by Mat's avatar Mat

add privacyEvents for report edit and update

parent a3a4d31f
Pipeline #82451 failed with stage
in 2 minutes and 13 seconds
......@@ -9,4 +9,5 @@ PrivacyEvent branch
===================
- add privacy events to report list / view
- add privacy events to report edit / update
......@@ -407,7 +407,7 @@ class ReportController extends Controller
$event = new PrivacyEvent($person, array(
'element_class' => Report::class,
'element_id' => intval($report_id),
'element_id' => $entity->getId(),
'action' => 'view'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
......@@ -446,6 +446,13 @@ class ReportController extends Controller
$person = $report->getPerson();
$editForm = $this->createEditForm($report);
$event = new PrivacyEvent($person, array(
'element_class' => Report::class,
'element_id' => $report->getId(),
'action' => 'edit'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
return $this->render('ChillReportBundle:Report:edit.html.twig', array(
'edit_form' => $editForm->createView(),
......@@ -507,7 +514,16 @@ class ReportController extends Controller
$this->get('translator')
->trans('Success : report updated!')
);
$person = $report->getPerson();
$event = new PrivacyEvent($person, array(
'element_class' => Report::class,
'element_id' => $report->getId(),
'action' => 'update'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
return $this->redirect($this->generateUrl('report_view',
array('person_id' => $report->getPerson()->getId(), 'report_id' => $report_id)));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment