Changeset 1006 for WAeUP_SRP/trunk
- Timestamp:
- 7 Dec 2006, 18:18:28 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
r1004 r1006 48 48 member = mtool.getAuthenticatedMember() 49 49 50 if not is_anon: 51 if "Student" in member.getRoles(): 52 to_waeup_student_home = True 53 students = context.portal_url.getPortalObject().campus.students 54 student = getattr(students,str(member)) 55 student_app = getattr(student,'application') 56 student_pume = getattr(student,'pume',None) 57 s_review_state = wftool.getInfoFor(student,'review_state',None) 58 a_review_state = wftool.getInfoFor(student_app,'review_state',None) 59 logger.info('%s review_state %s' % (member,s_review_state)) 60 app_doc = student_app.getContent() 61 #from Products.zdb import set_trace 62 #set_trace() 63 if s_review_state in ("student_created","admitted") and\ 64 a_review_state == 'created' : 65 wftool.doActionFor(student_app,'open') 66 if student_pume is not None: 67 wftool.doActionFor(student_pume,'close') 68 da = {} 69 pin = request.get('pin') 70 if not pin: 50 if redirect_url.endswith('/logged_out'): 51 redirect_to_portal = True 52 else: 53 if not is_anon: 54 if "Student" in member.getRoles(): 55 to_waeup_student_home = True 56 students = context.portal_url.getPortalObject().campus.students 57 student = getattr(students,str(member)) 58 student_app = getattr(student,'application') 59 student_pume = getattr(student,'pume',None) 60 s_review_state = wftool.getInfoFor(student,'review_state',None) 61 a_review_state = wftool.getInfoFor(student_app,'review_state',None) 62 logger.info('%s review_state %s' % (member,s_review_state)) 63 app_doc = student_app.getContent() 64 #from Products.zdb import set_trace 65 #set_trace() 66 if s_review_state in ("student_created","admitted") and\ 67 a_review_state == 'created' : 68 wftool.doActionFor(student_app,'open') 69 if student_pume is not None: 70 wftool.doActionFor(student_pume,'close') 71 da = {} 72 pin = request.get('pin') 73 if not pin: 74 jamb_reg_no = app_doc.jamb_reg_no 75 for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()): 76 res = context.portal_pins(student=reg_no) 77 if len(res) > 0: 78 break 79 if len(res) > 0: 80 p = res[0].pin 81 if len(p) > 10: 82 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 83 else: 84 pin = p 85 da['app_ac_pin'] = pin 86 da['app_ac_date'] = current 87 app_doc.edit(mapping = da) 88 elif s_review_state in ("admitted") and a_review_state == 'opened' and\ 89 not app_doc.app_ac_pin: 71 90 jamb_reg_no = app_doc.jamb_reg_no 72 91 for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()): … … 80 99 else: 81 100 pin = p 82 da['app_ac_pin'] = pin 83 da['app_ac_date'] = current 84 app_doc.edit(mapping = da) 85 elif s_review_state in ("admitted") and a_review_state == 'opened' and\ 86 not app_doc.app_ac_pin: 87 jamb_reg_no = app_doc.jamb_reg_no 88 for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()): 89 res = context.portal_pins(student=reg_no) 90 if len(res) > 0: 91 break 92 if len(res) > 0: 93 p = res[0].pin 94 if len(p) > 10: 95 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 96 else: 97 pin = p 98 da = {} 99 da['app_ac_pin'] = pin 100 app_doc.edit(mapping = da) 101 elif "Manager" in member.getRoles(): 102 pass 103 else: 104 to_member_home, to_workspaces = checkRedirect(portal, mtool) 101 da = {} 102 da['app_ac_pin'] = pin 103 app_doc.edit(mapping = da) 104 elif "Manager" in member.getRoles(): 105 pass 106 else: 107 to_member_home, to_workspaces = checkRedirect(portal, mtool) 105 108 if (not to_member_home) and (not to_workspaces): 106 109 redirect_to_portal = True -
WAeUP_SRP/trunk/skins/waeup_custom/standard_error_message.pt
r535 r1006 8 8 p_props here/portal_properties; 9 9 "> 10 <tal:Anauthorized condition="python:error_type == 'Unauthorized'"> 11 <metal:block use-macro="here/error_not_found/macros/not_found" /> 12 </tal:Anauthorized> 13 14 <tal:Anauthorized condition="python:error_type != 'Unauthorized'"> 10 15 <metal:body use-macro="here/main_template/macros/master"> 11 16 … … 53 58 </metal:main> 54 59 </metal:body> 60 </tal:Anauthorized> 55 61 </metal:html> -
WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
r1002 r1006 12 12 list Students for ClearanceOfficers 13 13 """ 14 14 15 request = REQUEST 15 16 wftool = context.portal_workflow … … 47 48 48 49 if what == 'student': 49 items_2 = context.portal_pins(student = term)50 50 items_1 = context.portal_pins(student = term.upper()) 51 items_2 = context.portal_pins(student = term.lower()) 51 52 items = items_1 + items_2 52 53 elif what == 'pin': … … 55 56 items = [] 56 57 l = [] 58 students_url = "%s/%s" % (context.portal_url(),'students') 59 pins = [] 57 60 for i in items: 58 61 item = {} … … 61 64 item['serial'] = i.serial 62 65 item['pin'] = i.pin 66 if i.pin in pins: 67 continue 68 pins.append(i.pins) 63 69 if len(sno)==10: 64 #if bd.prefix == "APP":65 70 #res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication') 66 71 res = context.students_catalog(jamb_reg_no=sno.upper()) 67 72 if len(res) > 0: 68 item['student_url'] = "%s/ %s" % (context.portal_url(),res[0].id)73 item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id) 69 74 item['student_id'] = res[0].id 70 75 else: 71 76 item['student_url'] = None 72 77 item['student_id'] = '' 78 elif sno: 79 item['student_url'] = '%s/campus/students/%s' % (students_url,item['student']) 80 item['student_id'] = student 73 81 else: 74 item['student_url'] = ' %s/%s' % (students_url,item['student'])75 item['student_id'] = student82 item['student_url'] = '' 83 item['student_id'] = "not used" 76 84 l.append(item) 77 85 -
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.