Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9479)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9484)
@@ -390,6 +390,7 @@
     form_fields = grok.AutoFields(IContactForm).select('subject', 'body')
 
-    def update(self, subject=u''):
+    def update(self, subject=u'', body=u''):
         self.form_fields.get('subject').field.default = subject
+        self.form_fields.get('body').field.default = body
         self.subject = subject
         return
@@ -586,4 +587,8 @@
             form_fields = grok.AutoFields(
                 IUGStudentClearance).omit('clearance_locked')
+        if not getattr(self.context, 'clearance_comment'):
+            form_fields = form_fields.omit('clearance_comment')
+        else:
+            form_fields['clearance_comment'].custom_widget = BytesDisplayWidget
         return form_fields
 
@@ -610,4 +615,6 @@
             form_fields = grok.AutoFields(
                 IUGStudentClearance).omit('clearance_locked')
+        if not getattr(self.context, 'clearance_comment'):
+            form_fields = form_fields.omit('clearance_comment')
         return form_fields
 
@@ -694,12 +701,16 @@
         return
 
-class StudentRejectClearancePage(UtilityView, grok.View):
+class StudentRejectClearancePage(KofaEditFormPage):
     """ Reject clearance by clearance officers
     """
     grok.context(IStudent)
     grok.name('reject_clearance')
+    label = _('Reject clearance')
     grok.require('waeup.clearStudent')
-
-    def update(self):
+    form_fields = grok.AutoFields(
+        IUGStudentClearance).select('clearance_comment')
+
+    @action(_('Save comment and reject clearance now'), style='primary')
+    def reject(self, **data):
         if self.context.state == CLEARED:
             IWorkflowInfo(self.context).fireTransition('reset4')
@@ -714,11 +725,15 @@
             self.redirect(self.url(self.context,'view_clearance'))
             return
-        args = {'subject':message}
+        self.applyData(self.context, **data)
+        comment = data['clearance_comment']
+        self.context.writeLogMessage(
+            self, 'comment: %s' % comment.replace('\n', '<br>'))
+        args = {'subject':message, 'body':comment}
         self.redirect(self.url(self.context) +
             '/contactstudent?%s' % urlencode(args))
         return
 
-    def render(self):
-        return
+    #def render(self):
+    #    return
 
 class StudentPersonalDisplayFormPage(KofaDisplayFormPage):
@@ -1938,8 +1953,8 @@
         if self.context.is_postgrad:
             form_fields = grok.AutoFields(IPGStudentClearance).omit(
-                'clearance_locked', 'clr_code')
+                'clearance_locked', 'clr_code', 'clearance_comment')
         else:
             form_fields = grok.AutoFields(IUGStudentClearance).omit(
-                'clearance_locked', 'clr_code')
+                'clearance_locked', 'clr_code', 'clearance_comment')
         return form_fields
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 9479)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 9484)
@@ -274,4 +274,11 @@
         )
 
