Changeset 6930
- Timestamp:
- 23 Oct 2011, 21:31:27 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/payments/interfaces.py
r6873 r6930 43 43 ) 44 44 45 payment_date = schema.Date (45 payment_date = schema.Datetime( 46 46 title = u'Payment Date', 47 47 required = False, … … 100 100 # ) 101 101 102 ac = schema.TextLine( 103 title = u'Activation Code', 104 default = None, 105 required = False, 106 readonly = False, 107 ) 108 102 109 r_amount_approved = schema.Int( 103 110 title = u'Response Amount Approved', 104 111 default = 0, 105 112 required = False, 106 readonly = True,113 readonly = False, 107 114 ) 108 115 … … 111 118 default = None, 112 119 required = False, 113 readonly = True,120 readonly = False, 114 121 ) 115 122 … … 118 125 default = None, 119 126 required = False, 120 readonly = True,127 readonly = False, 121 128 ) -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6927 r6930 913 913 self.context.__parent__.__parent__.fullname,self.context.p_id) 914 914 915 class OnlinePaymentCallbackPage(grok.View): 916 """ Callback view 917 """ 918 grok.context(IStudentOnlinePayment) 919 grok.name('callback') 920 grok.require('waeup.payStudent') 921 922 # This update method simulates a valid callback und must be 923 # specified in the customization package. The parameters must be taken 924 # from the incoming request. 925 def update(self): 926 self.context.r_amount_approved = self.context.amount_auth 927 self.context.r_card_num = u'0000' 928 self.context.r_code = u'00' 929 self.context.p_state = 'paid' 930 self.context.payment_date = datetime.now() 931 if self.context.p_category == 'clearance': 932 # Find valid CLR access code 933 pass 934 elif self.context.p_category == 'schoolfee': 935 # Find valid SFE access code 936 pass 937 return 938 939 def render(self): 940 self.redirect(self.url(self.context)) 941 return 942 915 943 class AccommodationDisplayFormPage(WAeUPDisplayFormPage): 916 944 """ Page to display the student accommodation data -
main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py
r6687 r6930 27 27 grok.name('waeup.viewStudent') 28 28 29 class PayStudent(grok.Permission): 30 grok.name('waeup.payStudent') 31 29 32 class ManageStudents(grok.Permission): 30 33 grok.name('waeup.manageStudents') … … 34 37 grok.name('waeup.local.StudentRecordOwner') 35 38 grok.title(u'Student Record Owner') 36 grok.permissions('waeup.handleStudent', 'waeup.viewStudent') 39 grok.permissions('waeup.handleStudent', 40 'waeup.viewStudent', 'waeup.payStudent') 37 41 38 42 # Global Roles … … 45 49 grok.title(u'Students Officer') 46 50 grok.permissions('waeup.View', 'waeup.Public', 47 'waeup.viewStudent', 'waeup.manageStudents') 51 'waeup.viewStudent', 'waeup.manageStudents', 52 'waeup.payStudent') -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6929 r6930 691 691 self.assertMatches('...ticket created...', 692 692 self.browser.contents) 693 694 # Managers can open the callback view which simulates a valid callback 695 ctrl = self.browser.getControl(name='val_id') 696 value = ctrl.options[0] 697 self.browser.getLink(value).click() 698 self.browser.open(self.browser.url + '/callback') 699 expected = '''... 700 <td> 701 Paid 702 </td>...''' 703 self.assertMatches(expected,self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.