1.1 --- a/imipweb/event.py Sat Mar 28 00:52:14 2015 +0100
1.2 +++ b/imipweb/event.py Sat Mar 28 00:55:12 2015 +0100
1.3 @@ -820,7 +820,7 @@
1.4
1.5 # Obtain the periods associated with the event in the user's time zone.
1.6
1.7 - periods = obj.get_periods(self.get_tzid(), self.get_window_end(), origin=True)
1.8 + periods = obj.get_periods(self.get_tzid(), self.get_window_end())
1.9 recurrenceids = self._get_recurrences(uid)
1.10
1.11 if len(periods) == 1:
1.12 @@ -834,19 +834,19 @@
1.13 # Determine whether any periods are explicitly created or are part of a
1.14 # rule.
1.15
1.16 - explicit_periods = filter(lambda t: t[2] != "RRULE", periods)
1.17 + explicit_periods = filter(lambda p: p.origin != "RRULE", periods)
1.18
1.19 # Show each recurrence in a separate table if editable.
1.20
1.21 if is_organiser and explicit_periods:
1.22
1.23 - for index, (start, end, origin) in enumerate(periods[1:]):
1.24 + for index, p in enumerate(periods[1:]):
1.25
1.26 # Isolate the controls from neighbouring tables.
1.27
1.28 page.div()
1.29
1.30 - self.show_object_datetime_controls(start, end, index)
1.31 + self.show_object_datetime_controls(p.start, p.end, index)
1.32
1.33 # NOTE: Need to customise the TH classes according to errors and
1.34 # NOTE: index information.
1.35 @@ -856,11 +856,11 @@
1.36 page.tbody()
1.37 page.tr()
1.38 page.th("Start", class_="objectheading start")
1.39 - self.show_recurrence_controls(obj, index, start, end, origin, recurrenceid, recurrenceids, True)
1.40 + self.show_recurrence_controls(obj, index, p.start, p.end, p.origin, recurrenceid, recurrenceids, True)
1.41 page.tr.close()
1.42 page.tr()
1.43 page.th("End", class_="objectheading end")
1.44 - self.show_recurrence_controls(obj, index, start, end, origin, recurrenceid, recurrenceids, False)
1.45 + self.show_recurrence_controls(obj, index, p.start, p.end, p.origin, recurrenceid, recurrenceids, False)
1.46 page.tr.close()
1.47 page.tbody.close()
1.48 page.table.close()
1.49 @@ -883,10 +883,10 @@
1.50 # Show only subsequent periods if organiser, since the principal
1.51 # period will be the start and end datetimes.
1.52
1.53 - for index, (start, end, origin) in enumerate(is_organiser and periods[1:] or periods):
1.54 + for index, p in enumerate(is_organiser and periods[1:] or periods):
1.55 page.tr()
1.56 - self.show_recurrence_controls(obj, index, start, end, origin, recurrenceid, recurrenceids, True)
1.57 - self.show_recurrence_controls(obj, index, start, end, origin, recurrenceid, recurrenceids, False)
1.58 + self.show_recurrence_controls(obj, index, p.start, p.end, p.origin, recurrenceid, recurrenceids, True)
1.59 + self.show_recurrence_controls(obj, index, p.start, p.end, p.origin, recurrenceid, recurrenceids, False)
1.60 page.tr.close()
1.61 page.tbody.close()
1.62 page.table.close()
1.63 @@ -918,7 +918,8 @@
1.64
1.65 # Show any conflicts.
1.66
1.67 - conflicts = [t for t in have_conflict(freebusy, periods, True) if t[2] != uid]
1.68 + conflicts = list([p for p in have_conflict(freebusy, periods, True) if p.uid != uid])
1.69 + conflicts.sort()
1.70
1.71 if conflicts:
1.72 page.p("This event conflicts with others:")
1.73 @@ -933,20 +934,19 @@
1.74 page.thead.close()
1.75 page.tbody()
1.76
1.77 - for t in conflicts:
1.78 - start, end, found_uid, transp, found_recurrenceid, summary = t[:6]
1.79 + for p in conflicts:
1.80
1.81 # Provide details of any conflicting event.
1.82
1.83 - start = self.format_datetime(to_timezone(get_datetime(start), tzid), "long")
1.84 - end = self.format_datetime(to_timezone(get_datetime(end), tzid), "long")
1.85 + start = self.format_datetime(to_timezone(get_datetime(p.start), tzid), "long")
1.86 + end = self.format_datetime(to_timezone(get_datetime(p.end), tzid), "long")
1.87
1.88 page.tr()
1.89
1.90 # Show the event summary for the conflicting event.
1.91
1.92 page.td()
1.93 - page.a(summary, href=self.link_to(found_uid))
1.94 + page.a(p.summary, href=self.link_to(p.uid))
1.95 page.td.close()
1.96
1.97 page.td(start)