Changeset 15918 for main/waeup.kofa/trunk
- Timestamp:
- 13 Jan 2020, 13:06:54 (5 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r15880 r15918 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Add `session_level`filter to `StudentStudyLevelExporter`. 6 8 7 9 * Add LetterPDFCreator utility and use this pdf creator -
main/waeup.kofa/trunk/docs/source/userdocs/datacenter/export.rst
r15873 r15918 222 222 223 223 Student Outstanding Courses Exporter 224 ---------------------- 224 ------------------------------------ 225 225 226 226 .. autoclass:: waeup.kofa.students.export.StudentOutstandingCoursesExporter() -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r15664 r15918 50 50 def setup_container(self, container): 51 51 # set all attributes of a container 52 container.code = u'dp201 5'52 container.code = u'dp2017' 53 53 container.title = u'General Studies' 54 54 container.prefix = list(ApplicationTypeSource()(container))[0] 55 container.year = 201 555 container.year = 2017 56 56 container.application_category = list(AppCatSource()(container))[0] 57 57 container.description = u'Some Description\nwith linebreak\n' 58 58 container.description += u'<<de>>man spriht deutsh' 59 59 container.startdate = datetime.datetime( 60 201 5, 1, 1, 12, 0, 0, tzinfo=pytz.utc)60 2017, 1, 1, 12, 0, 0, tzinfo=pytz.utc) 61 61 container.enddate = datetime.datetime( 62 201 5, 1, 31, 23, 0, 0, tzinfo=pytz.utc)62 2017, 1, 31, 23, 0, 0, tzinfo=pytz.utc) 63 63 return container 64 64 … … 76 76 'strict_deadline,title,with_picture,year\r\n' 77 77 78 'basic,0.0,,dp201 5,'78 'basic,0.0,,dp2017,' 79 79 '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",' 80 '201 5-01-31 23:00:00+00:00#,0,,app,2015-01-01 12:00:00+00:00#,1,'81 'General Studies,1,201 5\r\n'80 '2017-01-31 23:00:00+00:00#,0,,app,2017-01-01 12:00:00+00:00#,1,' 81 'General Studies,1,2017\r\n' 82 82 ) 83 83 return -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r15609 r15918 449 449 'zope.mgr - students.browser.DatacenterExportJobContainerJobConfig ' 450 450 '- exported: students ' 451 '(None, None, None, None, None, None, , , all, all, all, all ), '451 '(None, None, None, None, None, None, , , all, all, all, all, all), ' 452 452 'job_id=%s' 453 453 % job_id in logcontent) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15880 r15918 3959 3959 payments_start=None, payments_end=None, ct_level=None, 3960 3960 ct_session=None, ct_semester=None, paycat=None, 3961 paysession=None, exporter=None):3961 paysession=None, level_session=None, exporter=None): 3962 3962 self._set_session_values() 3963 3963 self._set_level_values() … … 4003 4003 ct_session = ct_session, 4004 4004 ct_semester = ct_semester, 4005 level_session=level_session, 4005 4006 ) 4006 4007 else: … … 4019 4020 ct_level = ct_level, 4020 4021 ct_session = ct_session, 4021 ct_semester = ct_semester,) 4022 ct_semester = ct_semester, 4023 level_session=level_session,) 4022 4024 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 4023 4025 self.context.logger.info( 4024 '%s - exported: %s (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ), job_id=%s'4026 '%s - exported: %s (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), job_id=%s' 4025 4027 % (ob_class, exporter, session, level, mode, self.faccode, 4026 4028 self.depcode, self.certcode, payments_start, payments_end, 4027 ct_level, ct_session, paycat, paysession, job_id))4029 ct_level, ct_session, paycat, paysession, level_session, job_id)) 4028 4030 self.flash(_('Export started for students with') + 4029 4031 ' current_session=%s, current_level=%s, study_mode=%s' % ( -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt
r15546 r15918 95 95 </span> 96 96 97 <span id="level_session" style="display: none;"> 98 <br /> 99 <label for="level_session" i18n:translate=""> 100 Level Session 101 </label> 102 <select name="level_session" class="form-control half"> 103 <option tal:repeat="item view/sessions" 104 tal:attributes="value python:item[1]"> 105 <span tal:replace="python: item[0]">2018/2019</span> 106 </option> 107 </select> 108 <br /> 109 </span> 110 97 111 <span id="ct_data" style="display: none;"> 98 112 <br /> … … 144 158 document.getElementById('payment_dates').style.display = 'block'; 145 159 document.getElementById('paycat').style.display = 'block'; 160 document.getElementById('paysession').style.display = 'block'; 146 161 document.getElementById('ct_data').style.display = 'none'; 147 document.getElementById(' paysession').style.display = 'block';162 document.getElementById('level_session').style.display = 'none'; 148 163 149 164 } else if (document.getElementById('exporter').value == 'coursetickets') { … … 152 167 document.getElementById('paycat').style.display = 'none'; 153 168 document.getElementById('paysession').style.display = 'none'; 169 document.getElementById('level_session').style.display = 'none'; 170 171 } else if (document.getElementById('exporter').value == 'studentstudylevels') { 172 document.getElementById('ct_data').style.display = 'none'; 173 document.getElementById('payment_dates').style.display = 'none'; 174 document.getElementById('paycat').style.display = 'none'; 175 document.getElementById('paysession').style.display = 'none'; 176 document.getElementById('level_session').style.display = 'block'; 154 177 155 178 } else { … … 158 181 document.getElementById('paycat').style.display = 'none'; 159 182 document.getElementById('paysession').style.display = 'none'; 183 document.getElementById('level_session').style.display = 'none'; 160 184 } 161 185 } -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r15873 r15918 46 46 if x is not None] 47 47 48 def get_levels(students ):48 def get_levels(students, **kw): 49 49 """Get all studylevels of `students`. 50 50 """ 51 51 levels = [] 52 level_session = kw.get('level_session', None) 52 53 for course in get_studycourses(students): 53 54 for level in course.values(): 55 if level_session not in ('all', None) and \ 56 int(level_session) != level.level_session: 57 continue 54 58 levels.append(level) 55 59 return levels … … 73 77 ct_semester = kw.get('ct_semester', None) 74 78 if code is None: 75 for level_obj in get_levels(students ):79 for level_obj in get_levels(students, **kw): 76 80 for ticket in level_obj.values(): 77 81 if ct_level not in ('all', None): … … 90 94 tickets.append(ticket) 91 95 else: 92 for level_obj in get_levels(students ):96 for level_obj in get_levels(students, **kw): 93 97 for ticket in level_obj.values(): 94 98 if ticket.code != code: … … 116 120 level_session = kw.get('session', None) 117 121 level = kw.get('level', None) 118 for level_obj in get_levels(students ):122 for level_obj in get_levels(students, **kw): 119 123 for ticket in level_obj.values(): 120 124 if ticket.code != code: … … 253 257 except KeyError: 254 258 pass 259 # Studylevels can be filtered by level_session. 260 # This parameter is not a key of the catalog and must thus be 261 # removed from kw. 262 try: 263 del kw['level_session'] 264 except KeyError: 265 pass 255 266 query = StudentsQuery(**kw) 256 267 return query.query() … … 378 389 379 390 def filter_func(self, x, **kw): 380 return get_levels(x )391 return get_levels(x, **kw) 381 392 382 393 def mangle_value(self, value, name, context=None): … … 705 716 paycatyears = [] 706 717 if cas: 707 year_range = range(cas -2, cas+1)718 year_range = range(cas-2, cas+1) 708 719 year_range_tuple = tuple([str(year)[2:] for year in year_range]) 709 720 paycatyears = [ -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15709 r15918 3760 3760 'zope.mgr - students.browser.DatacenterExportJobContainerJobConfig ' 3761 3761 '- exported: bursary (2004, 100, ug_ft, None, None, None, ' 3762 '13/12/2012, 14/12/2012, all, all, all, all ), job_id=%s'3762 '13/12/2012, 14/12/2012, all, all, all, all, all), job_id=%s' 3763 3763 % job_id in logcontent 3764 3764 ) … … 3843 3843 self.browser.headers['content-disposition']) 3844 3844 self.assertTrue( 3845 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100, 2013,'3845 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100,%s,' 3846 3846 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 3847 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 3847 'Tester,created,2004,2004,,fac1,dep1,CERT1' 3848 %(curr_year-6) in self.browser.contents) 3848 3849 self.assertEqual(len(self.app['datacenter'].running_exports), 1) 3849 3850 job_id = self.app['datacenter'].running_exports[0][0] … … 3859 3860 'zope.mgr - students.browser.FacultiesExportJobContainerJobConfig ' 3860 3861 '- exported: bursary (2004, 100, ug_ft, None, None, None, ' 3861 '13/12/2012, 14/12/2012, all, all, schoolfee, all ), job_id=%s'3862 '13/12/2012, 14/12/2012, all, all, schoolfee, all, all), job_id=%s' 3862 3863 % job_id in logcontent 3863 3864 ) … … 3889 3890 self.browser.headers['content-disposition']) 3890 3891 self.assertTrue( 3891 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100, 2013,'3892 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100,%s,' 3892 3893 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 3893 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 3894 'Tester,created,2004,2004,,fac1,dep1,CERT1' 3895 %(curr_year-6) in self.browser.contents) 3894 3896 3895 3897 def test_faculty_export(self): … … 3941 3943 'zope.mgr - students.browser.FacultyExportJobContainerJobConfig ' 3942 3944 '- exported: students (2004, 100, ug_ft, fac1, None, None, ' 3943 '13/12/2012, 14/12/2012, all, all, all, all ), job_id=%s'3945 '13/12/2012, 14/12/2012, all, all, all, all, all), job_id=%s' 3944 3946 % job_id in logcontent 3945 3947 ) … … 4000 4002 'zope.mgr - students.browser.DepartmentExportJobContainerJobConfig ' 4001 4003 '- exported: students (2004, 100, ug_ft, None, dep1, None, ' 4002 '13/12/2012, 14/12/2012, all, all, all, all ), job_id=%s'4004 '13/12/2012, 14/12/2012, all, all, all, all, all), job_id=%s' 4003 4005 % job_id in logcontent 4004 4006 ) … … 4047 4049 'zope.mgr - students.browser.CertificateExportJobContainerJobConfig ' 4048 4050 '- exported: students ' 4049 '(2004, 100, None, None, None, CERT1, , , None, None, None, None), ' 4051 '(2004, 100, None, None, None, CERT1, , , None, None, ' 4052 'None, None, None), ' 4050 4053 'job_id=%s' 4051 4054 % job_id in logcontent … … 4246 4249 self.browser.headers['content-disposition']) 4247 4250 self.assertTrue( 4248 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100, 2013,'4251 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100,%s,' 4249 4252 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 4250 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 4253 'Tester,created,2004,2004,,fac1,dep1,CERT1' 4254 %(curr_year-6) in self.browser.contents) 4251 4255 # ... and discarded 4252 4256 self.browser.open('http://localhost/app/faculties/exports') … … 4272 4276 self.browser.headers['content-disposition']) 4273 4277 self.assertTrue( 4274 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100, 2013,'4278 '666,12.12,2012-12-13 00:00:00#,schoolfee,[],1,my-id,p-item,100,%s,' 4275 4279 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 4276 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 4280 'Tester,created,2004,2004,,fac1,dep1,CERT1' 4281 %(curr_year-6) in self.browser.contents) 4277 4282 4278 4283 def test_export_accommodation_officers(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15873 r15918 1365 1365 super(SessionPaymentsOverviewExporterTest, self).setUp() 1366 1366 self.setup_for_export() 1367 paycats = ('schoolfee', 'clearance', 'gown', 'transcript') 1368 paycatyears = '' 1367 1369 grok.getSite()['configuration'].current_academic_session = curr_year - 4 1370 year_range = range(curr_year-6, curr_year-3) 1371 year_range_tuple = tuple([str(year)[2:] for year in year_range]) 1372 for cat in paycats: 1373 for year in year_range_tuple: 1374 paycatyears += '%s,'%(cat+str(year)) 1375 self.paycatyears = paycatyears.strip(',') 1368 1376 return 1369 1377 … … 1389 1397 'student_id,matric_number,display_fullname,state,certcode,' 1390 1398 'faccode,depcode,is_postgrad,current_level,current_session,' 1391 'current_mode,entry_session,reg_number,schoolfee13,' 1392 'schoolfee14,schoolfee15,clearance13,clearance14,clearance15,' 1393 'gown13,gown14,gown15,transcript13,transcript14,transcript15\r\n' 1399 'current_mode,entry_session,reg_number,%s\r\n' 1394 1400 'A111111,234,Anna M. Tester,created,CERT1,NA,NA,0,200,' 1395 1401 '2012,ug_ft,2010,123,' 1396 '12.12,,,,,,,,,,,\r\n' in result1402 '12.12,,,,,,,,,,,\r\n' %self.paycatyears in result 1397 1403 ) 1398 1404 return … … 1431 1437 'student_id,matric_number,display_fullname,state,certcode,faccode,' 1432 1438 'depcode,is_postgrad,current_level,current_session,' 1433 'current_mode,entry_session,reg_number,' 1434 'schoolfee13,schoolfee14,schoolfee15,' 1435 'clearance13,clearance14,clearance15,' 1436 'gown13,gown14,gown15,' 1437 'transcript13,transcript14,transcript15\r\n' 1439 'current_mode,entry_session,reg_number,%s\r\n' 1438 1440 'A111111,234,Anna M. Tester,created,CERT1,NA,NA,0,200,2012,ug_ft,' 1439 1441 '2010,123,' 1440 1442 '12.12,14.14,1.01,,,,,,,,,\r\n' 1441 in result1443 %self.paycatyears in result 1442 1444 ) 1443 1445 return
Note: See TracChangeset for help on using the changeset viewer.