Changeset 603 for WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
- Timestamp:
- 1 Oct 2006, 10:21:09 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
r599 r603 22 22 info['wf_states'] = student_wf_states 23 23 info['wf_states'][0] = " ----- " 24 mtool = context.portal_membership25 member = mtool.getAuthenticatedMember()26 24 lt = context.portal_layouts 27 25 pr = context.portal_registration 28 26 path_info = request.get('PATH_INFO').split('/') 29 roles = member.getRoles() 30 is_manager = 'Manager' in roles or 'SectionManager' in roles 27 is_manager = context.isManager 31 28 validate = request.has_key("cpsdocument_edit_button") 32 29 items = [] 33 default = {'search_mode': 'name', 34 'review_state': ' admission_applied ',30 default = {'search_mode': 'name', 31 'review_state': 'created', 35 32 'search_string': '' 36 33 } 37 34 38 35 rend,psm,ds = lt.renderLayout(layout_id= 'student_search', 39 36 schema_id= 'student_search', … … 57 54 with_review = state != "all" 58 55 if not term and not with_review: 59 psm = "You must specify a search string when searching in 'All States'"56 psm = "You must specify a search string when searching 'all states'." 60 57 err = True 61 58 elif '*' in term: 62 59 psm = "you cannot use the '*' alone" 63 60 err = True 64 if err: 61 if err: 65 62 return context.students_manager_view(rendered = rend, 66 63 psm = psm, … … 73 70 res = [] 74 71 portal_type_query = {'query':['Student','StudentApplication','StudentPersonal']} 75 st_queries = ('jamb_ id','matric_no','name')72 st_queries = ('jamb_reg_no','matric_no','name') 76 73 onlyreview = with_review and not term 77 74 if onlyreview: … … 86 83 res = catalog(portal_type='Student', 87 84 id = term.strip()) 88 elif what in st_queries: 89 if what == "jamb_ id":85 elif what in st_queries: 86 if what == "jamb_reg_no": 90 87 pt = 'StudentApplication' 91 88 st = "%s*" % term.strip().lower() … … 102 99 except: 103 100 return context.students_manager_view(rendered = rend, 104 psm = 'Search string "%s" not allowed' % term,101 psm = 'Search string "%s" not allowed.' % term, 105 102 #psm = "%s, %s" % (psm,ds), 106 103 students = items, … … 117 114 is_manager = is_manager, 118 115 ) 119 116 120 117 if res: 121 118 for r in res:
Note: See TracChangeset for help on using the changeset viewer.