1 ##parameters=title='', description='', event_type=[], start_date={}, end_date={}, location='', contact_name='', contact_email='', contact_phone='', event_url='', **kw
3 from Products
.CMFCalendar
.exceptions
import ResourceLockedError
4 from Products
.Plinn
.exceptions
import DateTimeError
5 from DateTime
import DateTime
8 startDate
= DateTime('%s/%s/%s %s %s' % (start_date
['year'],
12 start_date
['minute']) )
13 context
.setStartDate(startDate
)
15 return context
.setStatus(False, "Start date is not valid.")
19 endDate
= DateTime('%s/%s/%s %s %s' % (end_date
['year'],
24 context
.setEndDate(endDate
)
26 return context
.setStatus(False, "End date is not valid.")
29 context
.edit( title
=title
30 , description
= description
32 , contact_name
= contact_name
33 , contact_email
= contact_email
34 , contact_phone
= contact_phone
35 , event_url
= event_url
36 , eventType
= event_type
38 , effectiveDay
= startDate
.day()
39 , effectiveMo
= startDate
.month()
40 , effectiveYear
= startDate
.year()
41 , start_time
= startDate
.AMPM()
44 , expirationDay
= endDate
.day()
45 , expirationMo
= endDate
.month()
46 , expirationYear
= endDate
.year()
47 , stop_time
= endDate
.AMPM()
51 return context
.setStatus(True, 'Event changed.')
52 except ResourceLockedError
, errmsg
:
53 return context
.setStatus(False, errmsg
)