Index: WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py	(revision 1513)
+++ WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py	(revision 1513)
@@ -0,0 +1,18 @@
+## Script (Python) "isClearanceOfficer"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: isClearanceOfficer.py 1087 2006-12-18 22:13:31Z joachim $
+
+#from Products.zdb import set_trace
+#set_trace()
+if context.isStudent():
+    return False
+mtool = context.portal_membership
+roles = mtool.getAuthenticatedMember().getRolesInContext(context)
+return context.isSectionOfficer or "ClearanceOfficer" in roles
Index: WAeUP_SRP/trunk/skins/waeup_student/courses_validated_slip.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/courses_validated_slip.pt	(revision 1513)
+++ WAeUP_SRP/trunk/skins/waeup_student/courses_validated_slip.pt	(revision 1513)
@@ -0,0 +1,70 @@
+<metal:html tal:define="info context/getStudyLevelInfo;
+                  is_so context/isSectionOfficer;
+                  is_ca info/is_ca;
+                  show_check_boxes info/show_check_boxes;
+		  is_student info/is_student;
+		  status_info info/status_info;
+		  review_state info/review_state;
+		  view_only info/view_only">
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+      <span tal:condition="not: info">
+        <span tal:content="here/illegal_view" />
+      </span>
+      <span tal:condition="info">
+      <h3>Validated Courses Slip</h3>
+      <form action="." method="post" class="group">
+        <span tal:condition="info/carry_overs" tal:omit-tag="">
+        <h3>Carryover Courses</h3>
+        <br />
+        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">
+          <tr tal:repeat="row info/carry_overs"
+              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td width="78%" tal:content="row/title"></td>
+            <td align="center" width="10%" tal:content="row/code"></td>
+            <td align="center" width="2%">S<span tal:content="row/semester" /></td>
+            <td align="center" width="2%" tal:content="row/credits"></td>
+            <td align="center" width="8%" tal:content="row/grade|string:"></td>
+          </tr>
+        </table>
+        </span>
+        <h3>Session Courses</h3>
+        <br />
+        <table class="contentListing" width="100%" summary="content layout" id="folder_content">      
+          <tr tal:repeat="row info/normal"
+              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td width="78%" tal:content="row/title"></td>
+            <td align="center" width="10%" tal:content="row/code"></td>
+            <td align="center" width="2%">S<span tal:content="row/semester" /></td>
+            <td align="center" width="2%" tal:content="row/credits"></td>
+            <td align="center" width="8%" tal:content="row/coe|nothing"></td>
+          </tr>
+          <tr>
+            <td colspan="1"></td>
+            <td colspan="1"></td>
+            <th colspan="2">Total Credits:</th>
+            <td align="center" width="2%" tal:content="info/credits_total"></td>
+          </tr>
+        </table>
+      </form>
+        <span tal:condition="is_ca">   
+              <br /><br />
+              <table  width=100%>
+              <tr >
+              <td width=50%>Date:</td><td>Date:</td>
+              </tr>
+              </table>
+              
+              <br /><br /><br /><br />
+              <table  width=100%>
+              <tr >
+              <td width=50% style="border-top-style:solid; border-top-width:1px; border-top-color:black"> Student</td>
+              <td width=50% style="border-top-style:solid; border-top-width:1px; border-top-color:black">Course Adviser</td>
+              </tr>
+              </table>
+         </span>              
+       </span>              
+    </metal:main>
+  </metal:body>
+</metal:html>
+  
Index: WAeUP_SRP/trunk/skins/waeup_student/create_level.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/create_level.py	(revision 1511)
+++ WAeUP_SRP/trunk/skins/waeup_student/create_level.py	(revision 1513)
@@ -60,5 +60,6 @@
             continue
         course_cat_entry = c_res[0]
-        if not course_cat_entry.passmark:
+        passmark = getattr(course_cat_entry,'passmark',None)
+        if not passmark:
             carry_over = co.GRADE in ('D','E','F')
         else:
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 1511)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 1513)
@@ -1,3 +1,3 @@
-# Script (Python) "getStudyLevelInfo"
+## Script (Python) "getStudyLevelInfo"
 ##bind container=container
 ##bind context=context
@@ -53,6 +53,22 @@
 
 info = {}
+info['is_student'] = is_student = context.isStudent() 
+info['is_ca'] = is_ca = context.isCourseAdviser() 
 info['student'] = student = context.students_catalog(id=student_id)[0]
+info['review_state'] = review_state = context.getStudentReviewState()
+info['view_only'] =  review_state != "school_fee_paid" 
+info['show_check_boxes'] =  (is_ca and review_state == 'courses_registered') or (is_student and context.getStudentReviewState() == "school_fee_paid") 
 info['choosen_ids'] = request.get('ids',[])
+info['status_info'] = ""
+if is_student:
+    if review_state == 'courses_registered': 
+        info['status_info'] = "Request for Course Validation pending"
+    elif review_state == 'courses_validated': 
+        info['status_info'] = "Courses validated"
+elif is_ca:
+    if review_state == 'courses_registered': 
+        info['status_info'] = "Please validate these Courses"
+    elif review_state == 'courses_validated': 
+        info['status_info'] = "Courses validated"
 info['doc'] = context.getContent()
 ##study_course = context.aq_parent.getContent()
Index: WAeUP_SRP/trunk/skins/waeup_student/notify_change_courses.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/notify_change_courses.py	(revision 1513)
+++ WAeUP_SRP/trunk/skins/waeup_student/notify_change_courses.py	(revision 1513)
@@ -0,0 +1,34 @@
+## Script (Python) "getStudyCourseInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $
+"""
+close the Students StudyLevel
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+request = context.REQUEST
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+import logging
+logger = logging.getLogger('Student.notify_change_courses')
+
+wftool = context.portal_workflow
+wftool.doActionFor(context,'open')
+wftool.doActionFor(context,'close_for_edit')
+students_folder = context.portal_url.getPortalObject().campus.students
+student = getattr(students_folder,context.getStudentId())
+wftool.doActionFor(student,'notify_change_courses')
+logger.info('"%s","notify change courses for","%s"' % (member,student.getId()))
+return request.RESPONSE.redirect("%s" % context.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_student/register_courses.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/register_courses.py	(revision 1513)
+++ WAeUP_SRP/trunk/skins/waeup_student/register_courses.py	(revision 1513)
@@ -0,0 +1,33 @@
+## Script (Python) "getStudyCourseInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $
+"""
+close the Students StudyLevel
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+request = context.REQUEST
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+import logging
+logger = logging.getLogger('Student.register_courses')
+
+wftool = context.portal_workflow
+wftool.doActionFor(context,'close')
+students_folder = context.portal_url.getPortalObject().campus.students
+student = getattr(students_folder,context.getStudentId())
+wftool.doActionFor(student,'register_courses')
+logger.info('"%s","courses registered"' % student.getId())
+return request.RESPONSE.redirect("%s" % context.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 1511)
+++ WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 1513)
@@ -3,6 +3,11 @@
     <metal:block fill-slot="header" 
                  tal:define="global info context/getStudyLevelInfo;
-                 global is_so context/isSectionOfficer;"
-                 >
+                 global is_so context/isSectionOfficer;
+                 global is_ca info/is_ca;
+                 global show_check_boxes info/show_check_boxes;
+		 global is_student info/is_student;
+		 global status_info info/status_info;
+		 global review_state info/review_state;
+		 global view_only info/view_only">
       <a href=""
          tal:attributes="href string:${here/academicsParent}">
@@ -10,4 +15,14 @@
         Up one level
       </a>
+              <div style="text-align: right"
+             tal:condition="python:review_state == 'courses_validated'">
+        <a href="" target="slip" tal:attributes="href string:courses_validated_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Validated Courses Slip
+        </a>
+        
+        </div>
+
       <h3> 
         <span tal:condition="is_so">
@@ -19,13 +34,14 @@
     </metal:block>
     <metal:main fill-slot="main" tal:condition="python:1">
