templates/backend/contact/show.html.twig line 1

Open in your IDE?
  1. {% extends 'backend/base.html.twig' %}
  2. {% block title %}Contact {{ contact.fullname }}{% endblock %}
  3. {% block content %}
  4.     {% include 'backend/partials/_breadcrumb.html.twig' with {
  5.         datas: [
  6.             {
  7.                 label: 'Contacts',
  8.                 url: path('advanced_search', {entity: 'contact'})
  9.             }, {
  10.                 label: 'Entreprise ' ~ (contact.firm ? contact.firm.raisonSocial ~ ' <i>(#' ~ contact.firm.id ~ ')</i>' : 'inconnue'),
  11.                 url: (contact.firm ? path('show_entreprise', {id: contact.firm.id}) : null)
  12.             }, {
  13.                 label: (contact.prenom is not null or contact.nom is not null ? contact.fullname : 'inconnu') ~ ' <i>(#' ~ contact.id ~ ')</i>'
  14.             }
  15.         ],
  16.         buttons: [
  17.             {
  18.                 display: is_granted('ROLE_UPDATE_ENTITY') ? true : false,
  19.                 url: path('edit_contact', {'id': contact.id}),
  20.                 class: 'btn btn-sm btn-primary',
  21.                 icon: 'fas fa-edit',
  22.                 label: 'Modifier'
  23.             }
  24.         ]
  25.     } %}
  26.     <div class="row justify-content-center">
  27.         {% if contact.firm is not null %}
  28.             <div class="col-12 col-lg-6">
  29.                 <div class="card h-100">
  30.                     <div class="card-header card-header-dark">
  31.                         <div class="pb-2">Entreprise</div>
  32.                     </div>
  33.                     <div class="card-body">
  34.                         <div class="row mb-3">
  35.                             <div class="col-3 text-bold">Raison social</div>
  36.                             <div class="col-9">{{ contact.firm.raisonSocial }}</div>
  37.                         </div>
  38.                         <div class="row mb-3">
  39.                             <div class="col-3 text-bold">Syndicat de rattachement</div>
  40.                             <div class="col-9">{{ contact.firm.syndicat ? contact.firm.syndicat.nom }}</div>
  41.                         </div>
  42.                         <div class="row mb-3">
  43.                             <div class="col-3 text-bold">Région de rattachement</div>
  44.                             <div class="col-9">{{ contact.firm.homeRegion ? contact.firm.homeRegion.nom }}</div>
  45.                         </div>
  46.                         <div class="row mb-3">
  47.                             <div class="col-3 text-bold">Département</div>
  48.                             <div class="col-9">{{ contact.firm.departement ? contact.firm.departement.nom }}</div>
  49.                         </div>
  50.                     </div>
  51.                 </div>
  52.             </div>
  53.         {% endif %}
  54.         <div class="col-12 col-lg-{{ contact.firm is null ? '12' : '6' }}">
  55.             <div class="card h-100">
  56.                 <div class="card-header card-header-dark">
  57.                     Information générale
  58.                     {{ bagdeStatus(contact.status, false, 'float-end mx-2') }}
  59.                 </div>
  60.                 <div class="card-body">
  61.                     <div class="row mb-3">
  62.                         <div class="col-3 text-bold">Responsable</div>
  63.                         <div class="col-9">{{ contact.isResponsible ? '<span class="text-success">Oui</span>'|raw : 'Non' }}</div>
  64.                     </div>
  65.                     <div class="row mb-3">
  66.                         <div class="col-3 text-bold">Etablissement</div>
  67.                         <div class="col-9">{{ contact.etablissement ? contact.etablissement.nom }}</div>
  68.                     </div>
  69.                     <div class="row mb-3">
  70.                         <div class="col-3 text-bold">Civilité</div>
  71.                         <div class="col-9">{{ contact.civilite is not empty ? contact.civilite : '' }}</div>
  72.                     </div>
  73.                     <div class="row mb-3">
  74.                         <div class="col-3 text-bold">Nom</div>
  75.                         <div class="col-9">{{ contact.nom is not empty ? contact.nom : '' }}</div>
  76.                     </div>
  77.                     <div class="row mb-3">
  78.                         <div class="col-3 text-bold">Prénom</div>
  79.                         <div class="col-9">{{ contact.prenom is not empty ? contact.prenom : '' }}</div>
  80.                     </div>
  81.                     <div class="row mb-3">
  82.                         <div class="col-3 text-bold">Tél. bureau</div>
  83.                         <div class="col-9">{{ contact.telBureau is not empty ? contact.telBureau : '' }}</div>
  84.                     </div>
  85.                     <div class="row mb-3">
  86.                         <div class="col-3 text-bold">Tél. portable</div>
  87.                         <div class="col-9">{{ contact.telPortable is not empty ? contact.telPortable : '' }}</div>
  88.                     </div>
  89.                     <div class="row mb-3">
  90.                         <div class="col-3 text-bold">Tél. portable 2</div>
  91.                         <div class="col-9">{{ contact.telPortable2 is not empty ? contact.telPortable2 : '' }}</div>
  92.                     </div>
  93.                     <div class="row mb-3">
  94.                         <div class="col-3 text-bold">Email</div>
  95.                         <div class="col-9">{{ contact.emailContact is not empty ? contact.emailContact : '' }}</div>
  96.                     </div>
  97.                     <div class="row mb-3">
  98.                         <div class="col-3 text-bold">Date de naissance</div>
  99.                         <div class="col-9">{{ contact.dateNaissance is not empty ? contact.dateNaissance : '' }}</div>
  100.                     </div>
  101.                 </div>
  102.             </div>
  103.         </div>
  104.     </div>
  105.     <div class="card mt-4">
  106.         <div class="card-header card-header-dark">
  107.             Relation(s)
  108.         </div>
  109.         <div class="card-body">
  110.             <h4>Commissions(s)</h4>
  111.             <div class="table-responsive mb-4">
  112.                 <table class="table">
  113.                     <thead>
  114.                         <th class="text-bold">Nom commission</th>
  115.                         <th>Rôle</th>
  116.                     </thead>
  117.                     <tbody>
  118.                         {% if contact.commissionsContacts|length == 0 %}
  119.                             <tr>
  120.                                 <td colspan="5" class="text-sm text-center"><i>Aucune relation</i></td>
  121.                             </tr>
  122.                         {% else %}
  123.                             {% for commissionsContact in contact.commissionsContacts %}
  124.                                 <tr>
  125.                                     <td>{{ commissionsContact.commission ? commissionsContact.commission.nom|upper }}</td>
  126.                                     <td>
  127.                                         {% if commissionsContact.commissionRoles %}
  128.                                             {% for role in commissionsContact.commissionRoles %}
  129.                                                 <div>{{ role.nom|capitalize }}</div>
  130.                                             {% endfor %}
  131.                                         {% endif %}
  132.                                     </td>
  133.                                 </tr>
  134.                             {% endfor %}
  135.                         {% endif %}
  136.                     </tbody>
  137.                 </table>
  138.             </div>
  139.             <h4>Conseil d'administration</h4>
  140.             <div class="table-responsive mb-4">
  141.                 <table class="table">
  142.                     <thead>
  143.                         <tr>
  144.                             <th class="text-bold">Rôle dans le Conseil d'administration</th>
  145.                         </tr>
  146.                     </thead>
  147.                     <tbody>
  148.                     {% if contact.contactConseilAdministrations|length == 0 %}
  149.                         <tr>
  150.                             <td colspan="4" class="text-sm text-center"><i>Aucune relation</i></td>
  151.                         </tr>
  152.                     {% else %}
  153.                         {% for contactConseilAdministration in contact.contactConseilAdministrations %}
  154.                             <tr>
  155.                                 <td>{{ contactConseilAdministration.conseilAdministration ? contactConseilAdministration.conseilAdministration.role }}</td>
  156.                             </tr>
  157.                         {% endfor %}
  158.                     {% endif %}
  159.                     </tbody>
  160.                 </table>
  161.             </div>
  162.         </div>
  163.     </div>
  164.     <div class="card mt-4">
  165.         <div class="card-header card-header-dark">
  166.             Repère(s)
  167.         </div>
  168.         <div class="card-body">
  169.             <div>
  170.                 {% for repere in contact.repere %}
  171.                     <span class="badge bg-primary p-2 mx-1">#{{ repere.nom|upper }}</span>
  172.                 {% endfor %}
  173.             </div>
  174.         </div>
  175.     </div>
  176.     <div class="card mt-4">
  177.         <div class="card-header card-header-dark">
  178.             Utilisateur extranet
  179.         </div>
  180.         <div class="card-body">
  181.             <div class="row mb-3">
  182.                 <div class="col-3 text-bold">Utilisateur existant ?</div>
  183.                 <div class="col-9">{{ userExists ? ('<span class="text-bold text-success">Oui (#' ~ userExists.id ~ ')</span>')|raw : 'Non' }}</div>
  184.             </div>
  185.             {% if userExists %}
  186.                 <a href="{{ path('user_member_reset_password', {id: userExists.id}) }}" class="btn btn-sm btn-warning">
  187.                     <i class="fas fa-arrows-rotate"></i> Réinitialiser le mot de passe
  188.                 </a>
  189.             {% endif %}
  190.             {% if userExists is null and is_granted('ROLE_ADMIN') %}
  191.                 <a href="{{ path('user_member_add_from_contact', {id: contact.id}) }}" class="btn btn-sm btn-success">
  192.                     <i class="fas fa-plus"></i> Créer un utilisateur
  193.                 </a>
  194.             {% endif %}
  195.         </div>
  196.     </div>
  197. {% endblock %}