1.1 --- a/imipweb/event.py Sat May 16 20:02:29 2015 +0200
1.2 +++ b/imipweb/event.py Sat May 16 20:03:34 2015 +0200
1.3 @@ -70,9 +70,9 @@
1.4 def get_recurrence_keys(self, recurrenceids):
1.5 return [to_recurrence_start(s, self.get_tzid()) for s in recurrenceids]
1.6
1.7 - def is_replaced(self, period, recurrenceids):
1.8 + def is_replaced(self, period, recurrenceid, recurrenceids):
1.9 start_utc = self.get_recurrence_key(period)
1.10 - return recurrenceids and start_utc in self.get_recurrence_keys(recurrenceids) and "replaced" or ""
1.11 + return not recurrenceid and recurrenceids and start_utc in self.get_recurrence_keys(recurrenceids) and "replaced" or ""
1.12
1.13 def is_affected(self, period, recurrenceid):
1.14 start_utc = self.get_recurrence_key(period)
1.15 @@ -540,7 +540,7 @@
1.16
1.17 recurrenceid = format_datetime(obj.get_utc_datetime("RECURRENCE-ID"))
1.18 recurrenceids = self._get_recurrences(uid)
1.19 - replaced = self.is_replaced(p, recurrenceids)
1.20 + replaced = self.is_replaced(p, recurrenceid, recurrenceids)
1.21
1.22 # Provide a summary of the object.
1.23
1.24 @@ -792,7 +792,7 @@
1.25 sequence = obj.get_value("SEQUENCE")
1.26
1.27 p = event_period_from_period(period)
1.28 - replaced = self.is_replaced(p, recurrenceids)
1.29 + replaced = self.is_replaced(p, recurrenceid, recurrenceids)
1.30
1.31 # Isolate the controls from neighbouring tables.
1.32
1.33 @@ -875,8 +875,7 @@
1.34 # Show any conflicts with periods of actual attendance.
1.35
1.36 for p in have_conflict(freebusy, periods, True):
1.37 - period = event_period_from_period(p)
1.38 - if self.is_replaced(period, recurrenceids):
1.39 + if self.is_replaced(p, recurrenceid, recurrenceids):
1.40 continue
1.41 if (p.uid != uid or (recurrenceid and p.recurrenceid) and p.recurrenceid != recurrenceid) and p.transp != "ORG":
1.42 conflicts.append(p)
1.43 @@ -1037,7 +1036,7 @@
1.44 ssn = self._simple_suffixed_name
1.45
1.46 p = event_period_from_period(period)
1.47 - replaced = self.is_replaced(p, recurrenceids)
1.48 + replaced = self.is_replaced(p, recurrenceid, recurrenceids)
1.49
1.50 # Show controls for editing as organiser.
1.51
1.52 @@ -1092,7 +1091,7 @@
1.53 page = self.page
1.54
1.55 p = event_period_from_period(period)
1.56 - replaced = self.is_replaced(p, recurrenceids)
1.57 + replaced = self.is_replaced(p, recurrenceid, recurrenceids)
1.58
1.59 css = " ".join([
1.60 replaced,
1.61 @@ -1203,6 +1202,7 @@
1.62 page.span(self.format_date(base, "long"))
1.63
1.64 # Show dates for up to one week around the current date.
1.65 + # NOTE: Support paging to other dates.
1.66
1.67 else:
1.68 items = []