- Timestamp:
- 12 Dec 2006, 11:05:00 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/profiles/default/vocabularies/student_search_mode.xml
r805 r1033 9 9 <item key="matric_no" msgid="">Matriculation No</item> 10 10 <item key="jamb_reg_no" msgid="">Jamb Registration No</item> 11 <item key="department" msgid="">Department (complete ids only)</item> 11 12 </object> -
WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py
r875 r1033 21 21 return voc.get(key) 22 22 if "ClearanceOfficers" in member.getGroups(): 23 return [item for item in voc.items() if item[0].startswith('clear')] 23 return [item for item in voc.items() if item[0].startswith('clear') or 24 item[0] in ("all",)] 24 25 return voc.items() 25 26 -
WAeUP_SRP/trunk/skins/waeup_student/search_students.py
r1011 r1033 13 13 """ 14 14 request = REQUEST 15 form = request.form 16 fget = form.get 15 17 wftool = context.portal_workflow 16 18 mtool = context.portal_membership 17 19 member = mtool.getAuthenticatedMember() 18 20 roles = member.getRolesInContext(context) 21 students_folder = context.portal_url.getPortalObject().campus.students 19 22 try: 20 23 from Products.AdvancedQuery import Eq, Between, Le,In … … 28 31 return -1 29 32 30 request = context.REQUEST31 form = request.form32 fget = form.get33 33 student_subobjects = ("StudentApplication", 34 34 "StudentPersonal", … … 82 82 with_review = state != "all" 83 83 only_review = with_review and not term 84 ##with_level_results = state.startswith("category") or\85 ## state in ('content_addable',) and\86 ## evalAdvancedQuery is not None87 84 bools = "with_review = %s<br\> only_review = %s<br\>" % (with_review,only_review) 88 85 if not term and not with_review: … … 109 106 if what == "student_id": 110 107 query_step = 1 111 query = Eq('portal_type','Student') & Eq('id', term.strip()) 108 if hasattr(students_folder,term.strip()): 109 request.RESPONSE.redirect("%s/%s" % (students_folder.absolute_url(),term)) 110 return context.search_students_form(rendered = rend, 111 psm = "No student found!", 112 students = [], 113 allowed = True, 114 ) 112 115 elif what in st_queries: 113 116 if what == "jamb_reg_no": … … 124 127 st = "%s" % term.strip() 125 128 query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip()) 126 res = evalAdvancedQuery(query) 127 if with_review: 128 query_step += 10 129 review_res = evalAdvancedQuery(In('portal_type',student_objects) & Eq('review_state',state)) 130 search_set = [] 131 if res: 132 for r in res: 133 pl = r.getPath().split('/') 134 search_set.append(pl[pl.index('students') + 1]) 135 review_set = [] 136 if review_res: 137 for r in review_res: 138 pl = r.getPath().split('/') 139 review_set.append(pl[pl.index('students') + 1]) 129 res = evalAdvancedQuery(query) 130 if with_review: 131 query_step += 10 132 review_res = evalAdvancedQuery(In('portal_type',student_objects) & Eq('review_state',state)) 133 search_set = [] 134 if res: 135 for r in res: 136 pl = r.getPath().split('/') 137 search_set.append(pl[pl.index('students') + 1]) 138 review_set = [] 139 if review_res: 140 for r in review_res: 141 pl = r.getPath().split('/') 142 review_set.append(pl[pl.index('students') + 1]) 143 elif what == "department": 144 res = context.students_catalog(department=term.strip()) 145 search_set = [r.id for r in res] 140 146 all = [] 141 147 if only_review: … … 147 153 else: 148 154 all = search_set 149 for a in all[:100 ]:155 for a in all[:1000]: 150 156 if a in items: 151 157 continue
Note: See TracChangeset for help on using the changeset viewer.