Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2021-05-21 11:06:50 +02:00
commit aef67571f6
3 changed files with 10 additions and 5 deletions

View File

@ -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,
]);
}

View File

@ -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) {

View File

@ -18,7 +18,7 @@
{% endfor %}
<form name="toread" method="post">
<input style="float:left; zoom:1.7;margin:5px 0px 0px 0px;" type="checkbox" id="readcharte" name="readcharte" value="0">
<span style="float:left; zoom: 1.7;margin-top: 3px;">Accepter la charte d'utilisation</span>
</form>
@ -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 %}