Index: /main/waeup.custom/trunk/src/waeup/custom/applicants/sample_applicant_data.csv
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/applicants/sample_applicant_data.csv	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/applicants/sample_applicant_data.csv	(revision 7995)
@@ -1,4 +1,4 @@
-container_code,reg_number,firstname,lastname,date_of_birth,email,course1
-pg2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1
-pg2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1
-pg2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1
+container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex
+pg2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1,m
+pg2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1,m
+pg2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1,m
Index: /main/waeup.custom/trunk/src/waeup/custom/etranzact/tests.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/etranzact/tests.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/etranzact/tests.py	(revision 7995)
@@ -48,7 +48,7 @@
         # Managers can add online payment tickets
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         IWorkflowState(self.student).setState('cleared')
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
Index: /main/waeup.custom/trunk/src/waeup/custom/interswitch/tests.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/interswitch/tests.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/interswitch/tests.py	(revision 7995)
@@ -45,7 +45,7 @@
         super(InterswitchTests, self).setUp()
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         IWorkflowState(self.student).setState('cleared')
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
Index: /main/waeup.custom/trunk/src/waeup/custom/students/browser.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/students/browser.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/students/browser.py	(revision 7995)
@@ -24,8 +24,10 @@
     StudentPersonalDisplayFormPage, StudentPersonalManageFormPage,
     StudentClearanceManageFormPage, StudentClearanceEditFormPage,
-    StudentClearanceDisplayFormPage)
+    StudentClearanceDisplayFormPage,
+    ExportPDFClearanceSlipPage)
 from waeup.kofa.students.viewlets import RequestCallbackActionButton
 from waeup.custom.students.interfaces import (
-    IStudent, IStudentPersonal, IStudentClearance, IStudentClearanceEdit,
+    IStudent, IStudentPersonal,
+    IUGStudentClearance,IPGStudentClearance,
     )
 from waeup.custom.interfaces import MessageFactory as _
@@ -48,6 +50,29 @@
     """
     grok.context(IStudent)
-    form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')
-    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
+
+    @property
+    def form_fields(self):
+        cm = getattr(self.context,'current_mode', None)
+        if cm is not None and cm.startswith('pg'):
+            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
+        else:
+            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
+        form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
+        return form_fields
+
+class ExportPDFClearanceSlipPage(ExportPDFClearanceSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    grok.context(IStudent)
+
+    @property
+    def form_fields(self):
+        cm = getattr(self.context,'current_mode', None)
+        if cm is not None and cm.startswith('pg'):
+            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
+        else:
+            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
+        form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
+        return form_fields
 
 class StudentClearanceManageFormPage(StudentClearanceManageFormPage):
@@ -55,6 +80,14 @@
     """
     grok.context(IStudent)
-    form_fields = grok.AutoFields(IStudentClearance)
-    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
+
+    @property
+    def form_fields(self):
+        cm = getattr(self.context,'current_mode', None)
+        if cm is not None and cm.startswith('pg'):
+            form_fields = grok.AutoFields(IPGStudentClearance)
+        else:
+            form_fields = grok.AutoFields(IUGStudentClearance)
+        form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
+        return form_fields
 
 class StudentClearanceEditFormPage(StudentClearanceEditFormPage):
@@ -62,7 +95,14 @@
     """
     grok.context(IStudent)
-    form_fields = grok.AutoFields(
-        IStudentClearanceEdit).omit('clearance_locked')
-    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
+
+    @property
+    def form_fields(self):
+        cm = getattr(self.context,'current_mode', None)
+        if cm is not None and cm.startswith('pg'):
+            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
+        else:
+            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
+        form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
+        return form_fields
 
 class RequestCallbackActionButton(RequestCallbackActionButton):
Index: /main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py	(revision 7995)
@@ -20,5 +20,6 @@
 from waeup.kofa.interfaces import SimpleKofaVocabulary
 from waeup.kofa.students.interfaces import (
-    IStudentBase,IStudentClearance,IStudentPersonal,IStudentNavigation,
+    IStudentBase,IUGStudentClearance,IPGStudentClearance,
+    IStudentPersonal,IStudentNavigation,
     )
 from waeup.kofa.students.vocabularies import (
@@ -51,6 +52,6 @@
         )
 
-class IStudentClearance(IStudentClearance):
-    """Representation of student clearance data.
+class IUGStudentClearance(IUGStudentClearance):
+    """Representation of ug student clearance data.
 
     """
