Changeset 1762 for WAeUP_SRP/trunk/skins
- Timestamp:
- 9 May 2007, 20:05:30 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py
r1761 r1762 20 20 return 'Not allowed' 21 21 22 23 total_new = context.students_catalog(session = '06') 22 entry_sessions = ('06') 24 23 25 24 new_states = ('admitted', … … 42 41 dict['id'] = 'All Faculties' 43 42 dict['title'] = 'All Faculties' 44 res = context.students_catalog(entry_session = '06')43 res = context.students_catalog(entry_session = entry_sessions) 45 44 dict['total'] = len(res) 46 45 for state in new_states: 47 res = context.students_catalog(entry_session = '06', review_state = state)46 res = context.students_catalog(entry_session = entry_sessions, review_state = state) 48 47 dict[state] = len(res) 49 statepercent = state+'_percent' 48 statepercent = state+'_percent' 50 49 if dict['total'] > 0: 51 50 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 52 51 else: 53 dict[statepercent] = 0 52 dict[statepercent] = 0 54 53 #fac_res['all'] = dict 55 54 l.append(dict) … … 59 58 dict['id'] = f.getId 60 59 dict['title'] = f.Title 61 res = context.students_catalog(entry_session = '06', faculty = f.getId)60 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId) 62 61 dict['total'] = len(res) 63 62 for state in new_states: 64 res = context.students_catalog(entry_session = '06', faculty = f.getId, review_state = state)63 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state) 65 64 dict[state] = len(res) 66 65 statepercent = state+'_percent' … … 68 67 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 69 68 else: 70 dict[statepercent] = 0 69 dict[statepercent] = 0 71 70 #fac_res[f.getId] = dict 72 71 l.append(dict) -
WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
r1571 r1762 1 ## Script (Python) "get RetStudentStatistics"1 ## Script (Python) "getNewStudentStatistics" 2 2 ##bind container=container 3 3 ##bind context=context … … 12 12 return Student Statistics 13 13 """ 14 14 15 import logging 15 16 logger = logging.getLogger('Skins.getRetStudentStatistics') 16 17 17 try:18 from Products.AdvancedQuery import Eq, Between, Le,In, Ge19 aq_portal = context.portal_catalog.evalAdvancedQuery20 aq_students = context.students_catalog.evalAdvancedQuery21 except:22 evalAdvancedQuery = None23 18 logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember()) 19 if not context.isStaff(): 20 return 'Not allowed' 21 22 entry_sessions = ('98','99','00','01','02','03','04','05') 23 24 new_states = ('returning', 25 'school_fee_paid', 26 'courses_registered', 27 'courses_validated', 28 ) 29 faculties = context.portal_catalog(portal_type="Faculty") 30 24 31 l = [] 25 if not context.isStaff():26 return l27 dep = {}28 dep['id'] = "All Faculties"29 32 30 33 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 fac_res = {} 34 35 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] 36 dict = {} 37 dict['id'] = 'All Faculties' 38 dict['title'] = 'All Faculties' 39 res = context.students_catalog(entry_session = entry_sessions) 40 dict['total'] = len(res) 41 for state in new_states: 42 res = context.students_catalog(entry_session = entry_sessions, review_state = state) 43 dict[state] = len(res) 44 statepercent = state+'_percent' 45 if dict['total'] > 0: 46 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 47 else: 48 dict[statepercent] = 0 49 #fac_res['all'] = dict 50 l.append(dict) 37 51 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] 41 42 l.append(dep) 43 sum_ret = 0 44 sum_sfp = 0 45 fs = context.portal_catalog(portal_type="Faculty") 46 for fid in [f.getId for f in fs]: 47 dep = {} 48 dep['id'] = fid 49 fquery = Eq('faculty',fid) 50 stud_res = aq_students(fquery) 51 stud_ids = [r.id for r in stud_res] 52 total = float(len(stud_res)) 53 if total == 0: 54 continue 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 62 l.append(dep) 63 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 52 for f in faculties: 53 dict = {} 54 dict['id'] = f.getId 55 dict['title'] = f.Title 56 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId) 57 dict['total'] = len(res) 58 for state in new_states: 59 res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state) 60 dict[state] = len(res) 61 statepercent = state+'_percent' 62 if dict['total'] > 0: 63 dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total']) 64 else: 65 dict[statepercent] = 0 66 #fac_res[f.getId] = dict 67 l.append(dict) 69 68 70 69 return l 71 70 71 -
WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt
r1582 r1762 18 18 <nobr><a href="statistics_ret_view">Returning Student Statistics</a> 19 19 </nobr> 20 <nobr><a href="statistics_reg_view">Registration Statistics</a>21 </nobr>22 20 <nobr><a href="list_students">Cleared Student Export</a> 23 21 </nobr> -
WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt
r1761 r1762 11 11 12 12 <strong> 13 <nobr><a href="s tatistics_new_view">New Student Statistics</a>14 </nobr> 13 <nobr><a href="search_students">Search Students</a> 14 </nobr> 15 15 <nobr><a href="statistics_ret_view">Returning Student Statistics</a> 16 </nobr>17 <nobr><a href="statistics_reg_view">Registration Statistics</a>18 </nobr>19 <nobr><a href="list_students">Cleared Student Export</a>20 16 </nobr> 21 17 </strong> -
WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt
r1621 r1762 1 1 <metal:body use-macro="here/main_template/macros/master"> 2 2 <metal:main fill-slot="main"> 3 <metal:block tal:define=" departments context/getRetStudentStatistics;3 <metal:block tal:define="faculties context/getRetStudentStatistics; 4 4 mtool here/portal_membership; 5 5 member mtool/getAuthenticatedMember;"> 6 6 7 <span tal:condition="not: departments">7 <span tal:condition="not: faculties"> 8 8 <span tal:content="here/illegal_view" /> 9 9 </span> 10 <span tal:condition=" departments">10 <span tal:condition="faculties"> 11 11 12 12 <strong> 13 <nobr><a href="search_students">Search Students</a> 14 </nobr> 13 15 <nobr><a href="statistics_new_view">New Student Statistics</a> 14 16 </nobr> 15 <nobr><a href="statistics_ret_view">Returning Student Statistics</a> 16 </nobr> 17 <nobr><a href="statistics_reg_view">Registration Statistics</a> 18 </nobr> 19 <nobr><a href="list_students">Cleared Student Export</a> 20 </nobr> 21 </strong> 17 </strong> 22 18 23 24 <h3>Returning Student Statistics</h3> 19 <h3>New Student Statistics</h3> 25 20 <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 students29 have logged in.30 <br /><br />31 21 <span tal:condition="not:isAnon"> 32 22 <table> 33 23 <tr class="odd ajaxtd"> 34 24 <th >Faculty</th> 25 <th align="right">Total</th> 35 26 <th align="right">RET</th> 36 <th align="right">SFP+</th> 27 <th align="right">SFP</th> 28 <th align="right">CR</th> 29 <th align="right">CV</th> 30 37 31 </tr> 38 <tr tal:define="d python:departments[0]" 39 class="even ajaxtd"> 40 <td width="80px">All Faculties</td> 32 <tr tal:repeat="d faculties" 33 tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')"> 34 <td width="80px"> <span tal:content="d/id" /> </td> 35 <td width="80px" align="right"> 36 <span tal:content="d/total" /> 37 </td> 41 38 <td width="80px" align="right"> 42 <span tal:content="d/ret" /> 43 </td> 39 <span tal:content="d/returning" /> 40 (<span tal:content="d/returning_percent" />%) 41 </td> 44 42 <td width="80px" align="right"> 45 <span tal:content="d/sfp" /> 46 </td> 47 </tr> 48 <tr tal:repeat="d python:departments[1:]" 49 tal:attributes="class python:test(repeat['d'].even(), 'odd ajaxtd', 'even ajaxtd')"> 50 <td width="80px"> <span tal:content="d/id" /> </td> 43 <span tal:content="d/school_fee_paid" /> 44 (<span tal:content="d/school_fee_paid_percent" />%) 45 </td> 51 46 <td width="80px" align="right"> 52 <span tal:content="d/ret" /> 53 </td> 47 <span tal:content="d/courses_registered" /> 48 (<span tal:content="d/courses_registered_percent" />%) 49 </td> 54 50 <td width="80px" align="right"> 55 <span tal:content="d/sfp" /> 56 </td> 51 <span tal:content="d/courses_validated" /> 52 (<span tal:content="d/courses_validated_percent" />%) 53 </td> 54 57 55 </tr> 58 56 </table> 59 57 <br /> 60 58 <table> 61 <tr><td>RET:</td> <td>Returning students who have logged in</td></tr> 62 <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr> 63 </table> 59 <tr><td>RET: </td> <td>Returning</td></tr> 60 <tr><td>SFP: </td> <td>School fee paid</td></tr> 61 <tr><td>CR: </td> <td>Course list registered</td></tr> 62 <tr><td>CV: </td> <td>Course list validated</td></tr> 63 </table> 64 64 </span> 65 65 </span>
Note: See TracChangeset for help on using the changeset viewer.