-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 additions
and
65 deletions.
There are no files selected for viewing
127 changes: 62 additions & 65 deletions
127
templates/back/signalement/view/visites/visites-buttons.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,72 @@ | ||
|
||
{% if signalement.interventions is not empty %} | ||
<div class="signalement-visites-buttons fr-text--right fr-btns-group fr-btns-group--sm fr-btns-group--inline fr-btns-group--right fr-btns-group--icon-left"> | ||
{% if intervention.status is same as constant('App\\Entity\\Intervention::STATUS_PLANNED') %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
{% if workflow_can(intervention, 'cancel') %} | ||
<button class="fr-btn fr-btn--danger fr-fi-close-line" aria-controls="cancel-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Annuler la visite | ||
</button> | ||
{% endif %} | ||
<button class="fr-btn fr-btn--secondary fr-fi-edit-line" aria-controls="reschedule-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Modifier la date | ||
<div class="signalement-visites-buttons fr-text--right fr-btns-group fr-btns-group--sm fr-btns-group--inline fr-btns-group--right fr-btns-group--icon-left"> | ||
{% if intervention.status is same as constant('App\\Entity\\Intervention::STATUS_PLANNED') %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
{% if workflow_can(intervention, 'cancel') %} | ||
<button class="fr-btn fr-btn--danger fr-fi-close-line" aria-controls="cancel-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Annuler la visite | ||
</button> | ||
{% if workflow_can(intervention, 'confirm') %} | ||
<button class="fr-btn fr-fi-check-line" aria-controls="confirm-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Confirmer la visite | ||
</button> | ||
{% endif %} | ||
{% endif %} | ||
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_DONE') %} | ||
{% if signalement.interventions is empty or intervention.files is empty or intervention.getRapportDeVisite is empty %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
<button | ||
class="fr-btn fr-btn--secondary fr-fi-file-fill" | ||
aria-controls="edit-visite-modal-{{intervention.id}}" | ||
data-fr-opened="false" | ||
> | ||
Ajouter un rapport de visite | ||
</button> | ||
{% endif %} | ||
{% else %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
<button | ||
class="fr-btn fr-btn--secondary fr-fi-edit-line" | ||
aria-controls="edit-visite-modal-{{intervention.id}}" | ||
data-fr-opened="false"> | ||
Editer le rapport | ||
</button> | ||
{% endif %} | ||
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}" | ||
class="fr-btn fr-btn--secondary" | ||
title="Voir le rapport de visite" | ||
rel="noopener" | ||
target="_blank"> | ||
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite | ||
</a> | ||
<button class="fr-btn fr-btn--secondary fr-fi-edit-line" aria-controls="reschedule-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Modifier la date | ||
</button> | ||
{% if workflow_can(intervention, 'confirm') %} | ||
<button class="fr-btn fr-fi-check-line" aria-controls="confirm-visite-modal-{{intervention.id}}" data-fr-opened="false"> | ||
Confirmer la visite | ||
</button> | ||
{% endif %} | ||
{% endif %} | ||
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_DONE') %} | ||
{% if signalement.interventions is empty or intervention.files is empty or intervention.getRapportDeVisite is empty %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
<button | ||
class="fr-btn fr-btn--secondary fr-icon-camera-fill open-modal-upload-files-btn" | ||
class="fr-btn fr-btn--secondary fr-fi-file-fill" | ||
aria-controls="edit-visite-modal-{{intervention.id}}" | ||
data-fr-opened="false" | ||
aria-controls="visites-upload-files-{{intervention.id}}" | ||
data-file-type="photo" | ||
data-document-type="PHOTO_VISITE" | ||
data-accepted-type-mimes={{ get_accepted_mime_type('photo')}} | ||
data-accepted-extensions="{{ get_accepted_extensions('photo')}}" | ||
data-intervention-id="{{intervention.id}}"> | ||
Ajouter les photos de la visite | ||
> | ||
Ajouter un rapport de visite | ||
</button> | ||
{% endif %} | ||
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_NOT_DONE') %} | ||
{% if intervention.getRapportDeVisite is not empty %} | ||
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}" | ||
class="fr-btn fr-btn--secondary" | ||
title="Voir le rapport de visite" | ||
rel="noopener" | ||
target="_blank"> | ||
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite | ||
</a> | ||
{% endif %} | ||
{% else %} | ||
| ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
<button | ||
class="fr-btn fr-btn--secondary fr-fi-edit-line" | ||
aria-controls="edit-visite-modal-{{intervention.id}}" | ||
data-fr-opened="false"> | ||
Editer le rapport | ||
</button> | ||
{% endif %} | ||
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}" | ||
class="fr-btn fr-btn--secondary" | ||
title="Voir le rapport de visite" | ||
rel="noopener" | ||
target="_blank"> | ||
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite | ||
</a> | ||
{% endif %} | ||
{% if is_granted('SIGN_EDIT_VISITE', intervention) %} | ||
<button | ||
class="fr-btn fr-btn--secondary fr-icon-camera-fill open-modal-upload-files-btn" | ||
data-fr-opened="false" | ||
aria-controls="visites-upload-files-{{intervention.id}}" | ||
data-file-type="photo" | ||
data-document-type="PHOTO_VISITE" | ||
data-accepted-type-mimes={{ get_accepted_mime_type('photo')}} | ||
data-accepted-extensions="{{ get_accepted_extensions('photo')}}" | ||
data-intervention-id="{{intervention.id}}"> | ||
Ajouter les photos de la visite | ||
</button> | ||
{% endif %} | ||
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_NOT_DONE') %} | ||
{% if intervention.getRapportDeVisite is not empty %} | ||
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}" | ||
class="fr-btn fr-btn--secondary" | ||
title="Voir le rapport de visite" | ||
rel="noopener" | ||
target="_blank"> | ||
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite | ||
</a> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
{% else %} | ||
| ||
{% endif %} | ||
</div> |