refactor + default value
This commit is contained in:
parent
cfe89f58db
commit
e87fdd32e4
|
|
@ -42,6 +42,7 @@ class UsersOrganizations
|
|||
public function __construct()
|
||||
{
|
||||
$this->apps = new ArrayCollection();
|
||||
$this->isActive = true; // Default value for isActive
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
|||
|
|
@ -24,9 +24,11 @@
|
|||
<p><b>Role:</b>
|
||||
{% if roles|length > 0 %}
|
||||
{% set firstRole = roles[0] %}
|
||||
{% if firstRole.name == "SUPER ADMIN" or firstRole.name == "ADMIN" %}
|
||||
<span class="badge bg-danger">{{ firstRole.name|capitalize }}</span>
|
||||
{% else %}
|
||||
{% if firstRole.name == "SUPER ADMIN" %}
|
||||
<span class="badge bg-danger">Super Administrateur</span>
|
||||
{% elseif firstRole.name == "ADMIN" %}
|
||||
<span class="badge bg-danger">Administrateur</span>
|
||||
{% else %}
|
||||
<span class="badge bg-primary">{{ firstRole.name|capitalize }}</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
|
@ -51,8 +53,10 @@
|
|||
{% if roles|length > 1 %}
|
||||
<p><b>Autres rôles:</b>
|
||||
{% for role in roles|slice(1) %}
|
||||
{% if role.name == "SUPER ADMIN" or role.name == "ADMIN" %}
|
||||
<span class="badge bg-danger">{{ role.name|capitalize }}</span>
|
||||
{% if role.name == "SUPER ADMIN"%}
|
||||
<span class="badge bg-danger">Super Administrateur</span>
|
||||
{% elseif role.name == "ADMIN" %}
|
||||
<span class="badge bg-danger">Administrateur</span>
|
||||
{% else %}
|
||||
<span class="badge bg-primary">{{ role.name|capitalize }}</span>
|
||||
{% endif %}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
{% else %}
|
||||
{% for organization in userOrganizations %}
|
||||
{% include 'elements/userOrganizationInformation.html.twig'
|
||||
{% include 'user/organization/userOrganizationInformation.html.twig'
|
||||
with {'organization': organization.organization, 'roles': organization.roles, 'apps': organization.apps, 'uoId': organization.uoId} %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue