Projet

Général

Profil

« Précédent | Suivant » 

Révision 9aa3425b

Ajouté par Serghei Mihai (congés, retour 15/05) il y a plus de 9 ans

agenda: arrivals and departures design improvings

Closes #5466

Voir les différences:

calebasse/agenda/appointments.py
38 38
        self.holiday = False
39 39
        self.services_names = []
40 40
        self.event = False
41
        self.timetable_type = None
41 42
        self.__set_time(begin_time)
42 43

  
43 44
    def __set_time(self, time):
......
125 126
        self.init_busy_time(title, length, begin_time, description)
126 127
        self.holiday = True
127 128

  
128
    def init_start_stop(self, title, time, type):
129
    def init_start_stop(self, title, time, type, kind):
129 130
        """
130 131
        title: Arrivee ou Depart
131 132
        """
132
        self.type = type
133
        self.type = kind
133 134
        self.title = title
134 135
        self.__set_time(time)
136
        self.timetable_type = type
135 137

  
136 138
def get_daily_appointments(date, worker, service, time_tables, events, holidays):
137 139
    """
......
191 193
            appointment.type = 'busy-elsewhere'
192 194
        appointment.other_services_names = [s.slug for s in services if s != service]
193 195
        appointments.append(appointment)
194
    print "time tables: %s" % time_tables
195 196
    for time_table in time_tables:
196 197
        interval_set = IntervalSet.between(time_table.to_interval(date).lower_bound.time(),
197 198
                                   time_table.to_interval(date).upper_bound.time())
......
207 208
        services = time_table.services.all()
208 209
        common_service = service in services
209 210
        services = [s.slug for s in services if s != service]
211
        appointment_kind = 'timetable '
210 212
        if common_service:
211
            appointment_type = 'info'
213
            appointment_kind += 'info'
212 214
        else:
213
            appointment_type = 'busy-elsewhere'
215
            appointment_kind += 'busy-elsewhere'
214 216
        appointment = Appointment()
215 217
        appointment.other_services_names = services
216
        appointment.init_start_stop(u"Arrivée", start_time, appointment_type)
218
        appointment.init_start_stop(u"Arrivée", start_time, 'arrival',
219
                                    appointment_kind)
217 220
        activity['arrival'] = start_time
218 221
        appointment.weight = 1
219 222
        appointments.append(appointment)
220 223
        appointment = Appointment()
221
        appointment.init_start_stop(u"Départ", end_time, appointment_type)
224
        appointment.init_start_stop(u"Départ", end_time, 'departure',
225
                                    appointment_kind)
222 226
        appointment.other_services_names = services
223 227
        activity['departure'] = end_time
224 228
        appointment.weight = -1

Formats disponibles : Unified diff