- Timestamp:
- 19 Dec 2007, 11:16:49 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/getStudentFolderInfo.py
r2837 r2961 58 58 student_path = "%s/campus/students/%s" % (context.portal_url(),student_id) 59 59 students_folder = context.portal_url.getPortalObject().campus.students 60 # res = context.students_catalog(id = student_id) 61 # if not res: 62 # return None 63 # student_record = res[0] 60 64 61 student_record = context.students_catalog.getRecordByKey(student_id) 65 62 if student_record is None: … … 69 66 for field in context.students_catalog.schema(): 70 67 info[field] = getattr(student_record,field) 71 72 #res = context.portal_catalog(portal_type='Student',id = student_id)73 #if res:74 # info['review_state'] = res[0].review_state75 68 76 69 #info['review_state'] = context.getStudentReviewState() … … 98 91 'PaymentsFolder': 'payments_view', 99 92 } 100 #logger.info("before search") 101 #starttime = DateTime.DateTime().timeTime() 102 #sos = context.portal_catalog(container_path=student_path_root) 103 # query = Eq('container_path',student_path_root) 104 # sos = aq_portal(query) 105 # logger.info("searchtime %f" % (DateTime.DateTime().timeTime() - starttime)) 106 # starttime = DateTime.DateTime().timeTime() 107 # for so in sos: 108 # row = {} 109 # row['id'] = so.getId 110 # row['title'] = so.Title 111 # url = row['url'] = "%s/%s" % (student_path,so.getId) 112 # row['type'] = so.portal_type 113 # review_state = row['review_state'] = so.review_state 114 # row['is_editable'] = (is_student and review_state == "opened") or is_sectionofficer 115 # sv_link = s_view_links.get(so.portal_type,None) or "waeup_document_view" 116 # row['s_view_link'] = "%s/%s" % (url,sv_link) 117 # se_link = s_edit_links.get(so.portal_type,None) 118 # row['s_edit_link'] = None 119 # if se_link: 120 # row['s_edit_link'] = "%s/%s" % (url,se_link) 121 # row['display'] = review_state in ('opened','closed','bed_reserved','maintenance_fee_paid',)\ 122 # and so.portal_type not in ('StudentPume','StudentAccommodation','PaymentsFolder',) or\ 123 # so.portal_type == 'StudentStudyCourse' 124 # items.append(row) 125 #sos = context.portal_catalog(container_path=student_path_root) 93 126 94 student_obj = getattr(students_folder,student_id) 127 95 subobjects = student_obj.objectValues() 128 #logger.info("searchtime %f" % (DateTime.DateTime().timeTime() - starttime)) 129 #starttime = DateTime.DateTime().timeTime() 96 130 97 for subobject in subobjects: 131 98 row = {} … … 146 113 subobject.portal_type == 'StudentStudyCourse' 147 114 items.append(row) 148 #logger.info("listtime %f" % (DateTime.DateTime().timeTime() - starttime)) 149 #set_trace() 115 150 116 items.sort(cmp=lambda x,y: cmp( x['title'],y['title'])) 151 117 info['items'] = items 152 118 info['member'] = member 119 120 try: 121 current_level = int(info['level']) 122 except: 123 current_level = 0 124 info['transition_return_allowed'] = info['review_state'] == 'school_fee_paid' and current_level > 100 and is_sectionofficer 125 info['transition_pay_school_fee_allowed'] = info['review_state'] == 'returning' and is_sectionofficer 126 153 127 return info 154 128 -
WAeUP_SRP/base/skins/waeup_student/student_view.pt
r2793 r2961 2 2 <metal:main fill-slot="main" 3 3 tal:define="info context/getStudentFolderInfo; 4 baseinfo info/base_info|nothing"4 baseinfo info/base_info|nothing" 5 5 > 6 6 <metal:block tal:condition="not: info"> … … 104 104 <input type="submit" class="context" value="Send Email with Authentication Data" /> 105 105 </form> 106 107 108 109 110 <form action="" method="post" class="group" 111 tal:condition="info/transition_return_allowed" 112 tal:attributes="action string:${context/absolute_url}/changeRegState"> 113 <input type="submit" class="context" value="Execute Transition 'return'" /> 114 <input type="hidden" name="transition" 115 tal:attributes="value string:return" 116 /> <br /><br /> 117 <font color='red'>Attention: This low-level method does not change the study course and/or payment objects! They must be edited separately.</font> 118 </form> 119 120 <form action="" method="post" class="group" 121 tal:condition="info/transition_pay_school_fee_allowed" 122 tal:attributes="action string:${context/absolute_url}/changeRegState"> 123 <input type="submit" class="context" value="Execute Transition 'pay_school_fee'" /> 124 <input type="hidden" name="transition" 125 tal:attributes="value string:pay_school_fee" 126 /> <br /><br /> 127 <font color='red'>Attention: This low-level method does not change the study course and/or payment objects! They must be edited separately.</font> 128 </form> 129 130 131 132 106 133 <div tal:condition="python:info['review_state']=='deactivated'"> 107 134 <font color="red">This student record has been deactivated!</font> -
WAeUP_SRP/base/skins/waeup_utilities/changeRegState.py
r2194 r2961 15 15 mtool = context.portal_membership 16 16 member = mtool.getAuthenticatedMember() 17 if str(member) not in ('admin','joachim') or transition is None: 18 return 17 18 #if str(member) not in ('admin','joachim') or transition is None: 19 # return 'Forbidden!' 20 21 if not context.isSectionOfficer() or transition is None: 22 return 'Forbidden!' 19 23 20 24 import logging … … 34 38 try: 35 39 wftool.doActionFor(student,transition) 36 logger.info('%s execute stransition %s for %s' % (member,transition,student_id))40 logger.info('%s executed transition %s for %s' % (member,transition,student_id)) 37 41 except: 38 42 logger.info('%s tried to execute transition %s for %s, transition not allowed' % (member,transition,student_id)) 43 return 'Transition not allowed!' 39 44 40 45 return request.RESPONSE.redirect("%s" % context.absolute_url()) -
WAeUP_SRP/uniben/profiles/default/workflows/waeup_student_wf/definition.xml
r2901 r2961 182 182 <exit-transition transition_id="register_courses"/> 183 183 <exit-transition transition_id="deactivate"/> 184 <exit-transition transition_id="return"/> 184 185 <permission-map name="Delete objects" acquired="False"> 185 186 <permission-role>Manager</permission-role>
Note: See TracChangeset for help on using the changeset viewer.