1.1 --- a/imip_manager.py Mon Feb 09 15:11:15 2015 +0100
1.2 +++ b/imip_manager.py Mon Feb 09 15:32:36 2015 +0100
1.3 @@ -885,21 +885,50 @@
1.4
1.5 # Show any conflicts.
1.6
1.7 - for t in have_conflict(freebusy, [(dtstart, dtend)], True):
1.8 - start, end, found_uid = t[:3]
1.9 + conflicts = [t for t in have_conflict(freebusy, [(dtstart, dtend)], True) if t[2] != uid]
1.10
1.11 - # Provide details of any conflicting event.
1.12 + if conflicts:
1.13 + page.p("This event conflicts with others:")
1.14
1.15 - if uid != found_uid:
1.16 - start = self.format_datetime(to_timezone(get_datetime(start), tzid), "full")
1.17 - end = self.format_datetime(to_timezone(get_datetime(end), tzid), "full")
1.18 - page.p("Event conflicts with another from %s to %s: " % (start, end))
1.19 + page.table(cellspacing=5, cellpadding=5, class_="conflicts")
1.20 + page.thead()
1.21 + page.tr()
1.22 + page.th("Event")
1.23 + page.th("Start")
1.24 + page.th("End")
1.25 + page.tr.close()
1.26 + page.thead.close()
1.27 + page.tbody()
1.28 +
1.29 + for t in conflicts:
1.30 + start, end, found_uid = t[:3]
1.31 +
1.32 + # Provide details of any conflicting event.
1.33 +
1.34 + start = self.format_datetime(to_timezone(get_datetime(start), tzid), "long")
1.35 + end = self.format_datetime(to_timezone(get_datetime(end), tzid), "long")
1.36 +
1.37 + page.tr()
1.38
1.39 # Show the event summary for the conflicting event.
1.40
1.41 + page.td()
1.42 +
1.43 found_obj = self._get_object(found_uid)
1.44 if found_obj:
1.45 page.a(found_obj.get_value("SUMMARY"), href=self.env.new_url(found_uid))
1.46 + else:
1.47 + page.add("No details available")
1.48 +
1.49 + page.td.close()
1.50 +
1.51 + page.td(start)
1.52 + page.td(end)
1.53 +
1.54 + page.tr.close()
1.55 +
1.56 + page.tbody.close()
1.57 + page.table.close()
1.58
1.59 self.show_request_controls(obj)
1.60 page.form.close()