1.1 --- a/actions/EventAggregatorNewEvent.py Sat Feb 27 01:43:30 2010 +0100
1.2 +++ b/actions/EventAggregatorNewEvent.py Sat Mar 06 22:51:27 2010 +0100
1.3 @@ -275,21 +275,22 @@
1.4 if start_date > end_date:
1.5 start_date, end_date = end_date, start_date
1.6
1.7 + event_details = {
1.8 + "start" : start_date, "end" : end_date,
1.9 + "title" : title, "summary" : title,
1.10 + "description" : description
1.11 + }
1.12 +
1.13 # Copy the template.
1.14
1.15 - page = PageEditor(request, template)
1.16 + template_page = PageEditor(request, template)
1.17
1.18 - if not page.exists():
1.19 + if not template_page.exists():
1.20 return 0, _("Event template not available.")
1.21
1.22 - event_page = EventAggregatorSupport.EventPage(page)
1.23 -
1.24 # Use any parent page information.
1.25
1.26 - if parent:
1.27 - full_title = "%s/%s" % (parent.rstrip("/"), title)
1.28 - else:
1.29 - full_title = title
1.30 + full_title = EventAggregatorSupport.getFullPageName(parent, title)
1.31
1.32 # Load the new page and replace the event details in the body.
1.33
1.34 @@ -298,19 +299,10 @@
1.35 if new_page.exists():
1.36 return 0, _("The specified page already exists. Please choose another name.")
1.37
1.38 - new_event_page = EventAggregatorSupport.EventPage(new_page)
1.39 - new_event_page.copyPage(event_page)
1.40 + # Complete the new page.
1.41
1.42 - if new_event_page.getFormat() == "wiki":
1.43 - event_details = {
1.44 - "start" : start_date, "end" : end_date,
1.45 - "title" : title, "summary" : title,
1.46 - "description" : description
1.47 - }
1.48 - new_event = EventAggregatorSupport.Event(new_event_page, event_details)
1.49 - new_event_page.setEvents([new_event])
1.50 - new_event_page.setCategoryMembership(category_pagenames)
1.51 - new_event_page.saveChanges()
1.52 + EventAggregatorSupport.fillEventPageFromTemplate(template_page,
1.53 + new_page, event_details, category_pagenames)
1.54
1.55 # Redirect and return success.
1.56