Project

General

Profile

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

calebasse / calebasse / agenda / templates / agenda / act-validation.html @ 5e2377b1

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-verrouilles">Jours non verrouillé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
    <h2>Il y a {{ actes|length }} actes.</h2>
37
    <div id="actes">
38
    {% for acte, last_status, last_status_name in actes %}
39
    <div class="frame acte" id="acte-frame-{{ acte.id }}">
40
      <h3>{{ acte.time|time:"H:i" }} - <strong><span class="lastname">{{ acte.patient.last_name }}</span> {{ acte.patient.first_name }}</strong>
41
          {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %}({{ acte.patient.id }}) -
42
          <strong>{{ acte.act_type }}</strong>
43
          <p>{% if acte.doctors %}{% for doctor in acte.doctors.all %}<span class="lastname">{{ doctor.last_name }}</span> {{ doctor.first_name }} {% endfor %}{% endif %}</p>
44
          {% if acte.description %} <span title="Un commentaire existe" class="icon-comment"></span>{% endif%}
45
      </h3>
46
      <div>
47
         <span>
48
         {% if last_status %}<strong>{{ last_status_name }}</strong>, le {{ last_status.created }}.
49
         {% else %}
50
           Non pointé.
51
         {% endif %}
52
         </span>
53
         {% if not acte.validation_locked and not acte.is_billed %}
54
           <form method="post" class="inline-form">
55
           {% csrf_token %}
56
           <input type="hidden" value="{{acte.id}}" name="acte-id">
57
           <select data-previous="{{ last_status.state_name }}" name="act_state">
58
             {% for state_name, display_state_name in validation_states %}
59
             <option value="{{ state_name }}" {% if state_name == last_status.state_name %}selected{% endif %}>{{ display_state_name }}</option>
60
             {% endfor %}
61
           </select>
62
           <button {% if last_status %}disabled{% endif %}>Modifier</button>
63
           </form>
64
           <label> Facturable : </label>
65
           <input class="input_is_billable" data-id="{{acte.id}}" data-switch-billable="{{acte.switch_billable}}" type="checkbox" {% if acte.is_billable %}checked{% endif %}></input>
66
           <label> Acte perdu : </label>
67
           <input class="input_is_lost" data-id="{{acte.id}}" type="checkbox" {% if acte.is_lost %}checked{% endif %}></input>
68
         {% else %}
69
             {% if acte.is_billed %}<strong>Acte facturé</strong>
70
             {% else%}
71
                {% if acte.is_billable %}Facturable{% else %}Non facturable{% endif %}. {% if acte.is_lost %}Acte perdu.{% endif %}
72
             {% endif %}
73
         {% endif %}
74
      </div>
75
    </div>
76
    {% endfor %}
77
    </div>
78
    {% else %}
79
    <p><strong>Il n'y a pas d'acte à valider le {{ date|date:"DATE_FORMAT" }}.</strong></p>
80
    {% endif %}
81
{% endblock %}
82

    
83
{% block dialogs %}
84
<div id="validate-all-dialog" title="Validation">
85
  <div id="validate-all-dialog-content">
86
  </div>
87
  <form action="{% url 'validation-all' service=service date=date %}" method="post">
88
    {% csrf_token %}
89
    <input type="hidden" name="validate-all" value="1">
90
  </form>
91
</div>
92
{% endblock %}
93

    
94

    
95
{% block page-end %}
96
<script>
97
  $('#validate-all-dialog').dialog({
98
    autoOpen: false,
99
    modal: true,
100
    buttons: {
101
      "Valider": function () { $('#validate-all-dialog form').submit(); },
102
      "Annuler": function () { $(this).dialog("close"); },
103
    },
104
  });
105
  $('#validate-all').click(function () {
106
    $('#validate-all-dialog-content').load('{% url 'validation-all' service=service date=date %}',
107
      function () {
108
        $('#validate-all-dialog').dialog('open');
109
      }
110
    );
111
  });
112
</script>
113
{% endblock %}
(1-1/18)