mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
add privacy event to edit, update actions
This commit is contained in:
parent
13333ed54a
commit
b6ab04f3e3
@ -28,7 +28,6 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\ActivityBundle\Form\ActivityType;
|
use Chill\ActivityBundle\Form\ActivityType;
|
||||||
@ -226,7 +225,7 @@ class ActivityController extends Controller
|
|||||||
|
|
||||||
$event = new PrivacyEvent($person, array(
|
$event = new PrivacyEvent($person, array(
|
||||||
'element_class' => Activity::class,
|
'element_class' => Activity::class,
|
||||||
'element_id' => intval($id),
|
'element_id' => $entity->getId(),
|
||||||
'action' => 'show'
|
'action' => 'show'
|
||||||
));
|
));
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
@ -264,6 +263,13 @@ class ActivityController extends Controller
|
|||||||
$editForm = $this->createEditForm($entity);
|
$editForm = $this->createEditForm($entity);
|
||||||
$deleteForm = $this->createDeleteForm($id, $person);
|
$deleteForm = $this->createDeleteForm($id, $person);
|
||||||
|
|
||||||
|
$event = new PrivacyEvent($person, array(
|
||||||
|
'element_class' => Activity::class,
|
||||||
|
'element_id' => $entity->getId(),
|
||||||
|
'action' => 'show'
|
||||||
|
));
|
||||||
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
|
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'edit_form' => $editForm->createView(),
|
'edit_form' => $editForm->createView(),
|
||||||
@ -315,6 +321,13 @@ class ActivityController extends Controller
|
|||||||
$editForm = $this->createEditForm($entity);
|
$editForm = $this->createEditForm($entity);
|
||||||
$editForm->handleRequest($request);
|
$editForm->handleRequest($request);
|
||||||
|
|
||||||
|
$event = new PrivacyEvent($person, array(
|
||||||
|
'element_class' => Activity::class,
|
||||||
|
'element_id' => $entity->getId(),
|
||||||
|
'action' => 'update'
|
||||||
|
));
|
||||||
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
if ($editForm->isValid()) {
|
if ($editForm->isValid()) {
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user