source: WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py @ 850

Last change on this file since 850 was 847, checked in by Henrik Bettermann, 18 years ago

cpsdocument_edit_form completely without javascript to avoid error messages in IE

File size: 2.0 KB
RevLine 
[845]1## Script (Python) "clearance_edit"
[844]2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, final_submit=None, action=None
8##title=
9# $Id: clearance_edit.py 832 2006-11-10 16:52:23Z joachim $
10"""
11"""
12wftool = context.portal_workflow
13from urllib import urlencode
14from Products.CPSDocument.utils import getFormUidUrlArg
15import DateTime
16current = DateTime.DateTime()
17
18# Until ajax posts directly to its own script...
19##if 'ajax_edit' in REQUEST.form:
20##    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
21
22# Check flexible controls
23#context.editLayouts(REQUEST=REQUEST)
24
25# Validate the document and write it if it's valid
26# (We don't call getEditableContent here, validate does it when needed.)
27wftool = context.portal_workflow
28info = context.getStudentInfo()
29
30student = info['student']
31app = info['app']
32app_doc = info['app_doc']
33clear = info['clear']
34clear_doc = info['clear_doc']
35state = context.getStudentInfo()['review_state']
36if final_submit:
37    wftool.doActionFor(info['clear'],'close')
38    wftool.doActionFor(info['student'],'request_clearance')
39    return REQUEST.RESPONSE.redirect("%s/student_index" % info['url'])
40
41is_valid, ds = clear_doc.validate(request=REQUEST,
42                                schema_id = 'student_clearance',
43                                layout_id = 'student_clearance',
44                                proxy=clear,
45                                use_session=True)
46
47psm = ""
48args = {}
49action = "/clearance_edit_form_manager"
50if cpsdocument_edit_button:
51    if is_valid:
52        psm = 'Content changed.'
53        if ds.get('acknow'):
54            args['final_submit'] = "Finally Submit"
55    else:
56        args = getFormUidUrlArg(REQUEST)
[847]57        psm = "Please correct your errors."
[844]58        args['portal_status_message'] = psm
59if args:
60  url = clear.absolute_url() + action + '?' + urlencode(args)
61else:
62  url = clear.absolute_url() + action
[845]63REQUEST.RESPONSE.redirect(url)
[844]64
Note: See TracBrowser for help on using the repository browser.