return to page groupe after add member (ref #109)

This commit is contained in:
afornerot 2020-04-06 10:15:22 +02:00
parent ab3d712a93
commit 8d03012ba1
4 changed files with 15 additions and 5 deletions

View File

@ -931,13 +931,17 @@ class GroupController extends Controller
$data=$this->getData($id);
$this->canManager($data,$access);
// idreturn ?
$idreturn=$request->get("idreturn");
// Affichage du formulaire
return $this->render($this->labelentity.':users.html.twig', [
'useheader' => true,
'usemenu' => false,
'usesidebar' => ($access=="config"),
'access' => $access,
$this->labeldata => $data
$this->labeldata => $data,
'idreturn' => $idreturn,
]);
}

View File

@ -3,7 +3,12 @@
{% block pagewrapper %}
<h1 class="page-header">Gestion des Utilisateurs</h1>
<h2>Groupe = {{ group.label }}</h2>
<a class="btn btn-default" href={{ path('cadoles_core_'~access~'_group') }}>Fermer</a>
{% if idreturn is empty %}
<a class="btn btn-default" href={{ path('cadoles_core_'~access~'_group') }}>Fermer</a>
{% else %}
<a class="btn btn-default" href={{ path('cadoles_core_home',{'id':idreturn}) }}>Fermer</a>
{% endif %}
{% if moderegistration!="none" and masteridentity=="SQL"%}
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
{%endif%}

View File

@ -1889,6 +1889,7 @@ class PagewidgetController extends Controller
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
$page=$entity->getPage();
// Permissions
if($access=="config") {
@ -1896,7 +1897,6 @@ class PagewidgetController extends Controller
}
else {
// On s'assure que l'utilisateur à la permission de voir
$page=$entity->getPage();
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
if(!$cansee) throw $this->createNotFoundException('Permission denied');
}
@ -1942,6 +1942,7 @@ class PagewidgetController extends Controller
'description' => $description,
'members' => $members,
'id' => $id,
'idpage' => $page->getId(),
]);
}

View File

@ -54,7 +54,7 @@
{% if canadd==true %}
<div class="grid-item grid-verysmall" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-content">
<a href="{{path('cadoles_core_user_group_users',{'id':id})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
<a href="{{path('cadoles_core_user_group_users',{'id':id,'idreturn':idpage})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
<div class="item-link clearfix">
<div class="grid-item-logo">
<img class="grid-item-img imageshadow" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />