Correct bug where page didn't get proper informations
This commit is contained in:
parent
184bfa2604
commit
f8ba879cc9
|
|
@ -65,7 +65,7 @@ class OrganizationController extends AbstractController
|
||||||
}
|
}
|
||||||
if ($this->isgranted("ROLE_ADMIN")) {
|
if ($this->isgranted("ROLE_ADMIN")) {
|
||||||
return $this->render('organization/index.html.twig', [
|
return $this->render('organization/index.html.twig', [
|
||||||
'hasOrganizations' => $orgs > 1
|
'hasOrganizations' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$this->loggerService->logEntityNotFound('Organization', [
|
$this->loggerService->logEntityNotFound('Organization', [
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ use App\Entity\Actions;
|
||||||
use App\Entity\Organizations;
|
use App\Entity\Organizations;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Entity\UsersOrganizations;
|
use App\Entity\UsersOrganizations;
|
||||||
|
use App\Repository\RolesRepository;
|
||||||
use App\Service\ActionService;
|
use App\Service\ActionService;
|
||||||
use App\Service\LoggerService;
|
use App\Service\LoggerService;
|
||||||
use \App\Service\UserOrganizationAppService;
|
use \App\Service\UserOrganizationAppService;
|
||||||
|
|
@ -20,7 +21,7 @@ readonly class UserOrganizationService
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private userOrganizationAppService $userOrganizationAppService, private EntityManagerInterface $entityManager, private ActionService $actionService, private LoggerService $loggerService,
|
private userOrganizationAppService $userOrganizationAppService, private EntityManagerInterface $entityManager, private ActionService $actionService, private LoggerService $loggerService, private RolesRepository $rolesRepository,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,7 +58,7 @@ readonly class UserOrganizationService
|
||||||
|
|
||||||
public function getAdminOrganizationsForUser(User $user): array
|
public function getAdminOrganizationsForUser(User $user): array
|
||||||
{
|
{
|
||||||
$adminRole = 'ADMIN'; // Assuming 'ADMIN' is the role name for administrators
|
$adminRole = $this->rolesRepository->findOneBy(['name' => "ADMIN"]); // Assuming 'ADMIN' is the role name for administrators
|
||||||
$uos = $this->entityManager->getRepository(UsersOrganizations::class)->findBy(['users' => $user, 'role' => $adminRole, 'isActive' => true]);
|
$uos = $this->entityManager->getRepository(UsersOrganizations::class)->findBy(['users' => $user, 'role' => $adminRole, 'isActive' => true]);
|
||||||
$adminOrgs = [];
|
$adminOrgs = [];
|
||||||
foreach ($uos as $uo) {
|
foreach ($uos as $uo) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue