Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/applicants/utils.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/applicants/utils.py	(revision 17553)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/applicants/utils.py	(revision 17554)
@@ -41,3 +41,4 @@
         'de': ['Direct Entry Programmes', 'DEP'],
         'df': ['Digital Forensic for Professionals and Academia', 'DF'],
+        'law': ['Certificate in Law Programme', 'CL'],
         }
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py	(revision 17553)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py	(revision 17554)
@@ -26,4 +26,7 @@
 from waeup.kofa.browser.layout import KofaEditFormPage
 from waeup.kofa.browser.layout import action, jsaction
+from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID,
+    CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED,
+    GRADUATED, TRANSREQ, TRANSVAL, TRANSREL, FORBIDDEN_POSTGRAD_TRANS)
 from waeup.kofa.students.browser import (
     StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudyLevelManageFormPage,
@@ -31,6 +34,7 @@
     CourseTicketDisplayFormPage, CourseTicketManageFormPage,
     StudentTriggerTransitionFormPage,
+    ExportPDFAdmissionSlip,
     PaymentsManageFormPage, msave, emit_lock_message)
-from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket
+from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket, IStudentBase
 from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS
 from kofacustom.nigeria.students.browser import (
@@ -46,4 +50,5 @@
     )
 from kofacustom.unidel.students.interfaces import (
+    ICustomStudent,
     ICustomStudentOnlinePayment,
     ICustomStudentStudyCourse,
@@ -228,2 +233,63 @@
     form_fields['carry_over'].for_display = True
     form_fields['ticket_session'].for_display = True
+
+
+class ExaminationClearanceSlip(NigeriaExportPDFClearanceSlip):
+    """Deliver a PDF slip of the context.
+    """
+
+    grok.name('examclearance_slip.pdf')
+    omit_fields = (
+        'suspended',
+        #'phone',
+        'email',
+        'adm_code', 'suspended_comment',
+        'date_of_birth',
+        #'current_level',
+        'current_mode',
+        'entry_session',
+        'flash_notice',
+        'parents_email',
+        'certificate',
+        'faculty',
+        'department',
+        'reg_number')
+    form_fields = None
+
+    note = '''
+You have been cleared to write second semester examination.
+'''
+
+    def update(self):
+        if not  self.context.state in (VALIDATED, REGISTERED):
+            self.flash(_('Your course list has not yet been registered.'),
+                type="warning")
+            self.redirect(self.url(self.context))
+            return
+
+    @property
+    def label(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        return translate(_('Examination Clearance Slip of'),
+            'waeup.kofa', target_language=portal_language) \
+            + ' %s' % self.context.display_fullname
+
+    def _sigsInFooter(self):
+        #isStudent = getattr(
+        #    self.request.principal, 'user_type', None) == 'student'
+        #if not isStudent and self.context.state in (CLEARED, RETURNING):
+
+        return (_('Date, DICT Signature'),
+                _('Date, Dean\'s Signature'),
+                    )
+    def render(self):
+        studentview = StudentBasePDFFormPage(self.context.student,
+            self.request, self.omit_fields)
+        students_utils = getUtility(IStudentsUtils)
+        return students_utils.renderPDF(
+            self, 'examclearance_slip.pdf',
+            self.context.student, studentview, signatures=None,
+            sigs_in_footer=self._sigsInFooter(), show_scans=False,
+            omit_fields=self.omit_fields,
+            note=self.note)
+
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py	(revision 17553)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py	(revision 17554)
@@ -33,4 +33,5 @@
 from waeup.kofa.interfaces import (
     IExtFileStore, IFileStoreNameChooser)
+from waeup.kofa.browser.tests.test_pdf import samples_dir
 from waeup.kofa.students.interfaces import IStudentsUtils
 from kofacustom.unidel.testing import FunctionalLayer
@@ -42,4 +43,19 @@
     layer = FunctionalLayer
 
-    def test_dummytest(self):
-        return
+    def test_student_examclearance_slip(self):
+        self.certificate.study_mode = 'ug_ft'
+        # Student cant login if their password is not set
+        IWorkflowState(self.student).setState('courses registered')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.assertMatches(
+            '...You logged in...', self.browser.contents)
+        self.browser.getLink("Base Data").click()
+        self.browser.getLink("Download examination clearance slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        path = os.path.join(samples_dir(), 'examclearance_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample exampclearance_slip.pdf written to %s" % path
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/viewlets.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/viewlets.py	(revision 17553)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/viewlets.py	(revision 17554)
@@ -20,11 +20,26 @@
 from waeup.kofa.interfaces import REQUESTED
 from waeup.kofa.browser.viewlets import ManageActionButton
-from kofacustom.unidel.students.interfaces import (
+from kofacustom.unidel.students.interfaces import (ICustomStudent,
     ICustomStudentStudyCourse, ICustomStudentStudyLevel)
 from waeup.kofa.students.fileviewlets import (
     StudentFileDisplay, StudentFileUpload, StudentImage)
-from waeup.kofa.students.browser import (
+from waeup.kofa.students.browser import (StudentBaseDisplayFormPage,
     ExportPDFClearanceSlip, StudyCourseDisplayFormPage,
     StudyLevelDisplayFormPage)
 
 from kofacustom.nigeria.interfaces import MessageFactory as _
+
+class ExamClearanceSlipActionButton(ManageActionButton):
+    grok.order(10)
+    grok.context(ICustomStudent)
+    grok.view(StudentBaseDisplayFormPage)
+    grok.require('waeup.viewStudent')
+    text = _('Download examination clearance slip')
+    target = 'examclearance_slip.pdf'
+    icon = 'actionicon_pdf.png'
+
+    @property
+    def target_url(self):
+        #if not self.context.state in :
+        #    return ''
+        return self.view.url(self.view.context, self.target)
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/utils/utils.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/utils/utils.py	(revision 17553)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/utils/utils.py	(revision 17554)
@@ -81,4 +81,5 @@
         'ug_pt': 'Undergraduate Part-Time Programmes',
         'df': 'Digital Forensic for Professionals and Academia',
+        'law': 'Certificate in Law Programme',
         }
 
