- Timestamp:
- 27 Jun 2024, 09:18:42 (5 months ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r17809 r17823 4 4 1.8.2.dev0 (unreleased) 5 5 ======================= 6 7 * Make `_set_exporter_values` customizable. 6 8 7 9 * Limit the file name length to 65 characters. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r17810 r17823 4344 4344 4345 4345 def _set_exporter_values(self): 4346 # We provide all student exporters, nothing else, yet. 4347 # Bursary, Department or Accommodation Officers don't 4348 # have the general exportData 4349 # permission and are only allowed to export bursary, payments 4350 # overview or accommodation data respectively. 4351 # This is the only place where waeup.exportAccommodationData, 4352 # waeup.exportBursaryData and waeup.exportPaymentsOverview 4353 # are used. 4346 kofa_utils = getUtility(IKofaUtils) 4347 exporters = kofa_utils.collect_exporters(self.context) 4348 if exporters: 4349 self.exporters = exporters 4350 return 4354 4351 exporters = [] 4355 if not checkPermission('waeup.exportData', self.context):4356 if checkPermission('waeup.exportBursaryData', self.context):4357 exporters += [('Bursary Data', 'bursary')]4358 if checkPermission('waeup.exportPaymentsOverview', self.context):4359 exporters += [('School Fee Payments Overview',4360 'sfpaymentsoverview'),4361 ('Session Payments Overview',4362 'sessionpaymentsoverview')]4363 if checkPermission('waeup.exportAccommodationData', self.context):4364 exporters += [('Bed Tickets', 'bedtickets'),4365 ('Accommodation Payments',4366 'accommodationpayments')]4367 self.exporters = exporters4368 return4369 4352 STUDENT_EXPORTER_NAMES = getUtility( 4370 4353 IStudentsUtils).STUDENT_EXPORTER_NAMES -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r17798 r17823 26 26 from random import SystemRandom as r 27 27 from zope.i18n import translate 28 from zope.security import checkPermission 28 29 from waeup.kofa.interfaces import IKofaUtils 29 30 from waeup.kofa.interfaces import MessageFactory as _ … … 567 568 value = int(pow(10, prec)*value) / (1.0*pow(10, prec)) 568 569 return '{:{width}.{prec}f}'.format(value, width=0, prec=prec) 570 571 def collect_exporters(self, context): 572 # Used for `ExportJobContainerJobConfig`. 573 # We provide all student exporters, nothing else, yet. 574 # Bursary, Department or Accommodation Officers don't 575 # have the general exportData 576 # permission and are only allowed to export bursary, payments 577 # overview or accommodation data respectively. 578 # This is the only place where waeup.exportAccommodationData, 579 # waeup.exportBursaryData and waeup.exportPaymentsOverview 580 # are used. 581 exporters = [] 582 if not checkPermission('waeup.exportData', context): 583 if checkPermission('waeup.exportBursaryData', context): 584 exporters += [('Bursary Data', 'bursary')] 585 if checkPermission('waeup.exportPaymentsOverview', context): 586 exporters += [('School Fee Payments Overview', 587 'sfpaymentsoverview'), 588 ('Session Payments Overview', 589 'sessionpaymentsoverview')] 590 if checkPermission('waeup.exportAccommodationData', context): 591 exporters += [('Bed Tickets', 'bedtickets'), 592 ('Accommodation Payments', 593 'accommodationpayments')] 594 return exporters
Note: See TracChangeset for help on using the changeset viewer.