Changeset 15802 for main/kofacustom.iuokada/trunk
- Timestamp:
- 12 Nov 2019, 22:16:57 (5 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/browser/pages.py
r15661 r15802 19 19 from waeup.kofa.browser.pages import ( 20 20 SessionConfigurationAddFormPage, SessionConfigurationManageFormPage, 21 LoginPage, CertificatePage, CertificateManageFormPage) 21 LoginPage, CertificatePage, CertificateManageFormPage, 22 ConfigurationContainerManageFormPage) 22 23 from waeup.kofa.university.interfaces import ICertificate 24 from waeup.kofa.interfaces import IConfigurationContainer 23 25 from kofacustom.iuokada.interfaces import ( 24 26 ICustomSessionConfiguration, ICustomSessionConfigurationAdd) … … 28 30 """ 29 31 form_fields = grok.AutoFields(ICustomSessionConfigurationAdd) 32 33 class CustomConfigurationContainerManageFormPage( 34 ConfigurationContainerManageFormPage): 35 36 form_fields = grok.AutoFields(IConfigurationContainer).omit( 37 'frontpage_dict', 38 'next_matric_integer_2', 39 'next_matric_integer_3', 40 'next_matric_integer_4', 41 ) 42 form_fields['maintmode_enabled_by'].for_display = True 30 43 31 44 class CustomSessionConfigurationManageFormPage(SessionConfigurationManageFormPage): -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py
r15722 r15802 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 action, jsaction, UtilityView, KofaEditFormPage) 27 27 from waeup.kofa.students.browser import ( 28 28 StudyLevelEditFormPage, StudyLevelDisplayFormPage, … … 30 30 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, 31 31 msave, emit_lock_message) 32 from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket 32 from waeup.kofa.students.interfaces import ( 33 IStudentsUtils, ICourseTicket, IStudent) 33 34 from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS 34 35 from kofacustom.nigeria.students.browser import ( … … 101 102 with_ac = False 102 103 with_bedselection = True 104 105 class StudentGetMatricNumberPage(UtilityView, grok.View): 106 """ Construct and set the matriculation number. 107 """ 108 grok.context(IStudent) 109 grok.name('get_matric_number') 110 grok.require('waeup.viewStudent') 111 112 def update(self): 113 students_utils = getUtility(IStudentsUtils) 114 msg, mnumber = students_utils.setMatricNumber(self.context) 115 if msg: 116 self.flash(msg, type="danger") 117 else: 118 self.flash(_('Matriculation number %s assigned.' % mnumber)) 119 self.context.writeLogMessage(self, '%s assigned' % mnumber) 120 self.redirect(self.url(self.context)) 121 return 122 123 def render(self): 124 return -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
r15780 r15802 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 import grok 18 19 from time import time 19 20 from zope.component import createObject, getUtility … … 185 186 payment.p_combi = combi 186 187 return None, payment 188 189 def constructMatricNumber(self, student): 190 """Fetch the matric number counter which fits the student and 191 construct the new matric number of the student. 192 """ 193 next_integer = grok.getSite()['configuration'].next_matric_integer 194 if next_integer == 0: 195 return _('Matriculation number cannot be set.'), None 196 year = unicode(student.entry_session)[2:] 197 return None, "%s/%06d" % (year, next_integer) -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py
r15654 r15802 18 18 19 19 import grok 20 from zope.component import getUtility 20 21 from waeup.kofa.interfaces import REQUESTED 21 22 from waeup.kofa.browser.viewlets import ManageActionButton 23 from waeup.kofa.students.interfaces import IStudent, IStudentsUtils 22 24 from kofacustom.iuokada.students.interfaces import ( 23 25 ICustomStudentStudyCourse, ICustomStudentStudyLevel) … … 26 28 from waeup.kofa.students.browser import ( 27 29 ExportPDFClearanceSlip, StudyCourseDisplayFormPage, 28 StudyLevelDisplayFormPage )30 StudyLevelDisplayFormPage, StudentBaseDisplayFormPage) 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 icon = 'actionicon_count.png' 40 text = _('Get Matriculation Number') 41 42 @property 43 def target_url(self): 44 students_utils = getUtility(IStudentsUtils) 45 if self.context.matric_number: 46 return '' 47 error, matric_number = students_utils.constructMatricNumber( 48 self.context) 49 if error: 50 return '' 51 return self.view.url(self.view.context, 'get_matric_number') 31 52 32 53 # Signature
Note: See TracChangeset for help on using the changeset viewer.