57 lines
2.5 KiB
Twig
57 lines
2.5 KiB
Twig
{% extends '@Core/admin/crud/edit.html.twig' %}
|
|
|
|
{% block header_actions_after %}
|
|
{% if entity.totalAmount > 0 %}
|
|
{% if not entity.isPaid %}
|
|
{% if not entity.isRequestedPayment and (entity.user.id == app.user.id or is_granted('ROLE_TREASURER')) %}
|
|
<span class="btn btn-success" data-toggle="modal" data-target="#notification">
|
|
Demander le paiement
|
|
</span>
|
|
{% endif %}
|
|
|
|
{% if entity.isRequestedPayment and is_granted('ROLE_TREASURER') %}
|
|
<span class="btn btn-success" data-toggle="modal" data-target="#notification">
|
|
Définir comme payée
|
|
</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{{ parent() }}
|
|
|
|
{% set mailFormRoute = configuration.viewData(context, 'mailFormRoute') %}
|
|
{% set mailFormTokenName = configuration.viewData(context, 'mailFormTokenName') %}
|
|
{% set mailForm = configuration.viewData(context, 'mailForm') %}
|
|
|
|
{% if mailFormRoute %}
|
|
<form action="{{ path(mailFormRoute, {entity: entity.id, token: csrf_token(mailFormTokenName)}) }}" method="POST">
|
|
<div class="modal modal-static" tabindex="-1" id="notification">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Notification</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="alert alert-warning">
|
|
Attention, si vous avez modifié la note de frais sans avoir enregistré,
|
|
les données ne seront pas conservées.
|
|
</div>
|
|
|
|
{{ form(mailForm) }}
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ 'Close'|trans }}</button>
|
|
<button type="submit" class="btn btn-primary">{{ 'Submit'|trans }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
{% endblock %}
|