- Timestamp:
- 13 Nov 2006, 15:39:08 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py
r847 r858 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST ,proceed=None, cpsdocument_edit_button=None, final_submit=None, action=None7 ##parameters=REQUEST 8 8 ##title= 9 # $Id: clearance_edit.py 8 32 2006-11-10 16:52:23Z joachim$9 # $Id: clearance_edit.py 852 2006-11-12 21:21:07Z henrik $ 10 10 """ 11 11 """ … … 16 16 current = DateTime.DateTime() 17 17 18 cpsdocument_edit_button = REQUEST.has_key('cpsdocument_edit_button') 19 cpsdocument_edit_and_view_button = REQUEST.has_key('cpsdocument_edit_and_view_button') 20 clear_and_validate_button = REQUEST.has_key('clear_and_validate_button') 21 undo_clear_button = REQUEST.has_key('undo_clear_button') 22 reject_clearance_button = REQUEST.has_key('reject_clearance_button') 23 18 24 # Until ajax posts directly to its own script... 19 25 ##if 'ajax_edit' in REQUEST.form: 20 26 ## return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster) 21 22 # Check flexible controls23 #context.editLayouts(REQUEST=REQUEST)24 27 25 28 # Validate the document and write it if it's valid … … 33 36 clear = info['clear'] 34 37 clear_doc = info['clear_doc'] 35 state = context.getStudentInfo()['review_state'] 36 if 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']) 38 review_state = info['review_state'] 40 39 41 40 is_valid, ds = clear_doc.validate(request=REQUEST, … … 48 47 args = {} 49 48 action = "/clearance_edit_form_manager" 50 if cpsdocument_edit_button:51 if is_valid:49 if is_valid: 50 if cpsdocument_edit_button: 52 51 psm = 'Content changed.' 53 if ds.get('acknow'): 54 args['final_submit'] = "Finally Submit" 55 else: 56 args = getFormUidUrlArg(REQUEST) 57 psm = "Please correct your errors." 58 args['portal_status_message'] = psm 52 elif cpsdocument_edit_and_view_button: 53 wftool.doActionFor(info['clear'],'close') 54 wftool.doActionFor(info['student'],'request_clearance') 55 elif clear_and_validate_button: 56 wftool.doActionFor(info['student'],'clear_and_validate') 57 elif reject_clearance_button: 58 wftool.doActionFor(info['clear'],'open') 59 wftool.doActionFor(info['student'],'enter_clearance_pin') 60 elif undo_clear_button: 61 wftool.doActionFor(info['student'],'request_clearance') 62 else: 63 psm = "Please correct your errors." 64 args = getFormUidUrlArg(REQUEST) 65 args['review_state'] = review_state 66 args['portal_status_message'] = psm 59 67 if args: 60 68 url = clear.absolute_url() + action + '?' + urlencode(args) … … 62 70 url = clear.absolute_url() + action 63 71 REQUEST.RESPONSE.redirect(url) 64
Note: See TracChangeset for help on using the changeset viewer.