Changeset 14514 for main/waeup.kofa/trunk
- Timestamp:
- 8 Feb 2017, 07:39:08 (8 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r14507 r14514 4 4 1.4.2.dev0 (unreleased) 5 5 ======================= 6 7 * Add `entry_session` and `p_session` filter to Student Payment Statistics 8 generator. Adjust reports: Change footer and filename formats. 9 10 * Add officer name fields do `IDepartment` and `IFaculty`. 11 Plugins must be updated! 6 12 7 13 * Add serial number column to Session Results Presentations. … … 90 96 (`process`). 91 97 92 * Add `DegreeSource` and `degree` field to ` Certificate`.98 * Add `DegreeSource` and `degree` field to `ICertificate`. 93 99 Plugins must be updated! 94 100 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r14504 r14514 146 146 # Underline mandatory (core) courses 147 147 failed_courses = Paragraph( 148 line[5].replace('m_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE) 148 line[5].replace( 149 'm_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE) 149 150 line = line[:5] + (failed_courses,) + line[6:] 150 151 # Superscript in remarks (needed by AAUE) 151 152 remark = Paragraph( 152 line[10].replace('s_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE) 153 line[10].replace( 154 's_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE) 153 155 line = line[:10] + (remark,) 154 156 line = (sn,) + line … … 233 235 pdf_data += [Paragraph( 234 236 translate( 235 '${a}<br />${b}<br />${c}<br /><br />Session: ${d}<br />Level: ${e}', 237 '${a}<br />${b}<br />${c}<br />' 238 'Session: ${d}<br />Level: ${e}', 236 239 mapping = {'a':self.certtitle, 237 240 'b':self.deptitle, … … 248 251 pdf_data.append(Spacer(1, 40)) 249 252 if self.signatures: 250 signaturetables = get_signature_tables(self.signatures, landscape=True) 253 signaturetables = get_signature_tables( 254 self.signatures, landscape=True) 251 255 pdf_data.append(signaturetables[0]) 252 256 253 257 pdf = creator.create_pdf( 254 258 pdf_data, None, doc_title, self.author, 255 doc_title + ' - %s/%s/%s - %s - %s -' % ( 256 self.faccode, self.depcode, self.certcode, 257 self.levelcode, self.sessioncode), 259 doc_title + ' - %s -' % self.session, 258 260 note = self.note 259 261 ) … … 329 331 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 330 332 grok.getSite().logger.info( 331 '%s - report %s created: %s (faculty=%s, department=%s, certificate=%s, session=%s, level=%s)' % ( 333 '%s - report %s created: %s ' 334 '(faculty=%s, department=%s, certificate=%s, ' 335 'session=%s, level=%s)' % ( 332 336 ob_class, job_id, self.context.title, faccode, depcode, 333 337 certcode, session, level)) … … 384 388 385 389 def _filename(self): 386 return 'LevelReport_%s_%s_%s_%s_%s_%s.pdf' % ( 387 self.context.faccode, self.context.depcode, self.context.certcode, 388 self.context.sessioncode, self.context.levelcode, 390 return 'LevelReport_rno%s_%s.pdf' % ( 391 self.context.__name__, 389 392 self.context.creation_dt_string) 390 393 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py
r14505 r14514 214 214 self.course_codes[level] = course_codes 215 215 self.data[level] = get_students( 216 faccode, depcode, certcode, session, self.levelcode, course_codes) 216 faccode, depcode, certcode, session, 217 self.levelcode, course_codes) 217 218 218 219 def create_pdf(self, job_id): … … 229 230 pdf_data += [Paragraph( 230 231 translate( 231 '${a}<br />${b}<br />${c}<br /><br />Session: ${d}<br />Level: ${e}', 232 '${a}<br />${b}<br />${c}<br />' 233 'Session: ${d}<br />Level: ${e}', 232 234 mapping = {'a':self.certtitle, 233 235 'b':self.deptitle, … … 256 258 pdf = creator.create_pdf( 257 259 pdf_data, None, doc_title, self.author, 258 doc_title + ' - %s/%s/%s - %s - %s -' % ( 259 self.faccode, self.depcode, self.certcode, 260 self.levelcode, self.sessioncode), 260 doc_title + ' - %s -' % self.session, 261 261 note=self.note 262 262 ) … … 299 299 300 300 def _filename(self): 301 return 'RawScoreReport_%s_%s_%s_%s_%s_%s.pdf' % ( 302 self.context.faccode, self.context.depcode, self.context.certcode, 303 self.context.sessioncode, self.context.levelcode, 301 return 'RawScoreReport_rno%s_%s.pdf' % ( 302 self.context.__name__, 304 303 self.context.creation_dt_string) 305 304 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
r14510 r14514 183 183 pdf_data += [Paragraph( 184 184 translate( 185 '${a}<br />${b}<br />${c}<br />Session: ${d}<br />Level: ${e}', 185 '${a}<br />${b}<br />${c}<br />Session: ${d}<br />' 186 'Level: ${e}', 186 187 mapping = {'a':self.certtitle, 187 188 'b':self.deptitle, … … 241 242 pdf = creator.create_pdf( 242 243 pdf_data, None, doc_title, self.author, 243 doc_title + ' - %s/%s/%s - %s - %s -' % ( 244 self.faccode, self.depcode, self.certcode, 245 self.levelcode, self.sessioncode), 244 doc_title + ' - %s -' % self.session, 246 245 note = self.note 247 246 ) … … 294 293 295 294 def _filename(self): 296 return 'SessionResultsPresentation_%s_%s_%s_%s_%s_%s.pdf' % ( 297 self.context.faccode, self.context.depcode, self.context.certcode, 298 self.context.sessioncode, self.context.levelcode, 295 return 'SessionResultsPresentation_rno%s_%s.pdf' % ( 296 self.context.__name__, 299 297 self.context.creation_dt_string) 300 298 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py
r14512 r14514 148 148 super(StudentStatisticsReport, self).__init__( 149 149 args=[session, mode, breakdown], kwargs={'author':author}) 150 self.sessioncode = session 151 self.levelcode = level 150 152 self.studylevelsource = StudyLevelSource().factory 151 153 self.portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE … … 153 155 self.mode = mode 154 156 if level == 0: 155 self.level = ' '157 self.level = 'All levels' 156 158 else: 157 self.level = translate(self.studylevelsource.getTitle(None, int(level)), 159 self.level = translate( 160 self.studylevelsource.getTitle(None, int(level)), 158 161 'waeup.kofa', target_language=self.portal_language) 159 162 self.breakdown = breakdown … … 171 174 STYLE["Normal"]), 172 175 Spacer(1, 12),] 176 pdf_data += [Paragraph( 177 translate( 178 'Study Mode: ${a}<br />' 179 'Academic Session: ${b}<br />Level: ${c}<br />', 180 mapping = {'a':self.mode, 181 'b':self.session, 182 'c':self.level, 183 }), 184 STYLE["Normal"]), 185 Spacer(1, 12),] 173 186 pdf_data += [ 174 187 Table(table_data, style=TABLE_STYLE, colWidths=col_widths)] 175 if not self.level: 176 doc_title = translate( 177 _('${a} Students - ${b}', 178 mapping = {'a':self.mode, 'b':self.session})) 179 pdf = creator.create_pdf( 180 pdf_data, None, doc_title, self.author, doc_title + '-' 181 ) 182 else: 183 doc_title = translate( 184 _('${a} Students - ${b} - ${c}', 185 mapping = {'a':self.mode, 'b': self.level, 'c':self.session})) 186 pdf = creator.create_pdf( 187 pdf_data, None, doc_title, self.author, doc_title + '-' 188 ) 188 doc_title = translate(_('Student Statistics')) 189 right_footer = translate( 190 _('${a} Students - ${b} -', 191 mapping = {'a':self.mode, 'b':self.session})) 192 pdf = creator.create_pdf( 193 pdf_data, None, doc_title, self.author, right_footer 194 ) 189 195 return pdf 190 196 … … 249 255 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 250 256 grok.getSite().logger.info( 251 '%s - report %s created: %s (session=%s, mode=%s, level=%s, breakdown=%s)' % ( 257 '%s - report %s created: %s ' 258 '(session=%s, mode=%s, level=%s, breakdown=%s)' % ( 252 259 ob_class, job_id, self.context.title, 253 260 session, mode, level, breakdown)) … … 269 276 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 270 277 studylevelsource = StudyLevelSource().factory 271 self.levels = [(u'All levels', 0)]278 self.levels = [(u'All', 0)] 272 279 for code in studylevelsource.getValues(None): 273 280 title = translate(studylevelsource.getTitle(None, code), … … 288 295 289 296 def _filename(self): 290 return 'StudentStatisticsReport_ %s_%s_%s_%s.pdf' % (291 self.context. session, self.context.mode, self.context.level,297 return 'StudentStatisticsReport_rno%s_%s.pdf' % ( 298 self.context.__name__, 292 299 self.context.creation_dt_string) 293 300 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14423 r14514 129 129 'application/pdf') 130 130 self.assertTrue( 131 'filename="LevelReport_ fac1_dep1_CERT1_2010_100_'in131 'filename="LevelReport_rno%s' % job_id in 132 132 self.browser.headers['content-disposition']) 133 133 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) 134 job_id = self.app['reports'].running_report_jobs[0][0]135 134 # ... and discarded 136 135 self.browser.open('http://localhost/app/reports') … … 149 148 self.assertTrue( 150 149 'INFO - zope.mgr - students.reports.level_report.LevelReportPDFView - ' 151 'report %s downloaded: LevelReport_ fac1_dep1_CERT1_2010_100_'152 % job_idin logcontent150 'report %s downloaded: LevelReport_rno%s' 151 % (job_id, job_id) in logcontent 153 152 ) 154 153 self.assertTrue( -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py
r14423 r14514 158 158 'application/pdf') 159 159 self.assertTrue( 160 'filename="SessionResultsPresentation_ fac1_dep1_CERT1_2010_100_'in160 'filename="SessionResultsPresentation_rno%s' % job_id in 161 161 self.browser.headers['content-disposition']) 162 162 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) 163 job_id = self.app['reports'].running_report_jobs[0][0]164 163 # ... and discarded 165 164 self.browser.open('http://localhost/app/reports') … … 178 177 self.assertTrue( 179 178 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - ' 180 'report %s downloaded: SessionResultsPresentation_ fac1_dep1_CERT1_2010_100_'181 % job_idin logcontent179 'report %s downloaded: SessionResultsPresentation_rno%s' 180 % (job_id, job_id) in logcontent 182 181 ) 183 182 self.assertTrue( … … 199 198 'application/pdf') 200 199 self.assertTrue( 201 'filename="SessionResultsPresentation_ fac1_dep1_CERT1_2010_0_'in200 'filename="SessionResultsPresentation_rno%s' % job_id in 202 201 self.browser.headers['content-disposition']) 203 202 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) 204 job_id = self.app['reports'].running_report_jobs[0][0]205 203 # ... and discarded 206 204 self.browser.open('http://localhost/app/reports') … … 219 217 self.assertTrue( 220 218 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - ' 221 'report %s downloaded: SessionResultsPresentation_ fac1_dep1_CERT1_2010_0_'222 % job_idin logcontent219 'report %s downloaded: SessionResultsPresentation_rno%s' 220 % (job_id, job_id) in logcontent 223 221 ) 224 222 self.assertTrue( -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r14373 r14514 181 181 'application/pdf') 182 182 self.assertTrue( 183 'filename="StudentStatisticsReport_ 2004_2005_All_'in183 'filename="StudentStatisticsReport_rno%s' % job_id in 184 184 self.browser.headers['content-disposition']) 185 185 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) 186 job_id = self.app['reports'].running_report_jobs[0][0]187 186 # ... and discarded 188 187 self.browser.open('http://localhost/app/reports') … … 200 199 self.assertTrue( 201 200 'INFO - zope.mgr - students.reports.student_statistics.StudentStatisticsReportPDFView - ' 202 'report %s downloaded: StudentStatisticsReport_ 2004_2005_All__'203 % job_idin logcontent201 'report %s downloaded: StudentStatisticsReport_rno%s' 202 % (job_id, job_id) in logcontent 204 203 ) 205 204 self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.