Changeset 6078
- Timestamp:
- 14 May 2011, 00:40:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6070 r6078 4 4 ## Started on Sun Jun 27 11:03:10 2010 Uli Fouquet 5 5 ## $Id$ 6 ## 6 ## 7 7 ## Copyright (C) 2010 Uli Fouquet & Henrik Bettermann 8 8 ## This program is free software; you can redistribute it and/or modify … … 10 10 ## the Free Software Foundation; either version 2 of the License, or 11 11 ## (at your option) any later version. 12 ## 12 ## 13 13 ## This program is distributed in the hope that it will be useful, 14 14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 ## GNU General Public License for more details. 17 ## 17 ## 18 18 ## You should have received a copy of the GNU General Public License 19 19 ## along with this program; if not, write to the Free Software … … 51 51 from waeup.sirp.widgets.datewidget import ( 52 52 FriendlyDateWidget, FriendlyDateDisplayWidget) 53 54 from waeup.sirp.widgets.restwidget import ReSTWidget 53 54 from waeup.sirp.widgets.restwidget import ReSTWidget 55 55 56 56 #from zope.formlib.objectwidget import ObjectWidget … … 116 116 taboneactions = ['Add applicants container', 'Remove selected','Cancel'] 117 117 subunits = 'Applicants Containers' 118 118 119 119 def update(self): 120 120 tabs.need() … … 139 139 if len(deleted): 140 140 self.flash('Successfully removed: %s' % ', '.join(deleted)) 141 self.redirect(self.url(self.context, '@@manage')+'#tab-1') 142 return 141 self.redirect(self.url(self.context, '@@manage')+'#tab-1') 142 return 143 143 144 144 @grok.action('Add applicants container', validator=NullValidator) 145 145 def addApplicantsContainer(self, **data): 146 146 self.redirect(self.url(self.context, '@@add')) 147 return 148 147 return 148 149 149 @grok.action('Cancel', validator=NullValidator) 150 150 def cancel(self, **data): 151 151 self.redirect(self.url(self.context)) 152 return 153 152 return 153 154 154 class ApplicantsContainerAddFormPage(WAeUPAddFormPage): 155 155 grok.context(IApplicantsRoot) … … 160 160 label = 'Add applicants container' 161 161 pnav = 3 162 162 163 163 form_fields = grok.AutoFields(IApplicantsContainerAdd) 164 164 form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le') 165 165 form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le') 166 form_fields['description'].custom_widget = ReSTWidget 167 166 form_fields['description'].custom_widget = ReSTWidget 167 168 168 @grok.action('Add applicants container') 169 169 def addApplicantsContainer(self, **data): … … 174 174 # Add new applicants container... 175 175 provider = getUtility(IApplicantsContainerProvider, 176 name=getattr(data['provider'], 176 name=getattr(data['provider'], 177 177 'grokcore.component.directive.name')) 178 178 container = provider.factory() … … 182 182 self.redirect(self.url(self.context, u'@@manage')+'#tab-1') 183 183 return 184 184 185 185 @grok.action('Cancel') 186 186 def cancel(self, **data): 187 self.redirect(self.url(self.context)) 188 187 self.redirect(self.url(self.context)) 188 189 189 #def getContainerProviders(self): 190 190 # """Get a list of applicants container providers. … … 221 221 grok.context(IApplicantsRoot) 222 222 title = u'Applicants' 223 223 224 224 class ApplicantsContainerBreadcrumb(Breadcrumb): 225 225 """A breadcrumb for applicantscontainers. … … 230 230 """Faculties-tab in primary navigation. 231 231 """ 232 232 233 233 grok.context(IWAeUPObject) 234 234 grok.order(3) … … 293 293 return "Manage applicants container: %s" % getattr( 294 294 self.context, '__name__', 'unnamed') 295 295 296 296 @property 297 297 def label(self): … … 311 311 self.flash('Data saved.') 312 312 return 313 313 314 314 @grok.action('Back') 315 315 def cancel(self, **data): … … 323 323 324 324 title = u'Login' 325 325 326 326 @property 327 327 def label(self): … … 330 330 pnav = 3 331 331 prefix = u'APP' 332 332 333 333 def update(self, SUBMIT=None): 334 334 self.ac_series = self.request.form.get('form.ac_series', None) … … 351 351 applicant.access_code = pin 352 352 self.context[pin] = applicant 353 353 354 354 # Assign current principal the owner role on created applicant 355 355 # record … … 411 411 self.redirect(self.url(self.context)) 412 412 return 413 413 414 414 def update(self): 415 415 if self.context.locked:
Note: See TracChangeset for help on using the changeset viewer.