-
+      <h3 tal:content="status_info"></h3>
       <form action="." method="post" class="group">
         <span tal:condition="info/carry_overs" tal:omit-tag="">
         <h3>Carryover Courses</h3>
         <br />
-        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">
           <tr tal:repeat="row info/carry_overs"
               tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
-            <td align="left" valign="middle" style="width: 5px;">
+            <td align="left" valign="middle" style="width: 5px;"
+                tal:condition="show_check_boxes">
               <input type="checkbox" name="ids:list" value="" id="" class="noborder"
                      tal:define="id row/id"
@@ -45,8 +61,9 @@
         <h3>Session Courses</h3>
         <br />
-        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+        <table class="contentListing" width="100%" summary="content layout" id="folder_content">      
           <tr tal:repeat="row info/normal"
               tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
-            <td align="left" valign="middle" style="width: 5px;">
+            <td align="left" valign="middle" style="width: 5px;"
+	        tal:condition="show_check_boxes">
               <input type="checkbox" name="ids:list" value="" id="" class="noborder"
                      tal:define="id row/id"
@@ -69,5 +86,34 @@
           </tr>
         </table>
-        <table width="100%" cellspacing="0" cellpadding="2"
+        <table tal:condition="not:view_only" width="100%" cellspacing="0" cellpadding="2"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+              <span tal:condition="python:1">
+                <input type="button" value="button_select_all" class="context"
+		       onclick="someJavaScriptFunctionThatWillBeReplaced"
+                       i18n:attributes="value"
+                       tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
+                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
+                       />
+                <input type="submit" name="course_result_delete:method" value="Delete checked"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       ('really delete checked courses', )" 
+                       />
+                <input tal:condition="python:1" type="submit" name="register_courses:method"
+                       class="context" value="Register" />
+                <input tal:condition="is_ca" type="submit" name="notify_change_courses:method"
+                       class="context" value="Reject Courses" />
+                <input tal:condition="python: 1"
+                       type="submit" name="refresh_level:method"
+                       class="context" value="Refresh List" 
+                       />
+              </span>
+            </td>
+          </tr>
+        </table>
+        <table tal:condition="python:is_ca and show_check_boxes" width="100%" cellspacing="0" cellpadding="2"
                class="folderButtons">
           <tr>
@@ -81,13 +127,13 @@
                        % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
                        />
-                <input tal:condition="python:0" type="submit" name="register_checked:method"
-                       class="context" value="Register" />
-                <input tal:condition="python:0" type="submit" name="retract_checked:method"
-                       class="context" value="Retract" />
-                <input type="submit" name="course_result_delete:method" value="button_delete"
+                <input type="submit" name="course_result_delete:method" value="Delete checked"
                        class="destructive" i18n:attributes="value"
                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
-                       (cpsmcat('description_confirm_delete'), )" 
+                       ('really delete checked courses', )" 
                        />
+                <input tal:condition="python:1" type="submit" name="validate_courses:method"
+                       class="context" value="Validate" />
+                <input tal:condition="is_ca" type="submit" name="notify_change_courses:method"
+                       class="context" value="Reject Courses" />
                 <input tal:condition="python: 1"
                        type="submit" name="refresh_level:method"
@@ -100,5 +146,6 @@
       </form>
       <br />
-      <form action="add_course_result" method="post" class="group">
+      <form action="add_course_result" method="post" class="group"
+            tal:condition="show_check_boxes">
         <table>
           <tr>
Index: WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py	(revision 1513)
+++ WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py	(revision 1513)
@@ -0,0 +1,32 @@
+## Script (Python) "getStudyCourseInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $
+"""
+close the Students StudyLevel
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+request = context.REQUEST
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+import logging
+logger = logging.getLogger('Student.validate_courses')
+
+wftool = context.portal_workflow
+students_folder = context.portal_url.getPortalObject().campus.students
+student = getattr(students_folder,context.getStudentId())
+wftool.doActionFor(student,'validate_courses')
+logger.info('"%s","validated courses for","%s"' % (member,student.getId()))
+return request.RESPONSE.redirect("%s" % context.absolute_url())
