Project

General

Profile

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

calebasse / calebasse / agenda / templates / agenda / agendas-therapeutes.html @ cd48ac2c

1
{% extends "agenda/base.html" %}
2

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

    
5
{% block appbar %}
6
<h2>Tous les agendas des intervenants du {{ service_name }} - {{ date|date:"DATE_FORMAT"|title }}</h2>
7
<a href="..">Retourner à l'agenda</a>
8
{% endblock %}
9

    
10

    
11
{% block agenda-content %}
12
<div id="activity" class="screen-only">
13
  <span class="actions screen-only"><button id='print-button-therapeutes-activity' class="icon-print screen-only">Imprimer</button></span>
14
  <br class="clear" />
15
  <span class="header"><strong>{{ service_name }}:</strong> {{ date|date:"DATE_FORMAT"|title }}</span>
16
  <h3>Liste des présences</h4>
17
<table>
18
  <thead>
19
    <tr>
20
      <th>Nom</th><th>Arrivée</th><th>Premier rendez-vous</th>
21
      <th>Dernier rendez-vous</th><th>Départ</th><th>Absences</th>
22
    </tr>
23
  </thead>
24
  <tbody>
25
{% for worker_agenda in workers_agenda %}
26
<tr>
27
  <td>{{ worker_agenda.worker.first_name}} <span class="lastname">{{ worker_agenda.worker.last_name }}</span></td>
28
  <td>{{ worker_agenda.activity.arrival }}</td><td>{{ worker_agenda.activity.first_appointment }}</td>
29
  <td>{{ worker_agenda.activity.last_appointment }}</td><td>{{ worker_agenda.activity.departure }}</td>
30
  <td>{% for absence in worker_agenda.activity.absences %}
31
    {{ absence }}<br />
32
    {% endfor %}
33
  </td>
34
</tr>
35
{% endfor %}
36
  </tbody>
37
</table>
38
</div>
39
<br class="clear" />
40
<span class="actions screen-only">
41
  <button id="uncheck-all" type="button" class="icon-uncheck screen-only">Tout décocher</button>
42
  <button id="check-all" type="button" style="display: none" class="icon-check screen-only">Tout cocher</button>
43
  <button id='print-button-therapeutes' class="icon-print screen-only">Imprimer</button>
44
</span>
45
{% for worker_agenda in workers_agenda %}
46
{% if worker_agenda.appointments %}
47
<div class="worker-agenda">
48
    <h2>
49
        <strong>{{ service_name }}</strong> - Planning de {{ worker_agenda.worker.first_name }} <span class="lastname">{{ worker_agenda.worker.last_name }}</span>
50
        <input type="checkbox" class="printable" {% if worker_agenda.has_events %}checked{% endif %}>
51
    </h2>
52
    <h3>{{ date|date:"DATE_FORMAT"|title }}</h3>
53

    
54
    <!--<span class="remarque">Remarque :</span>-->
55

    
56
    <table>
57
        <thead>
58
            <tr> <th>Heure</th> <th>Durée</th> <th></th> <th>Libellé</th><th>Présence</th>
59
                <th>Absence</th>
60
                <th>Type d'acte</th> <th>Commentaire</th> <th>Intervenants</th></tr>
61
        </thead>
62
        <tbody>
63
            {% for appointment in worker_agenda.appointments %}
64
            <tr data-event-id="{{ appointment.event_id }}">
65
                <td class="col-time">{{ appointment.begin_hour }}</td>
66
                {% if not CURRENT_SERVICE_EVENTS_ONLY and not appointment.holiday and appointment.type != 'info' and appointment.other_services_names  %}
67
                <td colspan=8 class="col-record-id">
68
                  {% if appointment.event %}Evenement{% else %}Rendez-vous{% endif %}
69
                  {% with services=appointment.other_services_names|length %}
70
                  dans le{{ services|pluralize }} service{{ services|pluralize }}
71
                  {% endwith %}
72
                  {% for service in appointment.other_services_names %}
73
                  {{ service|upper }}{% if not forloop.last %}, {% endif %}
74
                  {% endfor %}
75
                </td>
76
                {% else %}
77
                <td class="col-duration">{% if appointment.length %}{{ appointment.length }}min{% endif %}</td>
78
                <td class="col-record-id">
79
                    {% if appointment.patient_record_id %}
80
                    {% if appointment.patient_record_paper_id %}
81
                    {{ appointment.patient_record_paper_id }}
82
                    {% else %}
83
                    Pas de numéro papier.
84
                    {% endif %}
85
                    {% endif %}
86
                </td>
87
                <td> {% if appointment.title %}{{ appointment.title }}{% endif %}</td>
88
                <td/>
89
                <td> {% if appointment.act_absence %}<strong>{{ appointment.act_absence }}</strong>{% endif %}</td>
90
                <td> {% if appointment.act_type %}{{ appointment.act_type }}{% endif %}</td>
91
                <td> {% if appointment.description %}{{ appointment.description }}{% endif %}</td>
92
                <td>
93
                    {% if appointment.workers and appointment.workers|length > 10 %}
94
                    {{ appointment.workers|length }} intervenants
95
                    {% else %}
96
                    {% for worker in appointment.workers %}
97
                    <span class="lastname">{{ worker.last_name }}</span> {{ worker.first_name }}<br/>
98
                    {% endfor %}
99
                    {% endif %}
100
                </td>
101
                {% endif %}
102
            </tr>
103
            {% endfor %}
104
        </tbody>
105
    </table>
106
</div> <!-- .worker-agenda -->
107

    
108
{% endif %}
109
{% endfor %}
110
    <script>
111
        $(function () {
112
            /* Control page break on last printed page */
113
            function update_page_break() {
114
                $('.pagebreak').css('page-break-after', 'always');
115
                $('.pagebreak').not('.screen-only').last().css('page-break-before', 'avoid');
116
            }
117
            update_page_break();
118

    
119
            $('button#print-button-therapeutes').click(function() {
120
              $('div#activity').addClass('screen-only');
121
              $.each($(".printable"), function(k, v) {
122
                if ($(v).is(':checked')) {
123
                    $(v).parents('.worker-agenda').removeClass('screen-only');
124
                } else {
125
                    $(v).parents('.worker-agenda').addClass('screen-only');
126
                }
127
                });
128
              update_page_break();
129
              window.print();
130
              });
131

    
132
            $('button#print-button-therapeutes-activity').click(function() {
133
                $('div#activity').removeClass('screen-only');
134
                $.each($('.content div:not(#activity)'), function(k, v) {
135
                  $(v).addClass('screen-only');
136
                });
137
              update_page_break();
138
              window.print();
139
              });
140

    
141
            $('#uncheck-all').on('click', function () {
142
                $('.printable').attr('checked', false);
143
                $('.printable').trigger('change');
144
                $('#uncheck-all').hide();
145
                $('#check-all').show();
146
                update_page_break();
147
            });
148
            $('#check-all').on('click', function () {
149
                $('.printable').attr('checked', true);
150
                $('.printable').trigger('change');
151
                $('#check-all').hide();
152
                $('#uncheck-all').show();
153
                update_page_break();
154
            });
155
        });
156
    </script>
157

    
158
<button id='print-button' class='screen-only'>Imprimer</button>
159
{% endblock %}
(2-2/18)