mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
add privacyEvents for report edit and update
This commit is contained in:
parent
a3a4d31f8b
commit
f0a0f46ff1
@ -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)));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user