Changeset 6943
- Timestamp:
- 25 Oct 2011, 10:16:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6940 r6943 50 50 from waeup.sirp.authentication import get_principal_role_manager 51 51 52 def write_log_message(view, message): 53 ob_class = view.__implemented__.__name__.replace('waeup.sirp.','') 54 view.context.getStudent().loggerInfo(ob_class, message) 55 return 56 52 57 # Save function used for save methods in manager pages 53 58 def msave(view, **data): 54 59 form = view.request.form 55 ob_class = view.__implemented__.__name__.replace('waeup.sirp.','')56 60 changed_fields = view.applyData(view.context, **data) 57 61 # Turn list of lists into single list … … 62 66 view.flash('Form has been saved.') 63 67 if fields_string: 64 view.context.getStudent().loggerInfo(ob_class, 'saved: % s' % fields_string)68 write_log_message(view, 'saved: % s' % fields_string) 65 69 return 66 70 … … 366 370 def save(self, **data): 367 371 form = self.request.form 368 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','')369 372 password = form.get('password', None) 370 373 password_ctl = form.get('control_password', None) … … 376 379 # are no (other) errors left in form. 377 380 IUserAccount(self.context).setPassword(password) 378 self.context.loggerInfo(ob_class, 'password changed')381 write_log_message(self, 'password changed') 379 382 380 383 #self.reg_number = form.get('form.reg_number', None) … … 403 406 self.flash('Form has been saved.') 404 407 if fields_string: 405 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string)408 write_log_message(self, 'saved: % s' % fields_string) 406 409 return 407 410 … … 772 775 773 776 # We don't need the display form page yet 774 class PaymentsDisplayFormPage(WAeUPDisplayFormPage):775 """ Page to display the student payments776 """777 grok.context(IStudentPaymentsContainer)778 grok.name('view')779 grok.require('waeup.viewStudent')780 form_fields = grok.AutoFields(IStudentPaymentsContainer)781 grok.template('paymentspage')782 title = 'Payments'783 pnav = 4784 785 def formatDatetime(self,datetimeobj):786 if isinstance(datetimeobj, datetime):787 return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")788 else:789 return None790 791 @property792 def label(self):793 return '%s: Payments' % self.context.__parent__.fullname794 795 def update(self):796 super(PaymentsDisplayFormPage, self).update()797 datatable.need()798 return777 #class PaymentsDisplayFormPage(WAeUPDisplayFormPage): 778 # """ Page to display the student payments 779 # """ 780 # grok.context(IStudentPaymentsContainer) 781 # grok.name('view') 782 # grok.require('waeup.viewStudent') 783 # form_fields = grok.AutoFields(IStudentPaymentsContainer) 784 # grok.template('paymentspage') 785 # title = 'Payments' 786 # pnav = 4 787 788 # def formatDatetime(self,datetimeobj): 789 # if isinstance(datetimeobj, datetime): 790 # return datetimeobj.strftime("%Y-%m-%d %H:%M:%S") 791 # else: 792 # return None 793 794 # @property 795 # def label(self): 796 # return '%s: Payments' % self.context.__parent__.fullname 797 798 # def update(self): 799 # super(PaymentsDisplayFormPage, self).update() 800 # datatable.need() 801 # return 799 802 800 803 # This manage form page is for both students and students officers. … … 853 856 if len(deleted): 854 857 self.flash('Successfully removed: %s' % ', '.join(deleted)) 858 write_log_message(self,'removed: % s' % ', '.join(deleted)) 855 859 self.redirect(self.url(self.context)) 856 860 return … … 936 940 def update(self): 937 941 student = self.context.getStudent() 942 write_log_message(self,'valid callback: %s' % self.context.p_id) 938 943 self.context.r_amount_approved = self.context.amount_auth 939 944 self.context.r_card_num = u'0000'
Note: See TracChangeset for help on using the changeset viewer.