Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 7993)
@@ -49,5 +49,6 @@
 from waeup.kofa.widgets.phonewidget import PhoneWidget
 from waeup.kofa.students.interfaces import (
-    IStudentsContainer, IStudent, IStudentClearance,
+    IStudentsContainer, IStudent,
+    IUGStudentClearance,IPGStudentClearance,
     IStudentPersonal, IStudentBase, IStudentStudyCourse,
     IStudentAccommodation, IStudentStudyLevel,
@@ -393,7 +394,15 @@
     grok.name('view_clearance')
     grok.require('waeup.viewStudent')
-    form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')
-    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
-    pnav = 4
+    pnav = 4
+
+    @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
 
     @property
@@ -408,7 +417,15 @@
     grok.name('clearance.pdf')
     grok.require('waeup.viewStudent')
-    form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')
-    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
     prefix = 'form'
+
+    @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
 
     @property
@@ -440,8 +457,16 @@
     grok.require('waeup.manageStudent')
     grok.template('clearanceeditpage')
-    form_fields = grok.AutoFields(IStudentClearance)
     label = _('Manage clearance data')
     pnav = 4
-    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
 
     def update(self):
@@ -1561,8 +1586,15 @@
     grok.name('cedit')
     grok.require('waeup.handleStudent')
-    form_fields = grok.AutoFields(
-        IStudentClearance).omit('clearance_locked')
     label = _('Edit clearance data')
-    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
 
     def update(self):
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 7993)
@@ -211,6 +211,6 @@
         )
 
-class IStudentClearance(IKofaObject):
-    """Representation of student clearance data.
+class IUGStudentClearance(IKofaObject):
+    """Representation of undergraduate student clearance data.
 
     """
@@ -238,4 +238,14 @@
         )
 
+class IPGStudentClearance(IUGStudentClearance):
+    """Representation of postgraduate student clearance data.
+
+    """
+    employer = schema.TextLine(
+        title = _(u'Employer'),
+        required = False,
+        readonly = False,
+        )
+
 class IStudentPersonal(IKofaObject):
     """Representation of student personal data.
@@ -247,5 +257,5 @@
         )
 
