Changeset 858 for WAeUP_SRP/trunk/skins
- Timestamp:
- 13 Nov 2006, 15:39:08 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt
r850 r858 7 7 layout_mode='edit', 8 8 use_session=True); 9 form_action string:clearance_edit; 9 form_action string:clearance_edit_manager; 10 isManager context/isManager; 10 11 edition python:True; 11 12 creation python:False; 12 metadata nothing; 13 is_manager context/isManager; 13 review_state info/review_state 14 14 "> 15 15 <metal:block use-macro="here/waeup_content_master/macros/master"> 16 17 16 <metal:block fill-slot="header"> 18 <span tal:condition="not: is _manager">19 17 <span tal:condition="not: isManager"> 18 <metal:block use-macro="here/error_not_found/macros/not_found" /> 20 19 </span> 21 <span tal:condition="is _manager">22 <a href=""23 tal:attributes="href string:${here/academicsParent}">24 <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>25 Up one level26 </a>27 28 29 30 31 20 <span tal:condition="isManager"> 21 <a href="" 22 tal:attributes="href string:${here/academicsParent}"> 23 <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/> 24 Up one level 25 </a> 26 <h3> 27 <span tal:condition="info"> 28 <span tal:content="info/student/Title" />: 29 </span> 30 <span tal:content="here/title_or_id" /> 32 31 </h3> 33 <br />32 <br /> 34 33 </span> 35 34 </metal:block> 36 37 <metal:block fill-slot="main" tal:condition="is_manager"> 35 <metal:block fill-slot="main"> 38 36 <form action="ACTION" method="post" id="editForm" 39 37 enctype="multipart/form-data" class="workflow" … … 49 47 </div> 50 48 </div> 51 <input type="submit" class="standalone" name="cpsdocument_edit_button" 52 value="Save & Return later" 53 id="cpsdocument_edit_button" 54 tal:condition="not:creation" /> 55 <input type="submit" class="standalone" 56 tal:condition="request/final_submit|nothing" 57 name="final_submit" 58 tal:attributes="value request/final_submit" 59 /> 60 </form> 61 <div id="ajax_psm" style="display:none"> 62 ajax feedback 63 </div> 49 <input type="submit" class="standalone" 50 name="cpsdocument_edit_button" 51 value="Save & Return later" 52 id="cpsdocument_edit_button" 53 tal:condition="python: review_state == 'clearance_pin_entered'" /> 54 <input type="submit" class="standalone" 55 name="cpsdocument_edit_and_view_button" 56 value="Save & Submit" 57 id="cpsdocument_edit_and_view_button" 58 tal:condition="python: review_state == 'clearance_pin_entered'" /> 59 <input type="submit" class="standalone" 60 name="clear_and_validate_button" 61 value="Clear & Validate" 62 id="clear_and_validate_button" 63 tal:condition="python:review_state == 'clearance_requested'" /> 64 <input type="submit" class="standalone" 65 name="reject_clearance_button" 66 value="Reject Clearance" 67 id="reject_clearance_button" 68 tal:condition="python:review_state == 'clearance_requested'" /> 69 <input type="submit" class="standalone" 70 name="undo_clear_button" 71 value="Undo Clear & Validate" 72 id="undo_clear_button" 73 tal:condition="python:review_state == 'cleared_and_validated'" /> 74 </form> 75 <div id="ajax_psm" style="display:none"> 76 ajax feedback 77 </div> 78 </metal:block> 64 79 </metal:block> 65 66 </metal:block>67 80 </tal:block> -
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.