1 ##parameters=change='', change_and_view='', ajax=''
3 form
= context
.REQUEST
.form
5 context
.event_edit_control(**form
) and \
6 context
.setRedirect(context
, 'object/edit', ajax
=ajax
):
8 elif change_and_view
and \
9 context
.event_edit_control(**form
) and \
10 context
.setRedirect(context
, 'object/view', ajax
=ajax
):
18 formFields
['title'] = form
.get('title', context
.Title()).strip()
19 formFields
['location'] = form
.get('location', context
.location
)
20 formFields
['contact_name'] = form
.get('contact_name', context
.contact_name
)
21 formFields
['contact_email'] = form
.get('contact_email', context
.contact_email
)
22 formFields
['contact_phone'] = form
.get('contact_phone', context
.contact_phone
)
23 formFields
['event_type'] = form
.get('event_type', context
.Subject())
24 formFields
['description'] = form
.get('description', context
.Description())
25 formFields
['event_url'] = form
.get('event_url', context
.event_url
)
27 start_date
= context
.start_date
and context
.start_date
or context
.end_date
28 formFields
['start_date'] = {'year' : start_date
.year(),
29 'month' : str(start_date
.month()).zfill(2),
30 'day' : str(start_date
.day()).zfill(2),
31 'hour' : str(start_date
.hour()).zfill(2),
32 'minute': str(start_date
.minute()).zfill(2)}
34 end_date
= context
.end_date
35 formFields
['end_date'] = {'year' : end_date
.year(),
36 'month' : str(end_date
.month()).zfill(2),
37 'day' : str(end_date
.day()).zfill(2),
38 'hour' : str(end_date
.hour()).zfill(2),
39 'minute' : str(end_date
.minute()).zfill(2)}
43 target
= context
.getActionInfo('object/edit')['url']
44 buttons
.append( {'name': 'change', 'value': 'Change'} )
45 buttons
.append( {'name': 'change_and_view', 'value': 'Change and View'} )
46 options
['form'] = { 'action': target
,
47 'listButtonInfos': tuple(buttons
),
48 'fields' : formFields
}
50 #return options['form']['fields']
51 return context
.event_edit_template(**options
)