Project

General

Profile

Download (3.79 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / agenda / templates / agenda / act-validation.html @ fcfb4f5b

1
{% extends "agenda/base.html" %}
2
{% load url from future %}
3

    
4
{% block body-class %}{{ block.super }} no-left-column{% endblock %}
5

    
6
{% block appbar %}
7
<h2>Validation des actes - {{ date|date:"DATE_FORMAT" }}</h2>
8
    <a href="..">Retourner à l'agenda</a>
9
    {% if authorized_lock %}
10
        <form method="post">
11
          {% csrf_token %}
12
          <input type="hidden" name="unlock-all" value="1">
13
          <button id="unlock-all">Déverrouiller</button>
14
        </form>
15
        <button id="validate-all">Validation automatique</button>
16
    {% endif %}
17
{% endblock %}
18

    
19
{% block beforecontent %}
20
    <div id="extra-top-links">
21
     <a href="../jours-non-verouilles">Jours non vérouillés</a>
22
    </div>
23
{% endblock %}
24

    
25
{% block agenda-content %}
26
    {% if validation_msg %}
27
    <ul>
28
    {% for message in validation_msg %}
29
     <li>{{ message.what }} ({{ message.when }})</li>
30
    {% endfor %}
31
    </ul>
32
    {% endif %}
33

    
34

    
35
    {% if actes %}
36
    <div id="actes">
37
    {% for acte, last_status, last_status_name in actes %}
38
    <div class="frame acte" id="acte-frame-{{ acte.id }}">
39
      <h3>{{ acte.date }} - <strong><span class="lastname">{{ acte.patient.last_name }}</span> {{ acte.patient.first_name }}</strong>
40
          {% if acte.patient.paper_id %} ({{ acte.patient.paper_id }}){% endif %}
41
          {% if acte.doctors %}{% for doctor in acte.doctors.all %} - <span class="lastname">{{ doctor.last_name }}</span> {{ doctor.first_name }}{% endfor %}{% endif %} -
42
          <strong>{{ acte.act_type }}</strong>
43
          {% if acte.description %} <img title="Un commentaire existe" src="{{ STATIC_URL }}images/emblem-documents.png">{% endif%}
44
      </h3>
45
      <div><span>{% if last_status %}<strong>{{ last_status_name }}</strong>, le {{ last_status.created }} par {{ last_status.author }}
46
           {% if last_status.auto %}(par validation automatique){% endif %}. {% if acte.is_billed %}<strong>Acte facturé</strong>{% endif %}
47
         {% else %}
48
           Non pointé.
49
         {% endif %}
50
         </span>
51
         {% if not acte.validation_locked %}
52
           <form method="post" class="inline-form">
53
           {% csrf_token %}
54
           <input type="hidden" value="{{acte.id}}" name="acte-id">
55
           <select data-previous="{{ last_status.state_name }}" name="act_state">
56
             {% for state_name, display_state_name in validation_states.items %}
57
             <option value="{{ state_name }}" {% if state_name == last_status.state_name %}selected{% endif %}>{{ display_state_name }}</option>
58
             {% endfor %}
59
           </select>
60
           <button {% if last_status %}disabled{% endif %}>Modifier</button>
61
           </form>
62
         {% endif %}
63
      </div>
64
    </div>
65
    {% endfor %}
66
    </div>
67
    {% else %}
68
    <p><strong>Il n'y a pas d'acte à valider le {{ date|date:"DATE_FORMAT" }}.</strong></p>
69
    {% endif %}
70
{% endblock %}
71

    
72
{% block dialogs %}
73
<div id="validate-all-dialog" title="Validation">
74
  <div id="validate-all-dialog-content">
75
  </div>
76
  <form action="{% url 'validation-all' service=service date=date %}" method="post">
77
    {% csrf_token %}
78
    <input type="hidden" name="validate-all" value="1">
79
  </form>
80
</div>
81
{% endblock %}
82

    
83

    
84
{% block page-end %}
85
<script>
86
  $('select[name^="act_state"]').on('change', function () {
87
    $(this).next('button').prop('disabled',
88
      ($(this).data('previous') == $(this).val()));
89
  })
90
  $('#validate-all-dialog').dialog({
91
    autoOpen: false,
92
    modal: true,
93
    buttons: {
94
      "Valider": function () { $('#validate-all-dialog form').submit(); },
95
      "Annuler": function () { $(this).dialog("close"); },
96
    },
97
  });
98
  $('#validate-all').click(function () {
99
    $('#validate-all-dialog-content').load('{% url 'validation-all' service=service date=date %}',
100
      function () {
101
        $('#validate-all-dialog').dialog('open');
102
      }
103
    );
104
  });
105
</script>
106
{% endblock %}
(1-1/13)