Changeset 15176
- Timestamp:
- 26 Sep 2018, 05:47:59 (6 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/browser/pages.py
r15015 r15176 19 19 from waeup.kofa.browser.pages import ( 20 20 SessionConfigurationAddFormPage, SessionConfigurationManageFormPage, 21 LoginPage, CertificatePage, CertificateManageFormPage) 21 LoginPage, CertificatePage, CertificateManageFormPage, 22 ConfigurationContainerManageFormPage) 23 from waeup.kofa.interfaces import IConfigurationContainer 22 24 from waeup.kofa.university.interfaces import ICertificate 23 25 from kofacustom.edopoly.interfaces import ( 24 26 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) 27 28 class CustomConfigurationContainerManageFormPage( 29 ConfigurationContainerManageFormPage): 30 31 form_fields = grok.AutoFields(IConfigurationContainer).omit( 32 'frontpage_dict') 33 form_fields['maintmode_enabled_by'].for_display = True 25 34 26 35 class CustomSessionConfigurationAddFormPage(SessionConfigurationAddFormPage): -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/locales/en/LC_MESSAGES/waeup.kofa.po
r15019 r15176 30 30 msgid "Foreigner Returning School Fee" 31 31 msgstr "Tuition Fee 4 (not used)" 32 33 msgid "Next Matriculation Number Integer" 34 msgstr "Next ND-FT Matriculation Number Integer" 35 36 msgid "Integer used for constructing the next matriculation number" 37 msgstr "" 38 "Integer used for constructing the next matriculation number of ND-FT students" 39 40 msgid "Next Matriculation Number Integer 2" 41 msgstr "Next HND-FT Matriculation Number Integer" 42 43 msgid "2nd integer used for constructing the next matriculation number" 44 msgstr "" 45 "Integer used for constructing the next matriculation number of HND-FT students" 46 47 msgid "Next Matriculation Number Integer 3" 48 msgstr "Next ND-PT Matriculation Number Integer" 49 50 msgid "3rd integer used for constructing the next matriculation number" 51 msgstr "" 52 "Integer used for constructing the next matriculation number of ND-PT students" 53 54 msgid "Next Matriculation Number Integer 4" 55 msgstr "Next HND-PT Matriculation Number Integer" 56 57 msgid "4th integer used for constructing the next matriculation number" 58 msgstr "" 59 "Integer used for constructing the next matriculation number of HND-PT " 60 "students" -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/browser.py
r15167 r15176 23 23 from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils 24 24 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 25 from waeup.kofa.browser.layout import KofaEditFormPage26 from waeup.kofa.browser.layout import action, jsaction 25 from waeup.kofa.browser.layout import ( 26 KofaEditFormPage, UtilityView, action, jsaction) 27 27 from waeup.kofa.students.browser import ( 28 28 StudyLevelEditFormPage, StudyLevelDisplayFormPage, … … 31 31 BedTicketAddPage, ExportPDFTranscriptSlip, 32 32 msave, emit_lock_message) 33 from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket 33 from waeup.kofa.students.interfaces import ( 34 IStudentsUtils, ICourseTicket, IStudent) 34 35 from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS 35 36 from kofacustom.nigeria.students.browser import ( … … 41 42 NigeriaExportPDFClearanceSlip, 42 43 ) 43 44 44 from kofacustom.edopoly.students.interfaces import ( 45 45 ICustomStudentOnlinePayment, ICustomStudentStudyCourse, 46 ICustomStudentStudyLevel )46 ICustomStudentStudyLevel, ICustomStudent) 47 47 from kofacustom.edopoly.interfaces import MessageFactory as _ 48 48 … … 146 146 return 147 147 return 148 149 class StudentGetMatricNumberPage(UtilityView, grok.View): 150 """ Construct and set the matriculation number. 151 """ 152 grok.context(IStudent) 153 grok.name('get_matric_number') 154 grok.require('waeup.viewStudent') 155 156 def update(self): 157 students_utils = getUtility(IStudentsUtils) 158 msg, mnumber = students_utils.setMatricNumber(self.context) 159 if msg: 160 self.flash(msg, type="danger") 161 else: 162 self.flash(_('Matriculation number %s assigned.' % mnumber)) 163 self.context.writeLogMessage(self, '%s assigned' % mnumber) 164 self.redirect(self.url(self.context)) 165 return 166 167 def render(self): 168 return 169 170 class ExportPDFMatricNumberSlip(UtilityView, grok.View): 171 """Deliver a PDF notification slip. 172 """ 173 grok.context(ICustomStudent) 174 grok.name('matric_number_slip.pdf') 175 grok.require('waeup.viewStudent') 176 prefix = 'form' 177 178 form_fields = grok.AutoFields(ICustomStudent).select( 179 'student_id', 'matric_number') 180 omit_fields = ('date_of_birth', 'current_level', 'flash_notice') 181 182 @property 183 def title(self): 184 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 185 return translate(_('Matriculation Number'), 'waeup.kofa', 186 target_language=portal_language) 187 188 @property 189 def label(self): 190 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 191 return translate(_('Matriculation Number Slip\n'), 192 target_language=portal_language) \ 193 + ' %s' % self.context.display_fullname 194 195 def render(self): 196 if self.context.state not in (PAID,) or not self.context.is_fresh \ 197 or not self.context.matric_number: 198 self.flash('Not allowed.', type="danger") 199 self.redirect(self.url(self.context)) 200 return 201 students_utils = getUtility(IStudentsUtils) 202 pre_text = _('Congratulations! Your acceptance fee and school fees ' + 203 'payments have been received and your matriculation ' + 204 'number generated with details as follows.') 205 return students_utils.renderPDFAdmissionLetter(self, 206 self.context.student, omit_fields=self.omit_fields, 207 pre_text=pre_text, post_text='') -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py
r15105 r15176 17 17 ## 18 18 from time import time 19 import grok 19 20 from zope.component import createObject, getUtility 20 21 from waeup.kofa.interfaces import (IKofaUtils, … … 246 247 payment.amount_auth = amount 247 248 return None, payment 249 250 def constructMatricNumber(self, student): 251 faccode = student.faccode 252 depcode = student.depcode 253 certcode = student.certcode 254 year = unicode(student.entry_session)[2:] 255 if not student.state in (PAID, ) or not student.is_fresh: 256 return _('Matriculation number cannot be set.'), None 257 258 # ESITM/ENG/MEC/11/5367 259 if student.current_mode == 'nd_ft': 260 next_integer = grok.getSite()['configuration'].next_matric_integer 261 if next_integer == 0: 262 return _('Matriculation number cannot be set.'), None 263 return None, "ESITM/%s/%s/%s/%05d" % ( 264 faccode, depcode, year, next_integer) 265 266 # ESITM/ENG/MEC/HND/11/5367 267 if student.current_mode == 'hnd_ft': 268 next_integer = grok.getSite()['configuration'].next_matric_integer_2 269 if next_integer == 0: 270 return _('Matriculation number cannot be set.'), None 271 return None, "ESITM/%s/%s/HND/%s/%05d" % ( 272 faccode, depcode, year, next_integer) 273 274 # ESITM/PT-ND/ENG/MEC/11/5367 275 if student.current_mode == 'nd_pt': 276 next_integer = grok.getSite()['configuration'].next_matric_integer_3 277 if next_integer == 0: 278 return _('Matriculation number cannot be set.'), None 279 return None, "ESITM/PT-ND/%s/%s/%s/%05d" % ( 280 faccode, depcode, year, next_integer) 281 282 # ??? 283 if student.current_mode == 'hnd_pt': 284 pass 285 286 return _('Matriculation number cannot be set.'), None -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/viewlets.py
r15000 r15176 20 20 from waeup.kofa.interfaces import REQUESTED 21 21 from waeup.kofa.browser.viewlets import ManageActionButton 22 from kofacustom.edopoly.students.interfaces import (23 ICustomStudentStudyCourse, ICustomStudentStudyLevel)24 22 from waeup.kofa.students.fileviewlets import ( 25 23 StudentFileDisplay, StudentFileUpload, StudentImage) 26 24 from waeup.kofa.students.browser import ( 27 25 ExportPDFClearanceSlip, StudyCourseDisplayFormPage, 28 StudyLevelDisplayFormPage) 26 StudyLevelDisplayFormPage, StudentBaseDisplayFormPage) 27 from waeup.kofa.students.interfaces import IStudent 28 29 from kofacustom.edopoly.students.interfaces import ( 30 ICustomStudentStudyCourse, ICustomStudentStudyLevel) 29 31 30 32 from kofacustom.nigeria.interfaces import MessageFactory as _ 33 34 class GetMatricNumberActionButton(ManageActionButton): 35 grok.order(10) 36 grok.context(IStudent) 37 grok.view(StudentBaseDisplayFormPage) 38 grok.require('waeup.viewStudent') 39 #grok.require('waeup.manageStudent') 40 icon = 'actionicon_count.png' 41 text = _('Get Matriculation Number') 42 43 @property 44 def target_url(self): 45 students_utils = getUtility(IStudentsUtils) 46 if self.context.matric_number: 47 return '' 48 error, matric_number = students_utils.constructMatricNumber( 49 self.context) 50 if error: 51 return '' 52 return self.view.url(self.view.context, 'get_matric_number') 53 54 class MatricNumberSlipActionButton(ManageActionButton): 55 grok.order(10) 56 grok.context(IStudent) 57 grok.view(StudentBaseDisplayFormPage) 58 grok.require('waeup.viewStudent') 59 icon = 'actionicon_pdf.png' 60 text = _('Download matriculation number slip') 61 target = 'matric_number_slip.pdf' 62 63 @property 64 def target_url(self): 65 if self.context.state not in (PAID,) or not self.context.is_fresh \ 66 or not self.context.matric_number: 67 return '' 68 return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.