Changeset 13218 for main/waeup.kofa/trunk
- Timestamp:
- 24 Aug 2015, 08:44:35 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 1 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r13217 r13218 477 477 478 478 class ApplicantsContainerPrefillFormPage(KofaAddFormPage): 479 """ Add-form to pre-fill applicants containers.479 """Form to pre-fill applicants containers. 480 480 """ 481 481 grok.context(IApplicantsContainer) 482 482 grok.require('waeup.manageApplication') 483 483 grok.name('prefill') 484 grok.template('prefill _container')484 grok.template('prefillcontainer') 485 485 label = _('Pre-fill container') 486 486 pnav = 3 … … 497 497 498 498 @action(_('Pre-fill now'), style='primary') 499 def addApplicants(self , **data):499 def addApplicants(self): 500 500 form = self.request.form 501 501 if 'number' in form and form['number']: … … 506 506 self.flash(_('%s application records created.' % number)) 507 507 self.context.writeLogMessage(self, '%s applicants created' % (number)) 508 self.redirect(self.url(self.context, 'index')) 509 return 510 511 @action(_('Cancel'), validator=NullValidator) 512 def cancel(self, **data): 513 self.redirect(self.url(self.context)) 514 return 515 516 class ApplicantsContainerPurgeFormPage(KofaEditFormPage): 517 """Form to pre-fill applicants containers. 518 """ 519 grok.context(IApplicantsContainer) 520 grok.require('waeup.manageApplication') 521 grok.name('purge') 522 grok.template('purgecontainer') 523 label = _('Purge container') 524 pnav = 3 525 doclink = DOCLINK + '/applicants.html' 526 527 @action(_('Remove initialized records'), style='primary') 528 def purgeInitialized(self): 529 form = self.request.form 530 purged = 0 531 keys = [key for key in self.context.keys()] 532 for key in keys: 533 if self.context[key].state == 'initialized': 534 del self.context[key] 535 purged += 1 536 self.flash(_('%s application records purged.' % purged)) 537 self.context.writeLogMessage(self, '%s applicants purged' % (purged)) 508 538 self.redirect(self.url(self.context, 'index')) 509 539 return -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r13216 r13218 333 333 translated_state = Attribute('Real name of the application state') 334 334 special = Attribute('True if special application') 335 application_number = Attribute('The key under which the record is stored')336 335 337 336 application_date = Attribute('UTC datetime of submission, used for export only') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13217 r13218 467 467 return 468 468 469 def test_prefill_ container(self):469 def test_prefill_purge_container(self): 470 470 # Managers can pre-fill containers in create mode 471 471 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 500 500 {'not admitted': 0, 'started': 0, 'created': 0, 501 501 'admitted': 0, 'submitted': 0, 'initialized': 1, 'paid': 0}) 502 # Container can be purged 503 self.browser.open(self.container_manage_path) 504 self.browser.getLink("Purge").click() 505 self.browser.getControl("Remove").click() 506 self.assertTrue('11 application records purged' in self.browser.contents) 507 self.assertEqual(self.applicantscontainer.counts[0], 0) 508 self.assertEqual(self.applicantscontainer.counts[1], 0) 502 509 return 503 510 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r13217 r13218 116 116 target = 'addapplicant' 117 117 118 class ApplicantsContainerPrefillActionButton( AddActionButton):118 class ApplicantsContainerPrefillActionButton(ManageActionButton): 119 119 grok.order(2) 120 120 grok.context(IApplicantsContainer) … … 125 125 target = 'prefill' 126 126 127 class ApplicantsContainerPurgeActionButton(ManageActionButton): 128 grok.order(3) 129 grok.context(IApplicantsContainer) 130 grok.view(ApplicantsContainerManageFormPage) 131 grok.require('waeup.manageApplication') 132 icon = 'actionicon_sweep.png' 133 text = _('Purge container') 134 target = 'purge' 135 127 136 class ApplicantsContainerStatisticsActionButton(ManageActionButton): 128 grok.order( 3)137 grok.order(4) 129 138 grok.context(IApplicantsContainer) 130 139 grok.view(ApplicantsContainerManageFormPage) … … 136 145 class ApplicantsContainerStatisticsActionButton2( 137 146 ApplicantsContainerStatisticsActionButton): 138 grok.order( 4)147 grok.order(5) 139 148 grok.view(ApplicantsContainerPage) 140 149 -
main/waeup.kofa/trunk/src/waeup/kofa/documents/browser.py
r13144 r13218 21 21 import sys 22 22 import grok 23 import pytz24 23 from urllib import urlencode 25 24 from datetime import datetime
Note: See TracChangeset for help on using the changeset viewer.