-class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
+class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,IStudentPersonal):
     """Representation of a student.
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 7993)
@@ -109,12 +109,13 @@
         self.student_path = self.container_path + '/' + self.student_id
         self.manage_student_path = self.student_path + '/manage_base'
-        self.clearance_student_path = self.student_path + '/view_clearance'
-        self.personal_student_path = self.student_path + '/view_personal'
-        self.edit_clearance_student_path = self.student_path + '/edit_clearance'
-        self.edit_personal_student_path = self.student_path + '/edit_personal'
-        self.studycourse_student_path = self.student_path + '/studycourse'
-        self.payments_student_path = self.student_path + '/payments'
-        self.acco_student_path = self.student_path + '/accommodation'
-        self.history_student_path = self.student_path + '/history'
+        self.clearance_path = self.student_path + '/view_clearance'
+        self.personal_path = self.student_path + '/view_personal'
+        self.edit_clearance_path = self.student_path + '/cedit'
+        self.manage_clearance_path = self.student_path + '/edit_clearance'
+        self.edit_personal_path = self.student_path + '/edit_personal'
+        self.studycourse_path = self.student_path + '/studycourse'
+        self.payments_path = self.student_path + '/payments'
+        self.acco_path = self.student_path + '/accommodation'
+        self.history_path = self.student_path + '/history'
 
         # Create 5 access codes with prefix'PWD'
@@ -399,8 +400,8 @@
         self.browser.getLink("Clearance Data").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.clearance_student_path)
+        self.assertEqual(self.browser.url, self.clearance_path)
         self.browser.getLink("Manage").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.edit_clearance_student_path)
+        self.assertEqual(self.browser.url, self.manage_clearance_path)
         self.browser.getControl(name="form.date_of_birth").value = '09/10/1961'
         self.browser.getControl("Save").click()
@@ -411,8 +412,8 @@
         self.browser.getLink("Personal Data").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.personal_student_path)
+        self.assertEqual(self.browser.url, self.personal_path)
         self.browser.getLink("Edit").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.edit_personal_student_path)
+        self.assertEqual(self.browser.url, self.edit_personal_path)
         self.browser.getControl("Save").click()
         self.assertMatches('...Form has been saved...',
@@ -423,13 +424,13 @@
         self.browser.getLink("Payments").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.payments_student_path)
+        self.assertEqual(self.browser.url, self.payments_path)
         self.browser.open(self.student_path)
         self.browser.getLink("Accommodation").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.acco_student_path)
+        self.assertEqual(self.browser.url, self.acco_path)
         self.browser.open(self.student_path)
         self.browser.getLink("History").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.history_student_path)
+        self.assertEqual(self.browser.url, self.history_path)
         self.assertMatches('...Student admitted by Manager...',
                            self.browser.contents)
@@ -477,5 +478,5 @@
         # The image is stored even if form has errors
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.edit_clearance_student_path)
+        self.browser.open(self.manage_clearance_path)
         # No birth certificate has been uploaded yet
         # Browsing the link shows a placerholder image
@@ -486,5 +487,5 @@
         # Create a pseudo image file and select it to be uploaded in form
         # as birth certificate
-        self.browser.open(self.edit_clearance_student_path)
+        self.browser.open(self.manage_clearance_path)
         pseudo_image = StringIO('I pretend to be a graphics file')
         ctrl = self.browser.getControl(name='birthcertificateupload')
@@ -514,5 +515,5 @@
         self.assertEqual(len(self.browser.contents), 31)
         # Reuploading a file which is bigger than 150k will raise an error
-        self.browser.open(self.edit_clearance_student_path)
+        self.browser.open(self.manage_clearance_path)
         photo_content = 'A' * 1024 * 151  # A string of 21 KB size
         pseudo_image = StringIO(photo_content)
@@ -551,5 +552,5 @@
             'birth_certificate deleted' in self.browser.contents)
         # Managers can add and delete second file
-        self.browser.open(self.edit_clearance_student_path)
+        self.browser.open(self.manage_clearance_path)
         pseudo_image = StringIO('I pretend to be a graphics file')
         ctrl = self.browser.getControl(name='birthcertificateupload')
@@ -609,5 +610,5 @@
         self.browser.getLink("Study Course").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.studycourse_student_path)
+        self.assertEqual(self.browser.url, self.studycourse_path)
         self.assertTrue('Undergraduate Full-Time' in self.browser.contents)
         self.browser.getLink("Manage").click()
@@ -840,7 +841,7 @@
             self.browser.contents)
         # CO can view the student ...
-        self.browser.open(self.clearance_student_path)
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.url, self.clearance_student_path)
+        self.browser.open(self.clearance_path)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.url, self.clearance_path)
         # ... but not other students
         other_student = Student()
@@ -853,8 +854,8 @@
             Unauthorized, self.browser.open, other_student_path)
         # Only in state clearance requested the CO does see the 'Clear' button
-        self.browser.open(self.clearance_student_path)
+        self.browser.open(self.clearance_path)
         self.assertFalse('Clear student' in self.browser.contents)
         IWorkflowInfo(self.student).fireTransition('request_clearance')
-        self.browser.open(self.clearance_student_path)
+        self.browser.open(self.clearance_path)
         self.assertTrue('Clear student' in self.browser.contents)
         self.browser.getLink("Clear student").click()
@@ -869,5 +870,5 @@
         self.assertTrue('clearance started' in self.browser.contents)
         IWorkflowInfo(self.student).fireTransition('request_clearance')
-        self.browser.open(self.clearance_student_path)
+        self.browser.open(self.clearance_path)
         self.browser.getLink("Reject clearance").click()
         self.assertTrue('Clearance request has been rejected'
@@ -941,5 +942,5 @@
         self.student['studycourse'].addStudentStudyLevel(
             cert,studylevel)
-        L110_student_path = self.studycourse_student_path + '/110'
+        L110_student_path = self.studycourse_path + '/110'
         # Only in state courses registered and only if the current level
         # corresponds with the name of the study level object
@@ -958,5 +959,5 @@
         self.student['studycourse'].addStudentStudyLevel(
             cert,studylevel2)
-        L200_student_path = self.studycourse_student_path + '/200'
+        L200_student_path = self.studycourse_path + '/200'
         self.browser.open(L200_student_path)
         self.assertFalse('Validate' in self.browser.contents)
@@ -1220,5 +1221,5 @@
         # if certain requirements are met
         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(name="form.p_category").value = ['schoolfee']
@@ -1240,5 +1241,5 @@
         # The same payment (with same p_item, p_session and p_category)
         # can be initialized a second time if the former ticket is not yet paid.
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
@@ -1261,5 +1262,5 @@
         # Now the first ticket is paid and no more ticket of same type
         # (with same p_item, p_session and p_category) can be added
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
@@ -1276,5 +1277,5 @@
 
         # Managers can remove online school fee payment tickets
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Remove selected").click()
         self.assertMatches('...No payment selected...', self.browser.contents)
@@ -1286,5 +1287,5 @@
 
         # Managers can add online clearance payment tickets
-        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()
@@ -1320,5 +1321,5 @@
 
         # Students can add online clearance payment tickets
-        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()
@@ -1375,5 +1376,5 @@
 
         # Students can add online school fee payment tickets
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
@@ -1395,11 +1396,11 @@
         # Students can remove only online payment tickets which have
         # not received a valid callback
-        self.browser.open(self.payments_student_path)
+        self.browser.open(self.payments_path)
         self.assertRaises(
             LookupError, self.browser.getControl, name='val_id')
-        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)
+        self.browser.open(self.payments_path)
         ctrl = self.browser.getControl(name='val_id')
         value = ctrl.options[0]
@@ -1411,5 +1412,5 @@
         IWorkflowInfo(self.student).fireTransition('request_clearance')
         IWorkflowInfo(self.student).fireTransition('clear')
-        self.browser.open(self.studycourse_student_path)
+        self.browser.open(self.studycourse_path)
         self.browser.getLink('Start course registration').click()
         pin = self.app['accesscodes']['SFE-0'].keys()[0]
@@ -1428,5 +1429,5 @@
         # callback view (see test_manage_payments)
         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(name="form.p_category").value = ['bed_allocation']
@@ -1452,5 +1453,5 @@
         sfeseries, sfenumber = parts
         # Managers can use HOS code and book a bed space with it
-        self.browser.open(self.acco_student_path)
+        self.browser.open(self.acco_path)
         self.browser.getLink("Book accommodation").click()
         self.assertMatches('...You are in the wrong...',
@@ -1481,5 +1482,5 @@
             self.browser.contents)
         # The bed ticket displays the data correctly
-        self.browser.open(self.acco_student_path + '/2004')
+        self.browser.open(self.acco_path + '/2004')
         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
                            self.browser.contents)
@@ -1529,5 +1530,5 @@
         self.assertMatches(old_owner, self.student_id)
         bed2.owner = self.student_id
-        self.browser.open(self.acco_student_path + '/2004')
+        self.browser.open(self.acco_path + '/2004')
         self.assertMatches(
             "...booking cancelled...", self.browser.contents)
@@ -1545,5 +1546,5 @@
             "... Hall 1, Block A, Room 101, Bed B...", self.browser.contents)
           # Managers can delete bed tickets
-        self.browser.open(self.acco_student_path)
+        self.browser.open(self.acco_path)
         ctrl = self.browser.getControl(name='val_id')
         value = ctrl.options[0]
@@ -1582,5 +1583,5 @@
 
         # Students can use HOS code and book a bed space with it
-        self.browser.open(self.acco_student_path)
+        self.browser.open(self.acco_path)
         self.browser.getLink("Book accommodation").click()
         self.assertMatches('...You are in the wrong...',
@@ -1617,5 +1618,5 @@
 
         # The bed ticket displays the data correctly
-        self.browser.open(self.acco_student_path + '/2004')
+        self.browser.open(self.acco_path + '/2004')
         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
                            self.browser.contents)
@@ -1631,10 +1632,10 @@
         # Students can't relocate themselves
         self.assertFalse('Relocate' in self.browser.contents)
-        relocate_path = self.acco_student_path + '/2004/relocate'
+        relocate_path = self.acco_path + '/2004/relocate'
         self.assertRaises(
             Unauthorized, self.browser.open, relocate_path)
 
         # Students can't the Remove button and check boxes
-        self.browser.open(self.acco_student_path)
+        self.browser.open(self.acco_path)
         self.assertFalse('Remove' in self.browser.contents)
         self.assertFalse('val_id' in self.browser.contents)
@@ -1664,2 +1665,21 @@
         results = cat.searchResults(student_id=(None, None))
         self.assertEqual(len(results),1)
+
+    def test_change_current_mode(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.clearance_path)
+        self.assertFalse('Employer' in self.browser.contents)
+        self.browser.open(self.manage_clearance_path)
+        self.assertFalse('Employer' in self.browser.contents)
+        self.student.clearance_locked = False
+        self.browser.open(self.edit_clearance_path)
+        self.assertFalse('Employer' in self.browser.contents)
+        # Now we change the study mode of the certificate and a different
+        # interface is used by clearance views
+        self.certificate.study_mode = 'pg_ft'
+        self.browser.open(self.clearance_path)
+        self.assertTrue('Employer' in self.browser.contents)
+        self.browser.open(self.manage_clearance_path)
+        self.assertTrue('Employer' in self.browser.contents)
+        self.browser.open(self.edit_clearance_path)
+        self.assertTrue('Employer' in self.browser.contents)
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 7993)
@@ -66,9 +66,9 @@
         self.assertEqual(
             result,
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,'
+            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
             'firstname,lastname,matric_number,middlename,nationality,'
             'perm_address,phone,reg_number,sex,student_id\r\n'
 
-            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,Anna,'
+            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,Anna,'
             'Tester,M123456,M.,nigeria,"Studentroad 21\nLagos 123456\n",'
             '+234-123-12345,123456,f,A111111\r\n'
@@ -85,9 +85,9 @@
         self.assertEqual(
             result,
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,'
+            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
             'firstname,lastname,matric_number,middlename,nationality,'
             'perm_address,phone,reg_number,sex,student_id\r\n'
 
-            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,Anna,'
+            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,Anna,'
             'Tester,M123456,M.,nigeria,"Studentroad 21\nLagos 123456\n",'
             '+234-123-12345,123456,f,A111111\r\n'
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 7993)
@@ -380,5 +380,5 @@
 
     VERDICTS_DICT = {
-        '0': 'not yet',
+        '0': _('(not yet)'),
         'A': 'Successful student',
         'B': 'Student with carryover courses',
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 7983)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 7993)
@@ -41,5 +41,5 @@
     AccommodationManageFormPage, BedTicketDisplayFormPage,)
 from waeup.kofa.students.interfaces import (
-    IStudentsContainer, IStudent, IStudentClearance,
+    IStudentsContainer, IStudent,
     IStudentStudyCourse, IStudentAccommodation, IStudentStudyLevel,
     ICourseTicket, IStudentOnlinePayment, IBedTicket,
@@ -600,5 +600,5 @@
     """
     grok.baseclass()
-    grok.context(IStudentClearance)
+    grok.context(IStudent)
     grok.viewletmanager(FileManager)
     grok.view(StudentClearanceDisplayFormPage)
@@ -623,5 +623,5 @@
     """
     grok.baseclass()
-    grok.context(IStudentClearance)
+    grok.context(IStudent)
     grok.viewletmanager(FileManager)
     grok.view(StudentClearanceManageFormPage)
@@ -744,5 +744,5 @@
     grok.baseclass()
     grok.name('none.jpg')
-    grok.context(IStudentClearance)
+    grok.context(IStudent)
     grok.require('waeup.viewStudent')
     download_name = u'none.jpg'