+    clearance_comment = schema.Text(
+        title = _(u"Officer's Comment"),
+        required = False,
+        #description = _(
+        #    u'This comment will be deleted when student is cleared.'),
+        )
+
 class IPGStudentClearance(IUGStudentClearance):
     """Representation of postgraduate student clearance data.
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 9479)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9484)
@@ -1209,10 +1209,36 @@
         self.browser.open(self.clearance_path)
         self.browser.getLink("Reject clearance").click()
+        self.assertEqual(
+            self.browser.url, self.student_path + '/reject_clearance')
+        # Type comment why
+        self.browser.getControl(name="form.clearance_comment").value = """Dear Student,
+You did not fill properly.
+"""
+        self.browser.getControl("Save comment").click()
         self.assertTrue('Clearance has been annulled' in self.browser.contents)
-        urlmessage = 'Clearance+has+been+annulled.'
-        # CO does now see the contact form
-        self.assertEqual(self.browser.url, self.student_path +
-            '/contactstudent?subject=%s' % urlmessage)
+        url = ('http://localhost/app/students/K1000000/'
+              'contactstudent?body=Dear+Student%2C%0AYou+did+not+fill+properly.'
+              '%0A&subject=Clearance+has+been+annulled.')
+        # CO does now see the prefilled contact form and can send a message
+        self.assertEqual(self.browser.url, url)
         self.assertTrue('clearance started' in self.browser.contents)
+        self.assertTrue('name="form.subject" size="20" type="text" '
+            'value="Clearance has been annulled."'
+            in self.browser.contents)
+        self.assertTrue('name="form.body" rows="10" >Dear Student,'
+            in self.browser.contents)
+        self.browser.getControl("Send message now").click()
+        self.assertTrue('Your message has been sent' in self.browser.contents)
+        # The comment has been stored ...
+        self.assertEqual(self.student.clearance_comment,
+            u'Dear Student,\nYou did not fill properly.\n')
+        # ... and logged
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'students.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            'INFO - mrclear - students.browser.StudentRejectClearancePage - '
+            'K1000000 - comment: Dear Student,<br>You did not fill '
+            'properly.<br>\n' in logcontent)
         self.browser.open(self.history_path)
         self.assertTrue("Reset to 'clearance started' by My Public Name" in
@@ -1221,12 +1247,8 @@
         self.browser.open(self.clearance_path)
         self.browser.getLink("Reject clearance").click()
+        self.browser.getControl("Save comment").click()
         self.assertTrue('Clearance request has been rejected'
             in self.browser.contents)
         self.assertTrue('clearance started' in self.browser.contents)
-        # CO does now also see the contact form and can send a message
-        self.browser.getControl(name="form.subject").value = 'Important subject'
-        self.browser.getControl(name="form.body").value = 'Clearance rejected'
-        self.browser.getControl("Send message now").click()
-        self.assertTrue('Your message has been sent' in self.browser.contents)
         # The CO can't clear students if not in state
         # clearance requested
@@ -1240,4 +1262,11 @@
         self.browser.getLink("Show students").click()
         self.assertTrue(self.student_id in self.browser.contents)
+
+
+        # When a student is cleared the comment is automatically deleted
+        IWorkflowInfo(self.student).fireTransition('request_clearance')
+        IWorkflowInfo(self.student).fireTransition('clear')
+        self.assertEqual(self.student.clearance_comment, None)
+
 
     def test_handle_courses_by_ca(self):
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 9479)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 9484)
@@ -43,10 +43,11 @@
         result = open(self.outfile, 'rb').read()
         self.assertTrue(
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
+            'adm_code,clearance_comment,clearance_locked,clr_code,'
+            'date_of_birth,email,employer,'
             'firstname,lastname,matric_number,middlename,nationality,'
             'perm_address,phone,reg_number,sex,student_id,suspended,password,'
             'state,history,certcode,is_postgrad,current_level,current_session\r\n'
 
-            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
+            'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
             '+234-123-12345#,123,f,A111111,0,,created'
@@ -63,10 +64,11 @@
         result = open(self.outfile, 'rb').read()
         self.assertTrue(
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
+            'adm_code,clearance_comment,clearance_locked,clr_code,'
+            'date_of_birth,email,employer,'
             'firstname,lastname,matric_number,middlename,nationality,'
             'perm_address,phone,reg_number,sex,student_id,suspended,password,'
             'state,history,certcode,is_postgrad,current_level,current_session\r\n'
 
-            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
+            'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
             '+234-123-12345#,123,f,A111111,0,,created'
@@ -82,10 +84,11 @@
         result = open(self.outfile, 'rb').read()
         self.assertTrue(
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
+            'adm_code,clearance_comment,clearance_locked,clr_code,'
+            'date_of_birth,email,employer,'
             'firstname,lastname,matric_number,middlename,nationality,'
             'perm_address,phone,reg_number,sex,student_id,suspended,password,'
             'state,history,certcode,is_postgrad,current_level,current_session\r\n'
 
-            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
+            'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,'
             'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",'
             '+234-123-12345#,123,f,A111111,0,,created'
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py	(revision 9479)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py	(revision 9484)
@@ -256,4 +256,6 @@
             level_object.validated_by = usertitle
             level_object.validation_date = datetime.utcnow()
+    elif event.transition.transition_id == 'clear':
+        obj.clearance_comment = None
     elif event.transition.transition_id == 'reset8':
         current_level = obj['studycourse'].current_level
