Changeset 8247 for main/waeup.uniben/trunk/src/waeup/uniben/students
- Timestamp:
- 22 Apr 2012, 12:56:07 (13 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r8204 r8247 19 19 from zope.formlib.textwidgets import BytesDisplayWidget 20 20 from zope.component import getUtility 21 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 21 22 from waeup.kofa.interfaces import IExtFileStore 23 from waeup.kofa.browser.layout import action 22 24 from waeup.kofa.students.browser import ( 23 25 StudentPersonalDisplayFormPage, … … 25 27 StudentClearanceDisplayFormPage, OnlinePaymentCallbackPage, 26 28 ExportPDFClearanceSlipPage, StudentBaseManageFormPage, 27 StudentBaseEditFormPage, StudentPersonalEditFormPage) 29 StudentBaseEditFormPage, StudentPersonalEditFormPage, 30 OnlinePaymentDisplayFormPage, OnlinePaymentAddFormPage, 31 OnlinePaymentBreadcrumb) 28 32 from waeup.kofa.students.viewlets import RequestCallbackActionButton 29 33 from waeup.uniben.students.interfaces import ( 30 34 ICustomStudentBase, ICustomStudent, ICustomStudentPersonal, 31 35 ICustomUGStudentClearance,ICustomPGStudentClearance, 36 ICustomStudentOnlinePayment, 32 37 ) 33 38 from waeup.uniben.interfaces import MessageFactory as _ 34 39 35 class CustomRequestCallbackActionButton(RequestCallbackActionButton): 40 class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb): 41 """A breadcrumb for payments. 42 """ 43 grok.context(ICustomStudentOnlinePayment) 44 45 class RequestCallbackActionButton(RequestCallbackActionButton): 36 46 """ Do not display the base package callback button in custom pages. 37 47 """ … … 144 154 return False 145 155 156 class CustomOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage): 157 """ Page to view an online payment ticket 158 """ 159 grok.context(ICustomStudentOnlinePayment) 160 form_fields = grok.AutoFields(ICustomStudentOnlinePayment) 161 form_fields[ 162 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 163 form_fields[ 164 'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 165 grok.template('payment_view') 166 167 @property 168 def transaction_code(self): 169 tcode = self.context.p_id 170 return tcode[len(tcode)-8:len(tcode)] 171 172 class CustomOnlinePaymentAddFormPage(OnlinePaymentAddFormPage): 173 """ Page to add an online payment ticket 174 """ 175 form_fields = grok.AutoFields(ICustomStudentOnlinePayment).select( 176 'p_category') 177 factory = u'waeup.CustomStudentOnlinePayment' 178 179 def _fillCustomFields(self, payment, pay_details): 180 payment.surcharge_1 = pay_details['surcharge_1'] 181 payment.surcharge_2 = pay_details['surcharge_2'] 182 payment.surcharge_3 = pay_details['surcharge_3'] 183 return payment -
main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py
r8204 r8247 18 18 from zope import schema 19 19 from waeup.kofa.schema import TextLineChoice 20 from waeup.kofa.interfaces import SimpleKofaVocabulary 20 from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab 21 21 from waeup.kofa.schema import FormattedDate 22 22 from waeup.kofa.schoolgrades import ResultEntryField … … 31 31 lgas_vocab, high_qual, high_grade, exam_types) 32 32 from waeup.uniben.interfaces import MessageFactory as _ 33 from waeup.uniben.payments.interfaces import ICustomOnlinePayment 33 34 34 35 class ICustomStudentBase(IStudentBase): … … 339 340 340 341 """ 342 343 class ICustomStudentOnlinePayment(ICustomOnlinePayment): 344 """A student payment via payment gateways. 345 346 """ -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r8204 r8247 20 20 from waeup.kofa.students.utils import StudentsUtils 21 21 from waeup.kofa.students.interfaces import IStudentsUtils 22 from waeup.kofa.accesscodes import create_accesscode 22 23 from waeup.uniben.interfaces import MessageFactory as _ 23 24 … … 41 42 else: 42 43 return 0.0 44 45 def actions_after_student_payment(student, payment, view): 46 if payment.p_category == 'clearance': 47 # Create CLR access code 48 pin, error = create_accesscode('CLR',0,student.student_id) 49 if error: 50 view.flash(_('Valid callback received. ${a}', 51 mapping = {'a':error})) 52 return 53 payment.ac = pin 54 elif payment.p_category == 'schoolfee': 55 # Create SFE access code 56 pin, error = create_accesscode('SFE',0,student.student_id) 57 if error: 58 view.flash(_('Valid callback received. ${a}', 59 mapping = {'a':error})) 60 return 61 payment.ac = pin 62 elif payment.p_category == 'bed_allocation': 63 # Create HOS access code 64 pin, error = create_accesscode('HOS',0,student.student_id) 65 if error: 66 view.flash(_('Valid callback received. ${a}', 67 mapping = {'a':error})) 68 return 69 payment.ac = pin 70 view.flash(_('Valid callback received.')) 71 return 43 72 44 73 class CustomStudentsUtils(StudentsUtils):
Note: See TracChangeset for help on using the changeset viewer.