{% extends 'backend/base.html.twig' %}
{% block title %}Contact {{ contact.fullname }}{% endblock %}
{% block content %}
{% include 'backend/partials/_breadcrumb.html.twig' with {
datas: [
{
label: 'Contacts',
url: path('advanced_search', {entity: 'contact'})
}, {
label: 'Entreprise ' ~ (contact.firm ? contact.firm.raisonSocial ~ ' <i>(#' ~ contact.firm.id ~ ')</i>' : 'inconnue'),
url: (contact.firm ? path('show_entreprise', {id: contact.firm.id}) : null)
}, {
label: (contact.prenom is not null or contact.nom is not null ? contact.fullname : 'inconnu') ~ ' <i>(#' ~ contact.id ~ ')</i>'
}
],
buttons: [
{
display: is_granted('ROLE_UPDATE_ENTITY') ? true : false,
url: path('edit_contact', {'id': contact.id}),
class: 'btn btn-sm btn-primary',
icon: 'fas fa-edit',
label: 'Modifier'
}
]
} %}
<div class="row justify-content-center">
{% if contact.firm is not null %}
<div class="col-12 col-lg-6">
<div class="card h-100">
<div class="card-header card-header-dark">
<div class="pb-2">Entreprise</div>
</div>
<div class="card-body">
<div class="row mb-3">
<div class="col-3 text-bold">Raison social</div>
<div class="col-9">{{ contact.firm.raisonSocial }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Syndicat de rattachement</div>
<div class="col-9">{{ contact.firm.syndicat ? contact.firm.syndicat.nom }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Région de rattachement</div>
<div class="col-9">{{ contact.firm.homeRegion ? contact.firm.homeRegion.nom }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Département</div>
<div class="col-9">{{ contact.firm.departement ? contact.firm.departement.nom }}</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-12 col-lg-{{ contact.firm is null ? '12' : '6' }}">
<div class="card h-100">
<div class="card-header card-header-dark">
Information générale
{{ bagdeStatus(contact.status, false, 'float-end mx-2') }}
</div>
<div class="card-body">
<div class="row mb-3">
<div class="col-3 text-bold">Responsable</div>
<div class="col-9">{{ contact.isResponsible ? '<span class="text-success">Oui</span>'|raw : 'Non' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Etablissement</div>
<div class="col-9">{{ contact.etablissement ? contact.etablissement.nom }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Civilité</div>
<div class="col-9">{{ contact.civilite is not empty ? contact.civilite : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Nom</div>
<div class="col-9">{{ contact.nom is not empty ? contact.nom : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Prénom</div>
<div class="col-9">{{ contact.prenom is not empty ? contact.prenom : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Tél. bureau</div>
<div class="col-9">{{ contact.telBureau is not empty ? contact.telBureau : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Tél. portable</div>
<div class="col-9">{{ contact.telPortable is not empty ? contact.telPortable : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Tél. portable 2</div>
<div class="col-9">{{ contact.telPortable2 is not empty ? contact.telPortable2 : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Email</div>
<div class="col-9">{{ contact.emailContact is not empty ? contact.emailContact : '' }}</div>
</div>
<div class="row mb-3">
<div class="col-3 text-bold">Date de naissance</div>
<div class="col-9">{{ contact.dateNaissance is not empty ? contact.dateNaissance : '' }}</div>
</div>
</div>
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header card-header-dark">
Relation(s)
</div>
<div class="card-body">
<h4>Commissions(s)</h4>
<div class="table-responsive mb-4">
<table class="table">
<thead>
<th class="text-bold">Nom commission</th>
<th>Rôle</th>
</thead>
<tbody>
{% if contact.commissionsContacts|length == 0 %}
<tr>
<td colspan="5" class="text-sm text-center"><i>Aucune relation</i></td>
</tr>
{% else %}
{% for commissionsContact in contact.commissionsContacts %}
<tr>
<td>{{ commissionsContact.commission ? commissionsContact.commission.nom|upper }}</td>
<td>
{% if commissionsContact.commissionRoles %}
{% for role in commissionsContact.commissionRoles %}
<div>{{ role.nom|capitalize }}</div>
{% endfor %}
{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
<h4>Conseil d'administration</h4>
<div class="table-responsive mb-4">
<table class="table">
<thead>
<tr>
<th class="text-bold">Rôle dans le Conseil d'administration</th>
</tr>
</thead>
<tbody>
{% if contact.contactConseilAdministrations|length == 0 %}
<tr>
<td colspan="4" class="text-sm text-center"><i>Aucune relation</i></td>
</tr>
{% else %}
{% for contactConseilAdministration in contact.contactConseilAdministrations %}
<tr>
<td>{{ contactConseilAdministration.conseilAdministration ? contactConseilAdministration.conseilAdministration.role }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header card-header-dark">
Repère(s)
</div>
<div class="card-body">
<div>
{% for repere in contact.repere %}
<span class="badge bg-primary p-2 mx-1">#{{ repere.nom|upper }}</span>
{% endfor %}
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header card-header-dark">
Utilisateur extranet
</div>
<div class="card-body">
<div class="row mb-3">
<div class="col-3 text-bold">Utilisateur existant ?</div>
<div class="col-9">{{ userExists ? ('<span class="text-bold text-success">Oui (#' ~ userExists.id ~ ')</span>')|raw : 'Non' }}</div>
</div>
{% if userExists %}
<a href="{{ path('user_member_reset_password', {id: userExists.id}) }}" class="btn btn-sm btn-warning">
<i class="fas fa-arrows-rotate"></i> Réinitialiser le mot de passe
</a>
{% endif %}
{% if userExists is null and is_granted('ROLE_ADMIN') %}
<a href="{{ path('user_member_add_from_contact', {id: contact.id}) }}" class="btn btn-sm btn-success">
<i class="fas fa-plus"></i> Créer un utilisateur
</a>
{% endif %}
</div>
</div>
{% endblock %}