diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php index 44107289..1dc56dc5 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php @@ -59,17 +59,18 @@ class CoreController extends Controller // Chargement des chartes à signer if($user) { + $notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user); if(! $notices->isEmpty()) { $notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeUser($user,false); - return $this->render('CadolesPortalBundle:Notice:mustread.html.twig',[ 'useheader' => true, 'usemenu' => false, 'usesidebar' => false, 'maxwidth' => true, 'mustread' => true, - 'notices' => $notices + 'notices' => $notices, + 'id' => $id, ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/NoticeController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/NoticeController.php index f16edb1c..36477c9d 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/NoticeController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/NoticeController.php @@ -210,6 +210,10 @@ class NoticeController extends Controller $em = $this->getDoctrine()->getManager(); $user=$this->getUser(); $notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user); + + // Récupération redirection potentielle + $id = $request->get('id'); + foreach($notices as $notice) { $users=$notice->getUsers(); @@ -223,7 +227,7 @@ class NoticeController extends Controller } } - return $this->redirectToRoute("cadoles_core_home"); + return $this->redirectToRoute("cadoles_core_home",["id"=>$id]); } public function viewAction(Request $request) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Notice/mustread.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Notice/mustread.html.twig index d4d4cb50..7b2278bc 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Notice/mustread.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Notice/mustread.html.twig @@ -18,7 +18,7 @@ {% endfor %}
@@ -37,7 +37,7 @@ function haveRead() { if($("#readcharte").val()=="1") { - document.location.href ="{{ path("cadoles_portal_user_notice_haveread") }}"; + document.location.href ="{{ path("cadoles_portal_user_notice_haveread",{id:id}) }}"; } } {% endblock %} \ No newline at end of file