Projet

Général

Profil

display_message_when_event_in_another_service.patch

Serghei Mihai, 16 juillet 2014 18:32

Télécharger (3,67 ko)

Voir les différences:


  

calebasse/agenda/appointments.py
6 6
from interval import Interval, IntervalSet
7 7

  
8 8
from calebasse.actes.validation_states import VALIDATION_STATES
9
from .models import EventWithAct
9 10

  
10 11
class Appointment(object):
11 12

  
......
36 37
        self.validation = None
37 38
        self.holiday = False
38 39
        self.services_names = []
40
        self.event = False
39 41
        self.__set_time(begin_time)
40 42

  
41 43
    def __set_time(self, time):
......
47 49

  
48 50
    def init_from_event(self, event, service, validation_states=None):
49 51
        delta = event.end_datetime - event.start_datetime
52
        self.event = isinstance(event, EventWithAct)
50 53
        self.event_id = event.id
51 54
        self.length = delta.seconds / 60
52 55
        self.title = event.title
calebasse/agenda/templates/agenda/agendas-therapeutes.html
34 34
            {% for appointment in worker_agenda.appointments %}
35 35
            <tr data-event-id="{{ appointment.event_id }}">
36 36
                <td class="col-time">{{ appointment.begin_hour }}</td>
37
                {% if not CURRENT_SERVICE_EVENTS_ONLY and not appointment.holiday and appointment.type != 'info' and appointment.other_services_names  %}
38
                <td colspan=8 class="col-record-id">
39
                  {% if appointment.event %}Evenement{% else %}Rendez-vous{% endif %}
40
                  {% with services=appointment.other_services_names|length %}
41
                  dans le{{ services|pluralize }} service{{ services|pluralize }}
42
                  {% endwith %}
43
                  {% for service in appointment.other_services_names %}
44
                  {{ service|upper }}{% if not forloop.last %}, {% endif %}
45
                  {% endfor %}
46
                </td>
47
                {% else %}
37 48
                <td class="col-duration">{% if appointment.length %}{{ appointment.length }}min{% endif %}</td>
38 49
                <td class="col-record-id">
39 50
                    {% if appointment.patient_record_id %}
......
58 69
                    {% endfor %}
59 70
                    {% endif %}
60 71
                </td>
72
                {% endif %}
61 73
            </tr>
62 74
            {% endfor %}
63 75
        </tbody>
calebasse/agenda/views.py
489 489
                        'patient__service',
490 490
                        'act_set__actvalidationstate_set',
491 491
                        'exceptions', 'participants')
492

  
493
        context['CURRENT_SERVICE_EVENTS_ONLY'] = settings.CURRENT_SERVICE_EVENTS_ONLY
494

  
492 495
        events = [ e.today_occurrence(self.date) for e in events ] \
493 496
             + [ e.today_occurrence(self.date) for e in eventswithact ]
494 497
        for e in events:
calebasse/settings.py
291 291
# Invoicing file saving directory
292 292
INVOICING_DIRECTORY = None
293 293

  
294
# display events only for current service
295
CURRENT_SERVICE_EVENTS_ONLY = True
296

  
294 297
#CSV_ENCODING = 'cp1252' #For windows : windows-1252/Winlatin1
295 298
#CSVPROFILE = {\
296 299
#    'delimiter' : ';',