- Timestamp:
- 19 Nov 2019, 13:07:22 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r15796 r15826 42 42 BedTicketAddPage) 43 43 from waeup.kofa.students.interfaces import IStudentsUtils 44 from waeup.kofa.students.viewlets import (45 PaymentReceiptActionButton, StudentPassportActionButton)46 44 from kofacustom.nigeria.students.interfaces import ( 47 45 INigeriaStudentBase, INigeriaStudent, INigeriaStudentPersonal, … … 57 55 """ 58 56 grok.context(INigeriaStudentOnlinePayment) 59 60 class PaymentReceiptActionButton(PaymentReceiptActionButton):61 grok.order(4)62 grok.context(INigeriaStudentOnlinePayment)63 64 @property65 def target_url(self):66 if not self.context.r_company:67 return ''68 return self.view.url(self.view.context, self.target)69 70 57 71 58 class NigeriaStudentBaseDisplayFormPage(StudentBaseDisplayFormPage): … … 253 240 'phone', 'adm_code', 'email', 'date_of_birth', 'current_level', 254 241 'flash_notice') 255 256 class StudentPassportActionButton(StudentPassportActionButton):257 258 @property259 def target_url(self):260 # Passport pictures must not be editable if application slip261 # exists.262 slip = getUtility(IExtFileStore).getFileByContext(263 self.context, 'application_slip')264 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES265 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None:266 return ''267 return self.view.url(self.view.context, self.target)268 242 269 243 class NigeriaStudentFilesUploadPage(StudentFilesUploadPage): -
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.