1.1 --- a/imip_manager.py Tue Jan 13 22:41:18 2015 +0100
1.2 +++ b/imip_manager.py Tue Jan 13 23:37:56 2015 +0100
1.3 @@ -90,6 +90,10 @@
1.4 path_info = self.get_path_info()
1.5 return "%s%s" % (path.rstrip("/"), path_info)
1.6
1.7 + def new_url(self, path_info):
1.8 + path = self.get_path()
1.9 + return "%s/%s" % (path.rstrip("/"), path_info.lstrip("/"))
1.10 +
1.11 class ManagerHandler(Handler):
1.12
1.13 """
1.14 @@ -314,16 +318,21 @@
1.15 on the current page.
1.16 """
1.17
1.18 - details = self._get_details(obj)
1.19 + # Obtain the user's timezone.
1.20 +
1.21 + prefs = self.get_preferences()
1.22 + tzid = prefs.get("TZID", "UTC")
1.23
1.24 # Provide a summary of the object.
1.25
1.26 + details = self._get_details(obj)
1.27 +
1.28 self.page.dl()
1.29
1.30 for name in ["SUMMARY", "DTSTART", "DTEND", "ORGANIZER", "ATTENDEE"]:
1.31 if name in ["DTSTART", "DTEND"]:
1.32 value, attr = get_item(details, name)
1.33 - tzid = attr.get("TZID")
1.34 + tzid = attr.get("TZID", tzid)
1.35 value = self.format_datetime(to_timezone(get_datetime(value), tzid), "full")
1.36 self.page.dt(name)
1.37 self.page.dd(value)
1.38 @@ -346,16 +355,26 @@
1.39 # Obtain any time zone details from the suggested event.
1.40
1.41 _dtstart, attr = get_item(details, "DTSTART")
1.42 - tzid = attr.get("TZID")
1.43 + tzid = attr.get("TZID", tzid)
1.44
1.45 # Show any conflicts.
1.46
1.47 for t in have_conflict(freebusy, [(dtstart, dtend)], True):
1.48 start, end, found_uid = t[:3]
1.49 +
1.50 + # Provide details of any conflicting event.
1.51 +
1.52 if uid != found_uid:
1.53 start = self.format_datetime(to_timezone(get_datetime(start), tzid), "full")
1.54 end = self.format_datetime(to_timezone(get_datetime(end), tzid), "full")
1.55 - self.page.p("Event conflicts with another from %s to %s." % (start, end))
1.56 + self.page.p("Event conflicts with another from %s to %s: " % (start, end))
1.57 +
1.58 + # Show the event summary for the conflicting event.
1.59 +
1.60 + found_obj = self._get_object(found_uid)
1.61 + if found_obj:
1.62 + found_details = self._get_details(found_obj)
1.63 + self.page.a(get_value(found_details, "SUMMARY"), href=self.env.new_url(found_uid))
1.64
1.65 def show_requests_on_page(self):
1.66
1.67 @@ -422,7 +441,7 @@
1.68 page.p("No events scheduled.")
1.69 return
1.70
1.71 - # Set the locale and obtain the user's timezone.
1.72 + # Obtain the user's timezone.
1.73
1.74 prefs = self.get_preferences()
1.75 tzid = prefs.get("TZID", "UTC")