- Timestamp:
- 26 Sep 2013, 09:37:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r10645 r10655 34 34 IApplicantRegisterUpdate 35 35 ) 36 from waeup.kofa.applicants.container import ApplicantsContainer 36 from waeup.kofa.applicants.container import ( 37 ApplicantsContainer, VirtualApplicantsExportJobContainer) 37 38 from waeup.kofa.applicants.applicant import search 38 39 from waeup.kofa.applicants.workflow import ( … … 48 49 from waeup.kofa.browser.layout import ( 49 50 NullValidator, jsaction, action, UtilityView, JSAction) 50 from waeup.kofa.browser.pages import add_local_role, del_local_roles 51 from waeup.kofa.browser.pages import ( 52 add_local_role, del_local_roles, doll_up, ExportCSVView) 51 53 from waeup.kofa.browser.resources import datepicker, tabs, datatable, warning 52 54 from waeup.kofa.interfaces import ( … … 273 275 """ 274 276 grok.context(IApplicantsContainer) 277 278 279 class ApplicantsExportsBreadcrumb(Breadcrumb): 280 """A breadcrumb for exports. 281 """ 282 grok.context(VirtualApplicantsExportJobContainer) 283 title = _(u'Applicant Data Exports') 284 target = None 275 285 276 286 class ApplicantBreadcrumb(Breadcrumb): … … 1162 1172 self.applicant_id = applicant_id 1163 1173 return 1174 1175 class ExportJobContainerOverview(KofaPage): 1176 """Page that lists active applicant data export jobs and provides links 1177 to discard or download CSV files. 1178 1179 """ 1180 grok.context(VirtualApplicantsExportJobContainer) 1181 grok.require('waeup.manageApplication') 1182 grok.name('index.html') 1183 grok.template('exportjobsindex') 1184 label = _('Applicant Data Exports') 1185 pnav = 3 1186 1187 def update(self, CREATE=None, DISCARD=None, job_id=None): 1188 if CREATE: 1189 self.redirect(self.url('@@start_export')) 1190 return 1191 if DISCARD and job_id: 1192 entry = self.context.entry_from_job_id(job_id) 1193 self.context.delete_export_entry(entry) 1194 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1195 self.context.logger.info( 1196 '%s - discarded: job_id=%s' % (ob_class, job_id)) 1197 self.flash(_('Discarded export') + ' %s' % job_id) 1198 self.entries = doll_up(self, user=self.request.principal.id) 1199 return 1200 1201 class ExportJobContainerJobStart(KofaPage): 1202 """Page that starts an applicants export job. 1203 1204 """ 1205 grok.context(VirtualApplicantsExportJobContainer) 1206 grok.require('waeup.manageApplication') 1207 grok.name('start_export') 1208 1209 def update(self): 1210 exporter = 'applicants' 1211 container_code = self.context.__parent__.code 1212 job_id = self.context.start_export_job(exporter, 1213 self.request.principal.id, 1214 container=container_code) 1215 1216 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1217 self.context.logger.info( 1218 '%s - exported: %s (%s), job_id=%s' 1219 % (ob_class, exporter, container_code, job_id)) 1220 self.flash(_('Export started.')) 1221 self.redirect(self.url(self.context)) 1222 return 1223 1224 def render(self): 1225 return 1226 1227 class ExportJobContainerDownload(ExportCSVView): 1228 """Page that downloads a students export csv file. 1229 1230 """ 1231 grok.context(VirtualApplicantsExportJobContainer) 1232 grok.require('waeup.manageApplication')
Note: See TracChangeset for help on using the changeset viewer.