redirection vers le groupe après signature de la charte
This commit is contained in:
parent
2b4d048f9d
commit
2679d8f629
|
@ -59,17 +59,18 @@ class CoreController extends Controller
|
||||||
|
|
||||||
// Chargement des chartes à signer
|
// Chargement des chartes à signer
|
||||||
if($user) {
|
if($user) {
|
||||||
|
|
||||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
||||||
if(! $notices->isEmpty()) {
|
if(! $notices->isEmpty()) {
|
||||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeUser($user,false);
|
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeUser($user,false);
|
||||||
|
|
||||||
return $this->render('CadolesPortalBundle:Notice:mustread.html.twig',[
|
return $this->render('CadolesPortalBundle:Notice:mustread.html.twig',[
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usemenu' => false,
|
'usemenu' => false,
|
||||||
'usesidebar' => false,
|
'usesidebar' => false,
|
||||||
'maxwidth' => true,
|
'maxwidth' => true,
|
||||||
'mustread' => true,
|
'mustread' => true,
|
||||||
'notices' => $notices
|
'notices' => $notices,
|
||||||
|
'id' => $id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,10 @@ class NoticeController extends Controller
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
$notices=$em->getRepository("CadolesPortalBundle:Notice")->getNoticeToRead($user);
|
||||||
|
|
||||||
|
// Récupération redirection potentielle
|
||||||
|
$id = $request->get('id');
|
||||||
|
|
||||||
foreach($notices as $notice) {
|
foreach($notices as $notice) {
|
||||||
$users=$notice->getUsers();
|
$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) {
|
public function viewAction(Request $request) {
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
function haveRead() {
|
function haveRead() {
|
||||||
if($("#readcharte").val()=="1") {
|
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 %}
|
{% endblock %}
|
Loading…
Reference in New Issue