Changeset 1006 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 7 Dec 2006, 18:18:28 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
r971 r1006 20 20 path_info = request.get('PATH_INFO').split('/') 21 21 22 import logging 23 logger = logging.getLogger('getStudentInfo') 24 22 25 info = {} 23 26 member_id = str(member) 27 #from Products.zdb import set_trace 28 #set_trace() 29 student_id = None 24 30 if student is None: 25 if mtool.isAnonymousUser(): 26 return None 27 elif not context.isStudent() and 'students' in path_info: 28 student_id = path_info[path_info.index('students')+1] 29 else: 31 while True: 32 if mtool.isAnonymousUser(): 33 return None 34 try: 35 requested_id = path_info[path_info.index('students')+1] 36 except ValueError: 37 student_id = member_id 38 break 39 if not context.isStudent() and 'students' in path_info: 40 student_id = requested_id 41 break 42 if member_id != requested_id: 43 logger.info("Student %s tried to access %s" % (member_id,requested_id)) 44 student_id = member_id 45 #mtool.assertViewable(context) 46 break 30 47 student_id = member_id 48 break 31 49 else: 32 50 student_id = student.getId() 51 33 52 roles = member.getRoles() 34 53 student_path = "%s/campus/students/%s" % (context.portal_url.getPortalPath(),student_id) 35 54 student = context.restrictedTraverse(student_path,default=None) 36 #from Products.zdb import set_trace37 #set_trace()38 55 39 if student is None or student.portal_type != 'Student':56 if student is None or student.portal_type != "Student": 40 57 return None 41 58 ##res = context.portal_catalog(id = student_id,portal_type='Student') -
WAeUP_SRP/trunk/skins/waeup_student/search_students.py
r1000 r1006 49 49 path_info = request.get('PATH_INFO').split('/') 50 50 validate = request.has_key("cpsdocument_edit_button") 51 52 state = "all" 53 if "ClearanceOfficers" in member.getGroups(): 54 state = "clearance_requested" 51 55 default = {'search_mode': 'name', 52 'review_state': 'all',56 'review_state': state, 53 57 'search_string': '' 54 58 } … … 152 156 if items: 153 157 for item in items: 154 #if context.isClearanceOfficer(info): 158 stcat = context.students_catalog 159 record = stcat(id = item)[0] 155 160 info = {} 161 for field in stcat.schema() + stcat.indexes(): 162 info[field] = getattr(record, field) 156 163 if "ClearanceOfficers" in member.getGroups(): 157 164 co_view = True 158 ## droles = member.getRolesInContext(item) 159 ## if "ClearanceOfficer" in droles: 160 ## info = context.getStudentInfo(item) 161 ## students.append(info) 165 res = context.portal_catalog(portal_type='Student', id = item) 166 if len(res) != 1: 167 continue 168 droles = member.getRolesInContext(res[0].getObject()) 169 info['review_state'] = res[0].review_state 170 if "ClearanceOfficer" in droles: 171 students.append(info) 162 172 else: 163 #info = context.getStudentInfo(item)164 info = context.students_catalog(id = item)165 173 if len(info) == 1: 166 students.append(info [0])174 students.append(info) 167 175 168 176 return context.search_students_form(rendered = rend, 169 177 psm = "", 170 #psm = "%d,%d matching Students found QS = %s" %\171 # (len(review_set),len(search_set),query_step),172 #psm = "%d found QS = %s items: %s" % (len(items),query_step,items),173 178 students = students, 174 179 allowed = True, … … 177 182 return context.search_students_form(rendered = rend, 178 183 psm = "No student found!", 179 #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),180 184 students = students, 181 185 allowed = True, -
WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt
r971 r1006 63 63 <td tal:condition="options/co_view|nothing"> 64 64 <a href="id" 65 tal:attributes="href string:${ student/student/clearance/absolute_url}/external_clearance_edit_form"65 tal:attributes="href string:${context/portal_url}/campus/students/${student/id}/clearance/external_clearance_edit_form" 66 66 target="edit" 67 67 onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"
Note: See TracChangeset for help on using the changeset viewer.