- Timestamp:
- 17 Nov 2006, 16:06:47 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 added
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/profiles/default/actions.xml
r874 r885 119 119 </action> 120 120 <action title="Students" action_id="view_students" category="navigation" 121 condition_expr=" here/isStaff" url_expr="string:${portal_url}/campus/students"121 condition_expr="python:here.isStaff() or here.isManager()" url_expr="string:${portal_url}/campus/students" 122 122 visible="True"> 123 123 <permission>View</permission> -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
r883 r885 8 8 <permission>View</permission> 9 9 <state state_id="closed" title=""> 10 <exit-transition transition_id="open"/> 10 <permission-map name="Modify portal content" 11 acquired="True"> 12 <permission-role>ClearanceOfficer</permission-role> 13 </permission-map> 14 <exit-transition transition_id="open"/> 11 15 </state> 12 16 <state state_id="content_addable" title=""> -
WAeUP_SRP/trunk/skins/waeup_default/isClearanceOfficer.py
r875 r885 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters= info=None7 ##parameters= 8 8 ##title= 9 9 ## 10 10 # $Id$ 11 """12 11 13 """14 wftool = context.portal_workflow15 12 mtool = context.portal_membership 16 member = mtool.getAuthenticatedMember() 17 18 if info is None: 19 info = context.getStudentInfo() 20 if info is None: 21 return False 22 if info['course'] is None: 23 return False 24 25 res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department) 26 if len(res) != 1: 27 return False 28 29 roles = member.getRolesInContext(res[0].getObject()) 30 13 roles = mtool.getAuthenticatedMember().getRolesInContext(context) 31 14 return "ClearanceOfficer" in roles 32 15 -
WAeUP_SRP/trunk/skins/waeup_default/isManager.py
r874 r885 9 9 ## 10 10 # $Id$ 11 """12 return True if the member is considered a Manager,13 consider all non-Student members to be Managers14 11 15 """ 16 return context.isStaff() 12 mtool = context.portal_membership 13 roles = mtool.getAuthenticatedMember().getRolesInContext(context) 14 return "Manager" in roles -
WAeUP_SRP/trunk/skins/waeup_default/isStaff.py
r879 r885 9 9 ## 10 10 # $Id: $ 11 """12 11 13 """14 12 mtool = context.portal_membership 15 if mtool.isAnonymousUser(): 16 return False 17 roles = mtool.getAuthenticatedMember().getRolesInContext(context) 18 return not "Student" in roles 13 member = mtool.getAuthenticatedMember() 14 roles = member.getRolesInContext(context) 19 15 16 return "SectionManager" in roles or\ 17 "ClearanceOfficer" in roles or\ 18 "ClearanceOfficers" in member.getGroups() -
WAeUP_SRP/trunk/skins/waeup_default/isStudent.py
r874 r885 9 9 ## 10 10 # $Id$ 11 """ 12 return True if the member is considered a Student 13 """ 14 roles = context.portal_membership.getAuthenticatedMember().getRolesInContext(context) 11 12 mtool = context.portal_membership 13 roles = mtool.getAuthenticatedMember().getRolesInContext(context) 15 14 return "Student" in roles -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py
r852 r885 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST , cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, acknowledge=None7 ##parameters=REQUEST 8 8 ##title= 9 9 # $Id$ … … 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 reject_clearance_button = REQUEST.has_key('reject_clearance_button') 18 22 # Until ajax posts directly to its own script... 19 23 ##if 'ajax_edit' in REQUEST.form: 20 24 ## return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster) 21 22 # Check flexible controls23 #context.editLayouts(REQUEST=REQUEST)24 25 25 26 # Validate the document and write it if it's valid … … 33 34 clear = info['clear'] 34 35 clear_doc = info['clear_doc'] 35 state = context.getStudentInfo()['review_state']36 review_state = info['review_state'] 36 37 37 38 is_valid, ds = clear_doc.validate(request=REQUEST, 38 39 schema_id = 'student_clearance', 39 layout_id = 'student_clearance _fe',40 layout_id = 'student_clearance', 40 41 proxy=clear, 41 42 use_session=True) … … 48 49 psm = 'Content changed.' 49 50 elif cpsdocument_edit_and_view_button: 50 if acknowledge: 51 wftool.doActionFor(info['clear'],'close') 52 wftool.doActionFor(info['student'],'request_clearance') 53 return REQUEST.RESPONSE.redirect("%s/clearance_view" % info['url']) 54 psm = "You must tick the Acknowledgement Check Box before submission!" 51 wftool.doActionFor(info['clear'],'close') 52 wftool.doActionFor(info['student'],'request_clearance',dest_container=1) 53 elif clear_and_validate_button: 54 wftool.doActionFor(info['student'],'clear_and_validate') 55 elif reject_clearance_button: 56 wftool.doActionFor(info['clear'],'open') 57 wftool.doActionFor(info['student'],'reject_clearance') 55 58 else: 56 59 psm = "Please correct your errors." 57 60 args = getFormUidUrlArg(REQUEST) 61 args['review_state'] = review_state 58 62 args['portal_status_message'] = psm 59 63 if args: -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt
r852 r885 1 1 <tal:block define=" 2 2 info context/getStudentInfo; 3 isManager context/isManager; 4 isStaff context/isStaff; 5 isClearanceOfficer context/isClearanceOfficer; 6 isOwner context/isThisStudent; 7 review_state info/review_state; 8 edition python: (isOwner and review_state == 'clearance_pin_entered' or isManager) and not isClearanceOfficer; 9 mode python: test(edition,'edit','view'); 3 10 rendered_main python:info['clear_doc'].render(request=request, 4 layout_mode = 'edit',11 layout_mode = mode, 5 12 schema_id='student_clearance', 6 layout_id='student_clearance_fe', 7 layout_mode='edit', 13 layout_id='student_clearance', 8 14 use_session=True); 9 15 form_action string:clearance_edit; 10 edition python:True;11 16 creation python:False; 12 metadata nothing;13 17 "> 14 <metal:block define-macro="edit_form">15 18 <metal:block use-macro="here/waeup_content_master/macros/master"> 16 17 19 <metal:block fill-slot="header"> 18 <a href="" 19 tal:attributes="href string:${here/academicsParent}"> 20 <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/> 21 Up one level 22 </a> 23 <h3>Fill Your Clearance/Eligibility Form!</h3> 24 <br /> 20 <metal:block use-macro="here/clearance_edit_lib/macros/header" /> 25 21 </metal:block> 26 27 22 <metal:block fill-slot="main"> 28 23 <form action="ACTION" method="post" id="editForm" … … 39 34 </div> 40 35 </div> 41 42 <div> 43 44 <input type="checkbox" value="True" name="acknowledge" /> 45 46 I hereby acknowledge by ticking this check box 47 that, if it is discovered at any time that I do not possess any of the 48 qualifications which I claim to have obtained, I will be expelled from the 49 University and shall not be re-admitted for the same or any other programme, 50 even if I have upgraded my previous qualifications or possess additional 51 qualifications. 52 53 54 </div> 55 56 <br /> 57 58 <input type="submit" class="standalone" 59 name="cpsdocument_edit_button" 60 value="Save & Return later" 61 id="cpsdocument_edit_button" 62 tal:condition="not:creation" /> 63 <input type="submit" class="standalone" 64 name="cpsdocument_edit_and_view_button" 65 value="Save & Submit" 66 id="cpsdocument_edit_and_view_button" 67 tal:condition="not:creation" /> 36 <metal:block use-macro="here/clearance_edit_lib/macros/buttons" /> 68 37 </form> 69 38 <div id="ajax_psm" style="display:none"> … … 72 41 </metal:block> 73 42 </metal:block> 74 </metal:block>75 43 </tal:block> -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt
r876 r885 1 1 <tal:block define=" 2 2 info context/getStudentInfo; 3 mode python: test(context.isClearanceOfficer(info),'view','edit'); 3 isManager context/isManager; 4 isStaff context/isStaff; 5 isClearanceOfficer context/isClearanceOfficer; 6 isOwner context/isThisStudent; 7 edition python:(isOwner or isManager) and not isClearanceOfficer; 8 mode python: test(edition,'edit','view'); 4 9 rendered_main python:info['clear_doc'].render(request=request, 5 10 layout_mode = mode, … … 8 13 use_session=True); 9 14 form_action string:clearance_edit_manager; 10 isManager context/isManager;11 edition python:True;12 15 creation python:False; 13 16 review_state info/review_state … … 15 18 <metal:block use-macro="here/waeup_content_master/macros/master"> 16 19 <metal:block fill-slot="header"> 17 <span tal:condition=" not: isManager">20 <span tal:condition="python: not(isStaff or isManager)"> 18 21 <metal:block use-macro="here/error_not_found/macros/not_found" /> 19 22 </span> 20 <span tal:condition=" isManager">23 <span tal:condition="python: isStaff or isManager"> 21 24 <a href="" 22 25 tal:attributes="href string:${here/academicsParent}"> … … 47 50 </div> 48 51 </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="Validate & Clear" 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 == 'cleared_and_validated'" /> 52 <metal:block use-macro="here/clearance_edit_lib/macros/buttons" /> 69 53 </form> 70 54 <div id="ajax_psm" style="display:none"> -
WAeUP_SRP/trunk/skins/waeup_student/co_searchStudents.py
r883 r885 49 49 pr = context.portal_registration 50 50 path_info = request.get('PATH_INFO').split('/') 51 is_manager = context.isManager 51 is_manager = context.isManager() 52 52 validate = request.has_key("cpsdocument_edit_button") 53 53 default = {'search_mode': 'name', … … 69 69 #psm = "%s, %s" % (psm,ds), 70 70 students = items, 71 is_manager = is_manager,71 allowed = True, 72 72 ) 73 73 what = ds.get('search_mode') … … 92 92 #psm = "%s, %s" % (psm,ds), 93 93 students = items, 94 is_manager = is_manager,94 allowed = True, 95 95 ) 96 96 items = [] … … 165 165 info = context.getStudentInfo(item) 166 166 students.append(info) 167 return context.students_ co_view(rendered = rend,167 return context.students_manager_view(rendered = rend, 168 168 psm = "", 169 169 #psm = "%d,%d matching Students found QS = %s" %\ … … 171 171 #psm = "%d found QS = %s items: %s" % (len(items),query_step,items), 172 172 students = students, 173 is_manager = is_manager,173 allowed = True, 174 174 ) 175 return context.students_ co_view(rendered = rend,175 return context.students_manager_view(rendered = rend, 176 176 psm = """Step: %s found: %s Your search for "%s" in %s with state %s failed.<br\>%s""" % (query_step,len(items),st,what,state,bools), 177 177 students = students, 178 is_manager = is_manager,178 allowed = True, 179 179 ) 180 180 -
WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
r883 r885 27 27 if mtool.isAnonymousUser(): 28 28 return None 29 elif context.isManager() and 'students' in path_info:29 elif not context.isStudent() and 'students' in path_info: 30 30 student_id = path_info[path_info.index('students')+1] 31 31 else: -
WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
r845 r885 64 64 #psm = "%s, %s" % (psm,ds), 65 65 students = items, 66 is_manager = is_manager,66 allowed = True, 67 67 ) 68 68 what = ds.get('search_mode') … … 87 87 #psm = "%s, %s" % (psm,ds), 88 88 students = items, 89 is_manager = is_manager,89 allowed = True, 90 90 ) 91 91 items = [] … … 162 162 #psm = "%d found QS = %s items: %s" % (len(items),query_step,items), 163 163 students = students, 164 is_manager = is_manager,164 allowed = True, 165 165 ) 166 166 return context.students_manager_view(rendered = rend, 167 167 psm = """Step: %s found: %s Your search for "%s" in %s with state %s failed.<br\>%s""" % (query_step,len(items),st,what,state,bools), 168 168 students = students, 169 is_manager = is_manager,169 allowed = True, 170 170 ) -
WAeUP_SRP/trunk/skins/waeup_student/students_manager_view.pt
r805 r885 2 2 portal_status_message options/psm; 3 3 students options/students; 4 is_manager options/is_manager;"4 allowed options/allowed|nothing" 5 5 > 6 6 <metal:body use-macro="here/main_template/macros/master"> … … 13 13 14 14 <metal:main fill-slot="main"> 15 <span tal:condition="not: is_manager">15 <span tal:condition="not: allowed"> 16 16 <metal:block use-macro="here/error_not_found/macros/not_found" /> 17 17 </span> 18 <span tal:condition=" is_manager"18 <span tal:condition="allowed" 19 19 tal:define="items students; 20 20 columns python:3;
Note: See TracChangeset for help on using the changeset viewer.