update userOrg update info
This commit is contained in:
parent
1053a2ab22
commit
bdf9f0478e
|
|
@ -63,7 +63,7 @@ class UserController extends AbstractController
|
||||||
* GET /user/{id} - Show specific user (show/member)
|
* GET /user/{id} - Show specific user (show/member)
|
||||||
*/
|
*/
|
||||||
#[Route('/{id}', name: 'show', requirements: ['id' => '\d+'], methods: ['GET'])]
|
#[Route('/{id}', name: 'show', requirements: ['id' => '\d+'], methods: ['GET'])]
|
||||||
public function show(int $id, EntityManagerInterface $entityManager): Response
|
public function show(int $id, EntityManagerInterface $entityManager, Request $request): Response
|
||||||
{
|
{
|
||||||
if (!$this->isGranted('ROLE_SUPER_ADMIN')) {
|
if (!$this->isGranted('ROLE_SUPER_ADMIN')) {
|
||||||
throw $this->createAccessDeniedException(self::ACCESS_DENIED);
|
throw $this->createAccessDeniedException(self::ACCESS_DENIED);
|
||||||
|
|
@ -73,8 +73,11 @@ class UserController extends AbstractController
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw $this->createNotFoundException(self::NOT_FOUND);
|
throw $this->createNotFoundException(self::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
if($request->query->has('organizationId')) {
|
||||||
|
$userOrganizations = $this->userOrganizationService->getUserOrganizations($user, $request->query->get('organizationId'));
|
||||||
|
}else{
|
||||||
$userOrganizations = $this->userOrganizationService->getUserOrganizations($user);
|
$userOrganizations = $this->userOrganizationService->getUserOrganizations($user);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->render('user/show.html.twig', [
|
return $this->render('user/show.html.twig', [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
|
|
@ -310,7 +313,7 @@ class UserController extends AbstractController
|
||||||
|
|
||||||
// Fetch all roles and apps
|
// Fetch all roles and apps
|
||||||
$roles = $entityManager->getRepository(Roles::class)->findAll();
|
$roles = $entityManager->getRepository(Roles::class)->findAll();
|
||||||
$apps = $entityManager->getRepository(Apps::class)->findAll();
|
$apps = $organization->getApps() ?? throw $this->createNotFoundException(self::NOT_FOUND);
|
||||||
if (!$roles) {
|
if (!$roles) {
|
||||||
throw $this->createNotFoundException(self::NOT_FOUND);
|
throw $this->createNotFoundException(self::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
{% include 'user/userListSmall.html.twig' with {
|
{% include 'user/userListSmall.html.twig' with {
|
||||||
title: 'Nouveaux utilisateurs',
|
title: 'Nouveaux utilisateurs',
|
||||||
users: newUsers,
|
users: newUsers,
|
||||||
empty_message: 'Aucun nouvel utilisateur trouvé.',
|
empty_message: 'Aucun nouveaux utilisateurs trouvé.',
|
||||||
organizationId: organization.id
|
organizationId: organization.id
|
||||||
} %}
|
} %}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -24,13 +24,15 @@
|
||||||
{% include 'user/userListSmall.html.twig' with {
|
{% include 'user/userListSmall.html.twig' with {
|
||||||
title: 'Administrateurs',
|
title: 'Administrateurs',
|
||||||
users: adminUsers,
|
users: adminUsers,
|
||||||
empty_message: 'Aucun administrateur trouvé.'
|
empty_message: 'Aucun administrateur trouvé.',
|
||||||
|
organizationId: organization.id
|
||||||
} %}
|
} %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-auto">
|
<div class="m-auto">
|
||||||
{% include 'user/userList.html.twig' with {
|
{% include 'user/userList.html.twig' with {
|
||||||
title: 'Mes utilisateurs',
|
title: 'Mes utilisateurs',
|
||||||
|
organizationId: organization.id
|
||||||
} %}
|
} %}
|
||||||
</div>
|
</div>
|
||||||
{# APPLICATION ROW #}
|
{# APPLICATION ROW #}
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,17 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('user_show', {'id': user.users.id}) }}" class="p-3 align-middle">
|
{% if organizationId is defined %}
|
||||||
<i class="icon-grid menu-icon color-primary">
|
<a href="{{ path('user_show', {'id': user.users.id, 'organizationId': organizationId}) }}"
|
||||||
|
class="p-3 align-middle color-primary">
|
||||||
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
||||||
</a>
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ path('user_show', {'id': user.users.id}) }}"
|
||||||
|
class="p-3 align-middle color-primary">
|
||||||
|
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,18 @@
|
||||||
</td>
|
</td>
|
||||||
<td>{{ user.email }}</td>
|
<td>{{ user.email }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if organizationId is defined %}
|
||||||
|
<a href="{{ path('user_show', {'id': user.id, 'organizationId': organizationId}) }}"
|
||||||
|
class="p-3 align-middle color-primary">
|
||||||
|
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
<a href="{{ path('user_show', {'id': user.id}) }}"
|
<a href="{{ path('user_show', {'id': user.id}) }}"
|
||||||
class="p-3 align-middle color-primary">
|
class="p-3 align-middle color-primary">
|
||||||
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
{{ ux_icon('fa6-regular:eye', {height: '30px', width: '30px'}) }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue