mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
add PrivacyEvent for documents edit and update
This commit is contained in:
parent
e2cbd65775
commit
493cdca479
@ -22,4 +22,5 @@ PrivacyEvent branch
|
|||||||
===================
|
===================
|
||||||
|
|
||||||
- add privacy events to document index / show
|
- add privacy events to document index / show
|
||||||
|
- add privacy events to document edit / update
|
||||||
|
|
||||||
|
@ -175,13 +175,28 @@ class DocumentPersonController extends Controller
|
|||||||
|
|
||||||
$this->addFlash('success', $this->translator->trans("The document is successfully updated"));
|
$this->addFlash('success', $this->translator->trans("The document is successfully updated"));
|
||||||
|
|
||||||
|
$event = new PrivacyEvent($person, array(
|
||||||
|
'element_class' => PersonDocument::class,
|
||||||
|
'element_id' => $document->getId(),
|
||||||
|
'action' => 'update'
|
||||||
|
));
|
||||||
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
return $this->redirectToRoute(
|
return $this->redirectToRoute(
|
||||||
'person_document_edit',
|
'person_document_edit',
|
||||||
['id' => $document->getId(), 'person' => $person->getId()]);
|
['id' => $document->getId(), 'person' => $person->getId()]);
|
||||||
|
|
||||||
} elseif ($form->isSubmitted() and !$form->isValid()) {
|
} elseif ($form->isSubmitted() and !$form->isValid()) {
|
||||||
$this->addFlash('error', $this->translator->trans("This form contains errors"));
|
$this->addFlash('error', $this->translator->trans("This form contains errors"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$event = new PrivacyEvent($person, array(
|
||||||
|
'element_class' => PersonDocument::class,
|
||||||
|
'element_id' => $document->getId(),
|
||||||
|
'action' => 'edit'
|
||||||
|
));
|
||||||
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'ChillDocStoreBundle:PersonDocument:edit.html.twig',
|
'ChillDocStoreBundle:PersonDocument:edit.html.twig',
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user