Commit 9c51d673 authored by Mat's avatar Mat

add privacyEvent for edit and update singleTask

parent 508e8ae7
Pipeline #82457 passed with stage
in 16 seconds
......@@ -12,4 +12,5 @@ PrivacyEvent branch
===================
- add privacy events to task show / list;
- add privacy events to task edit / update;
......@@ -156,7 +156,7 @@ class SingleTaskController extends Controller
$event = new PrivacyEvent($person, array(
'element_class' => SingleTask::class,
'element_id' => intval($id),
'element_id' => $task->getId(),
'action' => 'show'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
......@@ -224,6 +224,13 @@ class SingleTaskController extends Controller
$this->addFlash('success', $translator
->trans("The task has been updated"));
$event = new PrivacyEvent($person, array(
'element_class' => SingleTask::class,
'element_id' => $task->getId(),
'action' => 'update'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
return $this->redirectToRoute(
'chill_task_singletask_list',
......@@ -240,7 +247,14 @@ class SingleTaskController extends Controller
if ($event->hasResponse()) {
return $event->getResponse();
}
$event = new PrivacyEvent($person, array(
'element_class' => SingleTask::class,
'element_id' => $task->getId(),
'action' => 'edit'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
return $this->render('ChillTaskBundle:SingleTask:edit.html.twig', array(
'task' => $task,
'form' => $form->createView()
......
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