- Timestamp:
- 15 Mar 2007, 16:44:41 (18 years ago)
- Location:
- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_result_delete.py
r1482 r1558 18 18 ret_url = here.absolute_url() 19 19 20 message = '' 20 21 if ids: 21 here.manage_delObjects(ids) 22 message = 'portal_status_message=psm_item(s)_deleted' 22 real_ids = [] 23 for id in ids: 24 if context.hasObject(id): 25 real_ids.append(id) 26 if real_ids: 27 context.manage_delObjects(real_ids) 28 message = 'portal_status_message=psm_item(s)_deleted' 23 29 else: 24 30 message = 'portal_status_message=psm_select_at_least_one_document' -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/create_level.py
r1513 r1558 41 41 elif in_progress == 'started': 42 42 return 43 44 if context.hasObject(current_level): 45 return 46 level = getattr(context,current_level) 47 return response.redirect("%s" % level.absolute_url()) 48 43 49 context.invokeFactory('StudentStudyLevel',"%s" % current_level) 44 50 level = getattr(context,"%s" % current_level) … … 101 107 session.set('in_progress','finished') 102 108 return 103 return response.redirect("%s" % level.absolute_url()) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRetStudentStatistics.py
r1536 r1558 13 13 """ 14 14 import logging 15 logger = logging.getLogger('S tudent.Statistics')15 logger = logging.getLogger('Skins.getRetStudentStatistics') 16 16 17 17 try: … … 21 21 except: 22 22 evalAdvancedQuery = None 23 logger.info(' "%s","invoked returning statistics"' % context.portal_membership.getAuthenticatedMember())23 logger.info('%s invoked returning statistics' % context.portal_membership.getAuthenticatedMember()) 24 24 l = [] 25 25 if not context.isStaff(): 26 26 return l 27 27 dep = {} 28 sum = 029 28 dep['id'] = "All Faculties" 30 29 31 #from Products.zdb import set_trace;set_trace()32 30 33 ret_res = context.portal_catalog(review_state ='returning') 34 ret_ids = [r.getId for r in ret_res] 35 ret = len(ret_res) 36 dep['total'] = ret 31 ret_res1 = context.portal_catalog(review_state = 'returning') 32 ret_ids1 = [r.getId for r in ret_res1] 33 total_ret = len(ret_ids1) 34 35 ret_res2 = context.portal_catalog(review_state = ('school_fee_paid','courses_registered','courses_validated',)) 36 ret_ids2 = [r.getId for r in ret_res2] 37 38 retquery = Ge('level','300') | (Eq('level','200') & Eq('entry_mode','UME')) 39 ret_res3 = aq_students(retquery) 40 ret_ids3 = [r.id for r in ret_res3] 37 41 38 42 l.append(dep) 43 sum_ret = 0 44 sum_sfp = 0 39 45 fs = context.portal_catalog(portal_type="Faculty") 40 46 for fid in [f.getId for f in fs]: … … 45 51 stud_ids = [r.id for r in stud_res] 46 52 total = float(len(stud_res)) 47 48 53 if total == 0: 49 54 continue 50 51 ret = len([s for s in stud_ids if s in ret_ids]) 52 dep['returned'] = ret 53 sum += ret 54 55 if ret == 0: 56 continue 57 55 sfp = len([s for s in stud_ids if s in ret_ids2 and s in ret_ids3]) 56 dep['sfp'] = sfp 57 ret = len([s for s in stud_ids if s in ret_ids1]) 58 dep['ret'] = ret 59 sum_ret += ret 60 sum_sfp += sfp 61 58 62 l.append(dep) 59 63 60 l[0]['sum'] = sum 64 l[0]['ret'] = sum_ret 65 l[0]['sfp'] = sum_sfp 66 l[0]['total_ret'] = total_ret + sum_sfp 67 l[0]['total_li'] = sum_ret + sum_sfp 68 61 69 62 70 return l -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/get_searchable_student_states.py
r1033 r1558 23 23 return [item for item in voc.items() if item[0].startswith('clear') or 24 24 item[0] in ("all",)] 25 elif "CourseAdvisers" in member.getGroups(): 26 return [item for item in voc.items() if item[0].startswith('courses') or 27 item[0] in ("all",)] 25 28 return voc.items() 26 29 -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students.py
r1500 r1558 61 61 user_info['faculties'] = [] 62 62 co_view = False 63 ca_view = False 63 64 faculties = fget('faculties') 64 65 departments = fget('departments') 65 dep_str = fac_str = '' 66 certificate_level = fget('certificate_level') 67 dep_str = fac_str = certificate_level_str = '' 66 68 if "ClearanceOfficers" in member.getGroups(): 67 69 state = "clearance_requested" … … 93 95 user_info['departments'] = departments 94 96 dep_str = " ".join(departments) 97 elif "CourseAdvisers" in member.getGroups(): 98 state = "courses_registered" 99 only_review = False 100 ca_view = True 101 if certificate_level: 102 #from Products.zdb import set_trace;set_trace() 103 certificate_level_str = certificate_level 104 certificate_level = certificate_level.split() 105 else: 106 query = In('portal_type',('StudyLevel',)) &\ 107 In('localUsersWithRoles', ("user:%s" % member,)) 108 res = evalAdvancedQuery(query) 109 certificate_level = [] 110 if res: 111 certificate_level = ['/'.join(f.getPath().split('/')[-2:]) for f in res] 112 user_info['certificate_level'] = certificate_level 113 certificate_level_str = " ".join(certificate_level) 95 114 default = {'search_mode': 'student_id', 96 115 'review_state': state, … … 106 125 faculties = fac_str, 107 126 departments = dep_str, 127 certificate_level = certificate_level_str, 108 128 commit = False, 109 129 ) … … 200 220 end = DateTime().timeTime() 201 221 logger.info('"%s","searchtime","%6.2f"' % (member,end-start)) 222 elif ca_view: 223 only_review = False 224 with_review = True 225 if with_timer: 226 start = DateTime().timeTime() 227 logger.info('"%s","start 200"' % member) 228 courses = [cl.split('/')[0] for cl in certificate_level] 229 levels = [cl.split('/')[1] for cl in certificate_level] 230 query = In('course',courses) & In('level',levels) 231 res = aq_students(query) 232 if with_timer: 233 end = DateTime().timeTime() 234 logger.info('"%s","searchtime","%6.2f"' % (member,end-start)) 235 start = DateTime().timeTime() 236 search_set = [r.id for r in res] 237 if with_timer: 238 end = DateTime().timeTime() 239 logger.info('"%s","searchtime","%6.2f"' % (member,end-start)) 202 240 if with_timer: 203 241 logger.info('"%s","start 300"' % member) -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students_form.pt
r1531 r1558 35 35 </span> 36 36 </strong> 37 38 39 37 <h3> Search Student Section</h3><br /> 40 38 You are logged in as member <span tal:replace="info/member|nothing" /> … … 45 43 <span tal:condition="info/departments|nothing" tal:omit-tag=""> 46 44 and <span tal:repeat="department info/departments|nothing" tal:content="department"/></span>. 45 <span tal:condition="info/certificate_level|nothing" tal:omit-tag=""> 46 who is CourseAdviser for 47 <span tal:repeat="cl info/certificate_level" tal:content="cl" /> 48 </span> 47 49 <br /><br /> 48 50 <span tal:replace="structure rendered" /> -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_ret_view.pt
r1532 r1558 24 24 <h3>Returning Student Statistics</h3> 25 25 <br /> 26 <span tal:content="python:departments[0]['total_ret']" /> 27 returning student records have been imported. 28 <span tal:content="python:departments[0]['total_li']" /> returning students 29 have logged in. 30 <br /><br /> 26 31 <span tal:condition="not:isAnon"> 27 32 <table> 28 33 <tr class="odd ajaxtd"> 29 34 <th >Faculty</th> 30 <th align="right">Returning</th> 35 <th align="right">RET</th> 36 <th align="right">SFP</th> 31 37 </tr> 32 38 <tr tal:define="d python:departments[0]" … … 34 40 <td width="80px">All Faculties</td> 35 41 <td width="80px" align="right"> 36 <span tal:content="d/sum" /> of <span tal:content="d/total" /> 42 <span tal:content="d/ret" /> 43 </td> 44 <td width="80px" align="right"> 45 <span tal:content="d/sfp" /> 37 46 </td> 38 47 </tr> … … 41 50 <td width="80px"> <span tal:content="d/id" /> </td> 42 51 <td width="80px" align="right"> 43 <span tal:content="d/returned " /> 44 </td> 52 <span tal:content="d/ret" /> 53 </td> 54 <td width="80px" align="right"> 55 <span tal:content="d/sfp" /> 56 </td> 45 57 </tr> 46 58 </table> 47 59 <br /> 60 <table> 61 <tr><td>RET:</td> <td>Returning students who only logged in</td></tr> 62 <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr> 63 </table> 48 64 </span> 49 65 </span> -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/students_index.py
r1239 r1558 23 23 students_url = "%s/campus/students" % (context.portal_url()) 24 24 25 if "ClearanceOfficers" in member.getGroups(): 25 if "ClearanceOfficers" in member.getGroups() or\ 26 "CourseAdvisers" in member.getGroups(): 26 27 return redirect("%s/search_students" % context.portal_url()) 27 28 if context.isSectionOfficer(): -
WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt
r1519 r1558 63 63 <h4>Session Courses</h4> 64 64 <br /> 65 <table class="contentListing" width="100%" summary="content layout" id="folder_content"> 65 <div class="" tal:condition="not: info/normal"> 66 Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty! 67 </div> 68 <table class="contentListing" width="100%" id="folder_content" 69 tal:condition="info/normal"> 66 70 <tr tal:repeat="row info/normal" 67 71 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> … … 106 110 /> 107 111 <br /><br /> 108 <input type="submit" name="register_courses:method" 112 <input tal:condition="info/normal" 113 type="submit" name="register_courses:method" 109 114 class="context" value="Submit" /> 110 115 </td>
Note: See TracChangeset for help on using the changeset viewer.