Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/browser/pages.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/browser/pages.py	(revision 15794)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/browser/pages.py	(revision 15802)
@@ -19,6 +19,8 @@
 from waeup.kofa.browser.pages import (
     SessionConfigurationAddFormPage, SessionConfigurationManageFormPage,
-    LoginPage, CertificatePage, CertificateManageFormPage)
+    LoginPage, CertificatePage, CertificateManageFormPage,
+    ConfigurationContainerManageFormPage)
 from waeup.kofa.university.interfaces import ICertificate
+from waeup.kofa.interfaces import IConfigurationContainer
 from kofacustom.iuokada.interfaces import (
     ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
@@ -28,4 +30,15 @@
     """
     form_fields = grok.AutoFields(ICustomSessionConfigurationAdd)
+
+class CustomConfigurationContainerManageFormPage(
+    ConfigurationContainerManageFormPage):
+
+    form_fields = grok.AutoFields(IConfigurationContainer).omit(
+        'frontpage_dict',
+        'next_matric_integer_2',
+        'next_matric_integer_3',
+        'next_matric_integer_4',
+        )
+    form_fields['maintmode_enabled_by'].for_display = True
 
 class CustomSessionConfigurationManageFormPage(SessionConfigurationManageFormPage):
Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py	(revision 15794)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py	(revision 15802)
@@ -23,6 +23,6 @@
 from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils
 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
-from waeup.kofa.browser.layout import KofaEditFormPage
-from waeup.kofa.browser.layout import action, jsaction
+from waeup.kofa.browser.layout import (
+    action, jsaction, UtilityView, KofaEditFormPage)
 from waeup.kofa.students.browser import (
     StudyLevelEditFormPage, StudyLevelDisplayFormPage,
@@ -30,5 +30,6 @@
     CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
     msave, emit_lock_message)
-from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket
+from waeup.kofa.students.interfaces import (
+    IStudentsUtils, ICourseTicket, IStudent)
 from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS
 from kofacustom.nigeria.students.browser import (
@@ -101,2 +102,23 @@
     with_ac = False
     with_bedselection = True
+
+class StudentGetMatricNumberPage(UtilityView, grok.View):
+    """ Construct and set the matriculation number.
+    """
+    grok.context(IStudent)
+    grok.name('get_matric_number')
+    grok.require('waeup.viewStudent')
+
+    def update(self):
+        students_utils = getUtility(IStudentsUtils)
+        msg, mnumber = students_utils.setMatricNumber(self.context)
+        if msg:
+            self.flash(msg, type="danger")
+        else:
+            self.flash(_('Matriculation number %s assigned.' % mnumber))
+            self.context.writeLogMessage(self, '%s assigned' % mnumber)
+        self.redirect(self.url(self.context))
+        return
+
+    def render(self):
+        return
Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py	(revision 15794)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py	(revision 15802)
@@ -16,4 +16,5 @@
 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##
+import grok
 from time import time
 from zope.component import createObject, getUtility
@@ -185,2 +186,12 @@
         payment.p_combi = combi
         return None, payment
+
+    def constructMatricNumber(self, student):
+        """Fetch the matric number counter which fits the student and
+        construct the new matric number of the student.
+        """
+        next_integer = grok.getSite()['configuration'].next_matric_integer
+        if next_integer == 0:
+            return _('Matriculation number cannot be set.'), None
+        year = unicode(student.entry_session)[2:]
+        return None, "%s/%06d" % (year, next_integer)
Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py	(revision 15794)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py	(revision 15802)
@@ -18,6 +18,8 @@
 
 import grok
+from zope.component import getUtility
 from waeup.kofa.interfaces import REQUESTED
 from waeup.kofa.browser.viewlets import ManageActionButton
+from waeup.kofa.students.interfaces import IStudent, IStudentsUtils
 from kofacustom.iuokada.students.interfaces import (
     ICustomStudentStudyCourse, ICustomStudentStudyLevel)
@@ -26,7 +28,26 @@
 from waeup.kofa.students.browser import (
     ExportPDFClearanceSlip, StudyCourseDisplayFormPage,
-    StudyLevelDisplayFormPage)
+    StudyLevelDisplayFormPage, StudentBaseDisplayFormPage)
 
 from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class GetMatricNumberActionButton(ManageActionButton):
+    grok.order(10)
+    grok.context(IStudent)
+    grok.view(StudentBaseDisplayFormPage)
+    grok.require('waeup.viewStudent')
+    icon = 'actionicon_count.png'
+    text = _('Get Matriculation Number')
+
+    @property
+    def target_url(self):
+        students_utils = getUtility(IStudentsUtils)
+        if self.context.matric_number:
+            return ''
+        error, matric_number = students_utils.constructMatricNumber(
+            self.context)
+        if error:
+            return ''
+        return self.view.url(self.view.context, 'get_matric_number')
 
 # Signature
