Projet

Général

Profil

« Précédent | Suivant » 

Révision f20148c6

Ajouté par Mikaël Ates il y a presque 10 ans

agenda : Add warning message and prevent hazardous modifications.

Add message on the periodic event dialog to warn when acts are already billed.
Prevent periodic event field edition when an act is already billed excepted the fields
start and end date, description and ressource.
Patient can not be modified on periodic event and its occurence.

Voir les différences:

calebasse/agenda/templates/agenda/appointment.html
3 3
{{ form.non_field_errors }}
4 4
{{ form.start_datetime }}
5 5
{{ form.start_datetime.errors }}
6
   {% if object.is_recurring and object.one_act_is_billed %}<p><em>Le rendez-vous périodique a un acte qui est facturé ce qui empêche de le modifier à l'exception de la description, de la ressource et des dates de début et de fin.</em></p>{% endif %}
7
   {% if object.is_recurring and object.one_act_already_billed %}<p><em>Le rendez-vous périodique a un acte qui a déjà été facturé ce qui empêche de le supprimer.</em></p>{% endif %}
6 8
   <table id="new-appointment-table">
7 9
       <tr>
8 10
           <td {% if form.time.field.required %}class="required"{% endif %}>
9 11
            <p>
10 12
           {{ form.time.label_tag }}
13
           {% if object.is_recurring and object.one_act_is_billed %}
14
           {{ object.time }}
15
           {{ form.time.as_hidden }}
16
           {% else %}
11 17
           {{ form.time }}
18
           {% endif %}
12 19
           {{ form.time.errors }}
13 20
           </p>
14 21
           </td>
15 22
           <td {% if form.duration.field.required %}class="required"{% endif %}>
16 23
           <p>
17 24
           {{ form.duration.label_tag }}
18
           {{ form.duration|add_class:"mousewheel"|attr:"data-mousewheel-increment:5" }}
25
           {% if object.is_recurring and object.one_act_is_billed %}
26
           {{ object.duration }}
27
           {{ form.duration.as_hidden }}
28
           {% else %}
29
           {{ form.duration }}
30
           {% endif %}
19 31
           {{ form.duration.errors }}
20
           <div>
21
           {{ form.duration.help_text }}
22
           </div>
23 32
           </p>
24 33
           </td>
25 34
           <td {% if form.date.field.required %}class="required"{% endif %}>
......
43 52
           <td {% if form.participants.field.required %}class="required"{% endif %}>
44 53
           <h4>{{ form.participants.label_tag }}</h4>
45 54
           <div id="intervenants">
55
           {% if object.is_recurring and object.one_act_is_billed %}
56
           <ul>{% for p in object.participants.all %}<li>{{ p }}</li>{% endfor %}</ul>
57
           <input id="id_participants" name="participants" value="|{% for p in object.participants.all %}{{ p.id }}|{% endfor %}" type="hidden"/>
58
           {% else %}
46 59
           {{ form.participants }}
60
           {% endif %}
47 61
           {{ form.participants.errors }}
48 62
           </div>
49 63
           </td>
50 64
           <td {% if form.patient.field.required %}class="required"{% endif %}>
51 65
           <h4>{{ form.patient.label_tag }}</h4>
52 66
           <div id="patient">
53
           {% if object.exception_to and not object.exception_to.canceled %}
67
           {% if object.is_recurring or object.exception_to or object.act.already_billed %}
54 68
           {{ object.patient }}
69
           {{ form.patient.as_hidden }}
55 70
           {% else %}
56 71
           {{ form.patient }}
57 72
           {{ form.patient.errors }}
......
60 75
           </td>
61 76
           <td {% if form.act_type.field.required %}class="required"{% endif %}>
62 77
           <h4>{{ form.act_type.label_tag }}</h4>
78
           {% if object.is_recurring and object.one_act_is_billed %}
79
           {{ object.act_type }}
80
           {{ form.act_type.as_hidden }}
81
           {% else %}
63 82
           {{ form.act_type }}
83
           {% endif %}
64 84
           {{ form.act_type.errors }}
65 85
           </td>
66 86
       </tr>
......
79 99
  <hr/>
80 100
  {% if object.id != object.exception_to.id %}
81 101
  <p><em>Attention: cet objet est une exception à un rendez-vous périodique; si
82
  vous modifiez ou supprimiez ce rendez-vous périodique, l'exception n'en serait pas
102
  vous modifiez ou supprimez le rendez-vous périodique, l'exception n'en sera pas
83 103
  affectée.</em></p>
84 104
  {% endif %}
85
  <div>Occurence du {{object.exception_date}} d'un rendez-vous périodique
86
    {% if object.exception_to.canceled %}<em>supprimée</em> et initialement prévue{% endif %}
87
    {{ object.exception_to.recurrence_description|lower }}</div>
105

  
106
  <p>Occurence du {{object.exception_date}} d'un rendez-vous périodique
107
    {% if object.exception_to.canceled %}<em>supprimé</em> et initialement prévu{% endif %}
108
    {{ object.exception_to.recurrence_description|lower }}</p>
109

  
88 110
  {% if not object.exception_to.canceled %}
89
  <button type="button" data-delete-url="{% url 'delete-event' service=service date=date pk=object.exception_to.pk %}" data-id="{{ object.exception_to.id }}" class="update-periodic-rdv">Éditer le rendez-vous périodique</button>
111
  <p><button type="button" data-delete-url="{% url 'delete-event' service=service date=date pk=object.exception_to.pk %}" data-id="{{ object.exception_to.id }}" data-one_act_already_billed="{{ object.exception_to.one_act_already_billed }}"  class="update-periodic-rdv">Éditer le rendez-vous périodique</button></p>
90 112
  {% endif %}
113

  
91 114
{% endif %}

Formats disponibles : Unified diff