Projet

Général

Profil

0001-agenda-display-the-arrivals-and-departure-for-other-.patch

Serghei Mihai, 21 juillet 2014 11:32

Télécharger (2,28 ko)

Voir les différences:

Subject: [PATCH] agenda: display the arrivals and departure for other services

Closes #2532
 calebasse/agenda/appointments.py | 7 +++++--
 calebasse/agenda/views.py        | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)
calebasse/agenda/appointments.py
203 203
            continue
204 204
        start_time = interval_set.lower_bound()
205 205
        end_time = interval_set.upper_bound()
206
        services = [s.slug for s in time_table.services.all() if s != service]
206 207
        appointment = Appointment()
208
        appointment.other_services_names = services
207 209
        appointment.init_start_stop(u"Arrivée", start_time)
208 210
        activity['arrival'] = start_time
209
        appointment.weight = -1
211
        appointment.weight = 1
210 212
        appointments.append(appointment)
211 213
        appointment = Appointment()
212 214
        appointment.init_start_stop(u"Départ", end_time)
215
        appointment.other_services_names = services
213 216
        activity['departure'] = end_time
214
        appointment.weight = 1
217
        appointment.weight = -1
215 218
        appointments.append(appointment)
216 219

  
217 220
    return activity, sorted(appointments, key=lambda app: (app.begin_time, app.weight, app.event_id))
calebasse/agenda/views.py
558 558
        worker = Worker.objects.get(id=worker_id)
559 559

  
560 560
        time_tables_worker = TimeTable.objects.select_related('worker'). \
561
                filter(services=self.service, worker=worker) \
561
                filter(worker=worker) \
562 562
                .for_today(self.date) \
563 563
                .order_by('start_date') \
564 564
                .select_related()
565

  
565 566
        holidays_worker = Holiday.objects.for_worker(worker) \
566 567
                .for_period(self.date, self.date) \
567 568
                .order_by('start_date') \
568
-