@@ -73,18 +74,11 @@
         )
 
-class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
+class IPGStudentClearance(IUGStudentClearance):
+    """Representation of pg student clearance data.
+
+    """
+
+class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,IStudentPersonal):
     """Representation of a student.
 
     """
-
-# Interfaces for students only
-
-class IStudentClearanceEdit(IStudentClearance):
-    """Interface needed for restricted editing of student clearance data.
-
-    """
-
-class IStudentPersonalEdit(IStudentPersonal):
-    """Interface needed for restricted editing of student personal data.
-
-    """
Index: /main/waeup.custom/trunk/src/waeup/custom/students/student.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/students/student.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/students/student.py	(revision 7995)
@@ -23,7 +23,5 @@
 from waeup.kofa.utils.helpers import attrs_to_fields
 from waeup.kofa.students.student import Student, StudentFactory
-from waeup.custom.students.interfaces import (
-    IStudent, IStudentNavigation,
-    IStudentPersonalEdit, IStudentClearanceEdit)
+from waeup.custom.students.interfaces import IStudent, IStudentNavigation
 
 
@@ -32,6 +30,5 @@
     owned by students.
     """
-    grok.implements(IStudent, IStudentNavigation,
-        IStudentPersonalEdit, IStudentClearanceEdit)
+    grok.implements(IStudent, IStudentNavigation)
     grok.provides(IStudent)
 
Index: /main/waeup.custom/trunk/src/waeup/custom/students/tests/sample_student_data.csv
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/students/tests/sample_student_data.csv	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/students/tests/sample_student_data.csv	(revision 7995)
@@ -1,4 +1,4 @@
-firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,lga,nationality
-Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
-Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234
-Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234
+firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex
+Aaren,Pieri,1,,100000,aa@aa.ng,1234,m
+Aaren,Finau,2,,100001,aa@aa.ng,1234,m
+Aaren,Berson,3,,100002,aa@aa.ng,1234,m
Index: /main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py	(revision 7994)
+++ /main/waeup.custom/trunk/src/waeup/custom/students/tests/test_browser.py	(revision 7995)
@@ -72,6 +72,6 @@
 
     def test_import(self):
-        # We added empty columns 'nationality' and 'lga' to the import file.
-        # The original processor will fail because these fields are required
+        # We have an empty column 'date_of_birth' in  the import file.
+        # The original processor will fail because 'date_of_birth' is required
         # in the base package.
         num, num_warns, fin_file, fail_file = self.processor_base.doImport(
@@ -79,8 +79,9 @@
         self.assertEqual(num_warns,3)
         assert len(self.app['students'].keys()) == 0
-        # The customized processor does not complain since both fields are
+        # The customized processor does not complain since 'date_of_birth' is
         # not required in the custom package.
         num, num_warns, fin_file, fail_file = self.processor.doImport(
             self.csv_file, STUDENT_HEADER_FIELDS)
+        #print open(fail_file).read()
         self.assertEqual(num_warns,0)
         assert len(self.app['students'].keys()) == 3
@@ -103,5 +104,5 @@
         # Managers can add online payment tickets
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl("Create ticket").click()
@@ -109,5 +110,5 @@
                            self.browser.contents)
         IWorkflowState(self.student).setState('cleared')
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
@@ -122,5 +123,5 @@
         ticket.p_state = 'paid'
         IWorkflowState(self.student).setState('returning')
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...This type of payment has already been made...',
@@ -130,27 +131,27 @@
         for payment in keys:
             del self.student['payments'][payment]
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
                            self.browser.contents)
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['gown']
         self.browser.getControl("Create ticket").click()
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['transfer']
         self.browser.getControl("Create ticket").click()
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(
             name="form.p_category").value = ['bed_allocation']
         self.browser.getControl("Create ticket").click()
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(
             name="form.p_category").value = ['hostel_maintenance']
         self.browser.getControl("Create ticket").click()
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['clearance']
         self.browser.getControl("Create ticket").click()
         self.certificate.study_mode = 'ug_pt'
-        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
         self.browser.getControl("Create ticket").click()
@@ -161,9 +162,7 @@
         # be shown
         del self.app['configuration']['2004']
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...Session configuration object is not...',
                            self.browser.contents)
-
-
