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