- Timestamp:
- 19 Nov 2019, 13:07:22 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py
r15651 r15826 19 19 import grok 20 20 from zope.component import getUtility 21 from waeup.kofa.interfaces import IExtFileStore 21 22 from waeup.kofa.browser.viewlets import ManageActionButton 22 23 from waeup.kofa.students.interfaces import IStudentsUtils 24 from waeup.kofa.students.viewlets import ( 25 PaymentReceiptActionButton, StudentPassportActionButton) 23 26 from waeup.kofa.students.fileviewlets import ( 24 27 StudentFileDisplay, StudentFileUpload, StudentImage) 25 28 from waeup.kofa.students.browser import ExportPDFClearanceSlip 26 27 from kofacustom.nigeria.students.interfaces import INigeriaStudent 29 from kofacustom.nigeria.students.interfaces import ( 30 INigeriaStudent, INigeriaStudentOnlinePayment) 28 31 from kofacustom.nigeria.students.browser import NigeriaStudentBaseDisplayFormPage 29 32 from kofacustom.nigeria.interfaces import MessageFactory as _ … … 38 41 return False 39 42 43 class StudentPassportActionButton(StudentPassportActionButton): 44 45 @property 46 def target_url(self): 47 # Passport pictures must not be editable if application slip 48 # exists. 49 slip = getUtility(IExtFileStore).getFileByContext( 50 self.context, 'application_slip') 51 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES 52 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None: 53 return '' 54 return self.view.url(self.view.context, self.target) 55 56 class PaymentReceiptActionButton(PaymentReceiptActionButton): 57 grok.order(4) 58 grok.context(INigeriaStudentOnlinePayment) 59 60 @property 61 def target_url(self): 62 if not self.context.r_company: 63 return '' 64 return self.view.url(self.view.context, self.target) 65 40 66 # Financial Clearance Officer buttons 41 67
Note: See TracChangeset for help on using the changeset viewer.