Index: WAeUP_SRP/trunk/Students.py
===================================================================
--- WAeUP_SRP/trunk/Students.py	(revision 722)
+++ WAeUP_SRP/trunk/Students.py	(revision 723)
@@ -23,4 +23,9 @@
 MAX_TRANS = 1000
 
+def getInt(s):
+    try:
+        return int(s)
+    except:
+        return 0
 
 def getStudentByRegNo(self,reg_no): ###(
@@ -152,4 +157,6 @@
                 dsc = {}
                 dsc['study_course'] = certcode
+                dsc['department'] = student.get('Dept')
+                dsc['faculty'] = student.get('Faculty')
                 css = student.get('CurrentSession') or '2004-2005'
                 cs = int(css.split('-')[0]) - 2000
@@ -161,21 +168,15 @@
                 # Level
                 #
-                l = getattr(studycourse,level,None)
-                if l is None:
-                    #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-                    logger.info('Creating Level %(StudentLevel)s for %(fullname)s' % student)
-                    studycourse.invokeFactory('StudentStudyLevel', level)
-                    l = getattr(studycourse, level)
-                    certificate = certs[certcode]
-                    cert_level = getattr(certificate,level,None)
-                    if cert_level is None:
-                        logger.info('Level %(level)s not in %(certcode)s' % vars())
-                    l.getContent().edit(mapping={'Title': "Level %s" % level})
-##                    l.invokeFactory('StudentSemester','first')
-##                    l.invokeFactory('StudentSemester','second')
-##                    first_s = getattr(l,'first')
-##                    first_s.getContent().edit(mapping={'Title': 'First Semester'})
-##                    second_s = getattr(l,'second')
-##                    second_s.getContent().edit(mapping={'Title': 'Second Semester'})
+##                l = getattr(studycourse,level,None)
+##                if 0 and l is None:
+##                    #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##                    logger.info('Creating Level %(StudentLevel)s for %(fullname)s' % student)
+##                    studycourse.invokeFactory('StudentStudyLevel', level)
+##                    l = getattr(studycourse, level)
+##                    certificate = certs[certcode]
+##                    cert_level = getattr(certificate,level,None)
+##                    if cert_level is None:
+##                        logger.info('Level %(level)s not in %(certcode)s' % vars())
+##                    l.getContent().edit(mapping={'Title': "Level %s" % level})
             else:
                 em = 'Student with ID %(MatricNo)s %(fullname)s already exists\n' % student
@@ -207,5 +208,11 @@
         """load Fulltime Studentdata from CSV values"""
         #return
+        level_wf_actions = {}
+        level_wf_actions["SUCCESSFUL STUDENT"] = "pass_A"
+        level_wf_actions["STUDENT WITH CARRYOVER COURSES"] = "pass_B"
+        level_wf_actions["STUDENT FOR PROBATION"] = "pass_C"
+        level_wf_actions["STUDENT ON PROBATION/TRANSFER"] = "pass_D"
         import transaction
+        wftool = self.portal_workflow
         tr_count = 0
         name = 'short_full_time_results_2004_2005'
@@ -226,16 +233,32 @@
         for c in l:
             courses[c.id] = c.getObject()
+        level_changed = False
+        student_changed = False
+        sid = ''
+        #import pdb;pdb.set_trace()
         for result in results:
-            sid = result.get('Matnumber')
-            res = self.portal_catalog({'meta_type': "StudentClearance",
-                                     'matric_no': sid })
-            if not res:
-                em = 'Student with ID %(Matnumber)s not found\n' % result
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
-                continue
-            sf = res[0].getObject().aq_parent
-            result['StudentId'] = sf.getId()
+            temp_sid = result.get('Matnumber')
+            if temp_sid != sid:
+                student_changed = True
+                res = self.portal_catalog({'meta_type': "StudentClearance",
+                                         'SearchableText': temp_sid })
+                if not res:
+                    em = 'Student with ID %(Matnumber)s not found\n' % result
+                    logger.info(em)
+                    no_import.write(em)
+                    no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
+                    continue
+                elif len(res) > 1:
+                    em = 'More than one Student with ID %(Matnumber)s found\n' % result
+                    logger.info(em)
+                    no_import.write(em)
+                    no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
+                    continue
+                sid = temp_sid
+                sf = res[0].getObject().aq_parent
+                sc = getattr(sf,'study_course')
+                level = ''
+            else:
+                student_changed = False
             course = result.get('CosCode')
             if course not in courses.keys():
@@ -245,41 +268,40 @@
                 no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
                 continue
-            level = result.get('Level')
-            try:
-                int(level)
-            except:
-                em = 'Result for result with ID %(Matnumber)s Course %(CosCode)s Level is empty\n' % result
-                logger.info(em)
-                no_import.write(em)
-                no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
-                continue
-            sc = getattr(sf,'study_course')
-            l = getattr(sc,level,None)
-            if l is None:
-                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-                logger.info('Creating Level %(Level)s for %(StudentId)s %(Matnumber)s' % result)
-                sc.invokeFactory('StudentStudyLevel', level)
-                l = getattr(sc, level)
-                l.invokeFactory('StudentSemester','first')
-                l.invokeFactory('StudentSemester','second')
-                first_s = getattr(l,'first')
-                first_s.getContent().edit(mapping={'Title': 'First Semester'})
-                second_s = getattr(l,'second')
-                second_s.getContent().edit(mapping={'Title': 'Second Semester'})
-            snr = result.get('Semster')
-            semester = getattr(l,'first')
-            if snr == "2":
-                semester = getattr(l,'second')
-            logger.info('Creating StudentCourseResult %(CosCode)s in Level %(Level)s for %(StudentId)s %(Matnumber)s' % result)
-            semester.invokeFactory('StudentCourseResult',course)
-            ct = getattr(semester,course)
-            d = {}
+            temp_level = result.get('Level')
+            result['StudentId'] = sf.getId()
+            if temp_level != level:
+                try:
+                    int(temp_level)
+                except:
+                    em = 'Result with ID %(Matnumber)s Course %(CosCode)s Level is empty\n' % result
+                    logger.info(em)
+                    no_import.write(em)
+                    no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
+                    continue
+                if level_changed:
+                    wftool.doActionFor(l,level_wf_actions[dlev['verdict']])
+                level_changed = True
+                level = temp_level
+                l = getattr(sc,level,None)
+                if l is None:
+                    logger.info('Creating Level %(Level)s for %(StudentId)s %(Matnumber)s' % result)
+                    sc.invokeFactory('StudentStudyLevel', level)
+                    l = getattr(sc, level)
+            else:
+                level_changed = False
+            cr = getattr(l,course,None)
+            if cr is None:
+                logger.info('Creating Course %(CosCode)s for %(StudentId)s %(Matnumber)s in Level %(Level)s' % result)
+                l.invokeFactory('StudentCourseResult',course)
+            cr = getattr(l,course)
+            dcr = {}
             dlev = {}
-            d['ansbook'] = result.get('Ansbook')
-            d['status'] = result.get('CosStuatus')
-            d['score'] = result.get('Score')
+            dcr['ansbook'] = result.get('Ansbook')
+            dcr['semester'] = getInt(result.get('Semster'))
+            dcr['status'] = result.get('CosStuatus')
+            dcr['score'] = getInt(result.get('Score'))
             dlev['session'] = result.get('Session')
-            dlev['carry_level'] = result.get('CarryLevel')
-            d['grade'] = result.get('Grade')
+            dcr['carry_level'] = result.get('CarryLevel')
+            dcr['grade'] = result.get('Grade')
             #d['weight'] = result.get('Weight')
             dlev['verdict'] = result.get('Verdict')
@@ -287,5 +309,5 @@
             #gpa = result.get('GPA').replace(',','.')
             #d['gpa'] = float(gpa)
-            ct.getContent().edit(mapping = d)
+            cr.getContent().edit(mapping = dcr)
             l.getContent().edit(mapping = dlev)
             if tr_count > MAX_TRANS:
@@ -293,4 +315,6 @@
                 tr_count = 0
             tr_count += 1
+            wftool.doActionFor(cr,'close')
+        wftool.doActionFor(l,level_wf_actions[dlev['verdict']])
         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
 
@@ -564,23 +588,23 @@
         return "Level %s" % self.aq_parent.getId()
 
-    security.declareProtected(View,"gpa")
-    def gpa(self):
-        """calculate the gpa"""
-        sum = 0
-        course_count = 0
-        for semester in ('first','second'):
-            sf=getattr(self,semester)
-            for sc in sf.objectValues():
-                result = sc.getContent()
-                res = self.portal_catalog({'meta_type': 'Course',
-                                              'id': sc.aq_parent.id})
-                if len(res) != 1:
-                    continue
-                course = res[0].getObject().getContent()
-                sum += course.credits * ['F','E','D','C','B','A'].index(result.grade)
-                course_count += 1
-        if course_count:
-            return sum/course_count
-        return 0.0
+##    security.declarePublic("gpa")
+##    def gpa(self):
+##        """calculate the gpa"""
+##        sum = 0
+##        course_count = 0
+##        for sc in self.objectValues():
+##            result = sc.getContent()
+##            if not result.grade:
+##                continue
+##            res = self.portal_catalog({'meta_type': 'Course',
+##                                          'id': sc.aq_parent.id})
+##            if len(res) != 1:
+##                continue
+##            course = res[0].getObject().getContent()
+##            sum += course.credits * ['F','E','D','C','B','A'].index(result.grade)
+##            course_count += 1
+##        if course_count:
+##            return sum/course_count
+##        return 0.0
 
 InitializeClass(StudentStudyLevel)
@@ -683,5 +707,5 @@
 
     def getCourseEntry(self,cid):
-        res = self.portal_catalog({'meta_type': "StudentCourse",
+        res = self.portal_catalog({'meta_type': "Course",
                                            'id': cid})
         if res:
@@ -693,5 +717,5 @@
     def Title(self):
         """compose title"""
-        cid = self.getId()
+        cid = self.aq_parent.getId()
         ce = self.getCourseEntry(cid)
         if ce:
Index: WAeUP_SRP/trunk/profiles/default/layouts/student_course_results.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_course_results.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/layouts/student_course_results.xml	(revision 723)
@@ -14,4 +14,15 @@
   <property name="label">Ansbook</property>
   <property name="label_edit">Ansbook</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="semester" meta_type="Int Widget">
+  <property name="title">Semester</property>
+  <property name="fields">
+   <element value="semester"/>
+  </property>
+  <property name="label">Semester</property>
+  <property name="label_edit">Semester</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes"/>
@@ -108,4 +119,7 @@
  <table>
   <row>
+   <cell name="semester"/>
+  </row>
+  <row>
    <cell name="grade"/>
   </row>
Index: WAeUP_SRP/trunk/profiles/default/layouts/student_study_course.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_study_course.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/layouts/student_study_course.xml	(revision 723)
@@ -19,8 +19,38 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
+ <widget name="department" meta_type="String Widget">
+  <property name="title">Department Code</property>
+  <property name="fields">
+   <element value="department"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Department Code</property>
+  <property name="label_edit">Department Code</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="faculty" meta_type="String Widget">
+  <property name="title">Faculty Code</property>
+  <property name="fields">
+   <element value="faculty"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Faculty Code</property>
+  <property name="label_edit">Faculty Code</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
  <table>
   <row>
    <cell name="study_course"/>
   </row>
+  <row>
+   <cell name="faculty"/>
+  </row>
+  <row>
+   <cell name="department"/>
+  </row>
  </table>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/schemas/student_course_results.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/student_course_results.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/schemas/student_course_results.xml	(revision 723)
@@ -8,5 +8,7 @@
  <field name="score" meta_type="CPS Int Field"/>
  <field name="status" meta_type="CPS String Field"/>
- <field name="verdict" meta_type="CPS String Field"/>
+<field name="semester" meta_type="CPS Int Field">
+ <property name="default_expr">python:1</property>
+</field> <field name="verdict" meta_type="CPS String Field"/>
  <field name="weight" meta_type="CPS String Field"/>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/schemas/student_study_course.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/student_study_course.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/schemas/student_study_course.xml	(revision 723)
@@ -1,4 +1,12 @@
 <?xml version="1.0"?>
 <object name="student_study_course" meta_type="CPS Schema">
- <field name="study_course" meta_type="CPS String Field"/>
+<field name="study_course" meta_type="CPS String Field">
+<property name="is_searchabletext">True</property>
+</field>
+ <field name="faculty" meta_type="CPS String Field">
+    <property name="is_searchabletext">True</property>
+</field>
+ <field name="department" meta_type="CPS String Field">
+    <property name="is_searchabletext">True</property>
+</field>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/types/StudentCourseResult.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/StudentCourseResult.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/types/StudentCourseResult.xml	(revision 723)
@@ -17,8 +17,8 @@
  <property name="cps_display_as_document_in_listing">True</property>
  <property name="schemas">
-  <element value="course_results"/>
+  <element value="student_course_results"/>
  </property>
  <property name="layouts">
-  <element value="course_results"/>
+  <element value="student_course_results"/>
  </property>
  <property name="layout_clusters"/>
Index: WAeUP_SRP/trunk/profiles/default/types/StudentStudyCourse.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/StudentStudyCourse.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/types/StudentStudyCourse.xml	(revision 723)
@@ -30,8 +30,8 @@
  <property name="storage_methods"/>
  <property name="cps_is_portlet">False</property>
- <alias from="(Default)" to="academics_contents"/>
- <alias from="view" to="academics_contents"/>
+ <alias from="(Default)" to="student_index"/>
+ <alias from="view" to="student_index"/>
  <action title="View" action_id="view" category="object" condition_expr=""
-    url_expr="string:${object_url}/academics_contents" visible="True">
+    url_expr="string:${object_url}/student_index" visible="True">
   <permission value="View"/>
  </action>
Index: WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml	(revision 723)
@@ -8,5 +8,5 @@
  <property name="product">WAeUP_SRP</property>
  <property name="factory">addStudentStudyLevel</property>
- <property name="immediate_view">academics_contents</property>
+ <property name="immediate_view">student_index</property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -28,10 +28,10 @@
  <property name="storage_methods"/>
  <property name="cps_is_portlet">False</property>
- <alias from="(Default)" to="academics_contents"/>
+ <alias from="(Default)" to="student_index"/>
  <alias from="create_do" to="waeup_document_create_do"/>
  <alias from="created" to="level_created"/>
- <alias from="view" to="academics_contents"/>
+ <alias from="view" to="student_index"/>
  <action title="View" action_id="view" category="object" condition_expr=""
-    url_expr="string:${object_url}/academics_contents" visible="True">
+    url_expr="string:${object_url}/student_index" visible="True">
   <permission value="View"/>
  </action>
Index: WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 723)
@@ -58,7 +58,4 @@
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
-  <type type_id="Semester">
-   <bound-workflow workflow_id="section_folder_wf"/>
-  </type>
   <type type_id="Student">
    <bound-workflow workflow_id="waeup_student_wf"/>
@@ -77,8 +74,8 @@
   </type>
   <type type_id="StudentStudyCourse">
-   <bound-workflow workflow_id="section_folder_wf"/>
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
   </type>
   <type type_id="StudentCourseResult">
-   <bound-workflow workflow_id="waeup_base_wf"/>
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
   </type>
   <type type_id="StudentsFolder">
@@ -89,8 +86,5 @@
   </type>
   <type type_id="StudentStudyLevel">
-   <bound-workflow workflow_id="section_folder_wf"/>
-  </type>
-  <type type_id="StudentSemester">
-   <bound-workflow workflow_id="section_folder_wf"/>
+   <bound-workflow workflow_id="waeup_course_registration_wf"/>
   </type>
   <type type_id="University">
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_course_registration_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_course_registration_wf/definition.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_course_registration_wf/definition.xml	(revision 723)
@@ -23,5 +23,12 @@
  </state>
  <state state_id="created" title="">
+  <exit-transition transition_id="create_content"/>
   <exit-transition transition_id="enter_school_fee_pin"/>
+  <exit-transition transition_id="pass_A"/>
+  <exit-transition transition_id="pass_B"/>
+  <exit-transition transition_id="probate_C"/>
+  <exit-transition transition_id="reject_D"/>
+  <exit-transition transition_id="reject_E"/>
+  <exit-transition transition_id="reject_F"/>
  </state>
  <state state_id="school_fee_pin_entered" title="">
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 723)
@@ -12,4 +12,5 @@
  <state state_id="created" title="">
   <exit-transition transition_id="close"/>
+  <exit-transition transition_id="create_content"/>
   <exit-transition transition_id="open"/>
   <permission-map name="Modify portal content"
@@ -24,4 +25,5 @@
  <state state_id="opened" title="">
   <exit-transition transition_id="close"/>
+  <exit-transition transition_id="create_content"/>
   <permission-map name="Modify portal content"
                   acquired="True">
@@ -55,4 +57,12 @@
   <transition-behavior behavior_id="initial-create"/>
  </transition>
+ <transition transition_id="create_content" title=""
+             new_state="" trigger="USER" before_script=""
+             after_script="">
+  
+  <guard>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-create"/>
+ </transition>
  <transition transition_id="open" title=""
              new_state="opened" trigger="USER"
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 722)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 723)
@@ -37,4 +37,5 @@
  <state state_id="created" title="">
   <exit-transition transition_id="create_content"/>
+  <exit-transition transition_id="clear_and_validate"/>
   <exit-transition transition_id="enter_application_pin"/>
   <exit-transition transition_id="open"/>
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 722)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 723)
@@ -21,5 +21,5 @@
 roles = member.getRoles()
 info = {}
-info['is_manager'] = context.isManager
+info['is_manager'] = context.isManager()
 info['is_student'] = context.isStudent()
 member_id = str(member)
@@ -66,7 +66,8 @@
               'StudentPersonal': '',
               }
-s_view_links = {'StudentApplication': 'application_view',
-              'StudentAccommodation': 'accommodation_view',
-              'StudentPersonal': 'personal_view',
+s_view_links = {'StudentApplication': None,
+              'StudentAccommodation': None,
+              'StudentPersonal': None,
+              'StudentStudyCourse': 'study_course_view',
               }
 sos = context.portal_catalog(container_path=student_path)
@@ -80,8 +81,6 @@
     row['type'] = so.portal_type
     row['is_editable'] = mtool.checkPermission('Modify portal content', soo)
-    sv_link = s_view_links.get(so.portal_type,None)
-    row['s_view_link'] = None
-    if sv_link:
-        row['s_view_link'] = "%s/%s" % (student.absolute_url(),sv_link)
+    sv_link = s_view_links.get(so.portal_type,None) or "academics_document_view"
+    row['s_view_link'] = "%s/%s" % (soo.absolute_url(),sv_link)
     se_link = s_edit_links.get(so.portal_type,None)
     row['s_edit_link'] = None
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py	(revision 723)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py	(revision 723)
@@ -0,0 +1,38 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return Info about the Students StudyCourse
+"""
+request = context.REQUEST
+
+wf = context.portal_workflow
+path_info = request.get('PATH_INFO').split('/')
+
+info = {}
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
+info['action'] = "%s" % context.campus.absolute_url()
+info['choosen_ids'] = request.get('ids',[])
+info['doc'] = context.getContent()
+items = []
+levels = context.objectValues()
+for l in levels:
+    row = {}
+    ld = l.getContent()
+    row['id'] = l.getId()
+    if hasattr(ld,'Title'):
+        row['title'] = ld.Title()
+    else:
+        row['title'] = getattr(ld,'title','no title')
+    row['url'] = l.absolute_url()
+    items.append(row)
+info['items'] = items
+return info
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 723)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 723)
@@ -0,0 +1,111 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return Info about the Studylevel
+"""
+def findCourse(cid):
+    ''' find the course'''
+    res = context.portal_catalog({'meta_type': 'Course',
+                                  'id': cid})
+    if len(res) < 1:
+        return None
+    course = res[0].getObject().getContent()
+    return course
+        
+def calculateGPA():
+    """calculate the gpa"""
+    sum = 0
+    course_count = 0
+    for sc in context.objectValues():
+        result = sc.getContent()
+        if not result.grade:
+            continue
+        res = context.portal_catalog({'meta_type': 'Course',
+                                      'id': sc.aq_parent.id})
+        if len(res) < 1:
+            continue
+        course = res[0].getObject().getContent()
+    if course_count:
+        return sum/course_count
+    return 0.0
+
+request = context.REQUEST
+
+wf = context.portal_workflow
+mtool = context.portal_membership
+path_info = request.get('PATH_INFO').split('/')
+try:
+    i = int(path_info[-1])
+    p = 0
+except:
+    p = 1
+info = {}
+pt = request.get('PATH_TRANSLATED').split('/')
+
+student_id = pt[-(3+p)]
+level_id = pt[-(1+p)]
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
+info['action'] = "%s" % context.absolute_url()
+info['choosen_ids'] = request.get('ids',[])
+info['doc'] = context.getContent()
+study_course = context.aq_parent.getContent()  
+cert_id = study_course.study_course
+brain = context.portal_catalog(meta_type="Student",id = student_id)[-1]
+cp = brain.getPath()
+info['container_path'] = cp
+info['cert_id'] = cert_id
+
+res = context.portal_catalog(meta_type="StudentCourseResult", 
+                             container_path="%s/study_course/%s" % (cp,level_id))
+first = []
+second = []
+sum = 0
+course_count = 0
+for r in res:
+    row = {}
+    ro = r.getObject()
+    rd = ro.getContent()
+    row['id'] = ro.getId()
+    course = findCourse(ro.getId())
+    row['credits'] = 0
+    if course:
+        row['credits'] = course.credits
+    if row['credits'] and rd.grade:
+        credits = int(course.credits)
+        sum += credits * (['F','E','D','C','B','A'].index(rd.grade) + 1)
+        course_count += credits
+    row['sum'] = sum
+    row['count'] = course_count
+    row['title'] = rd.Title()
+    #row['core'] = rd.core_or_elective
+    row['semester'] = rd.semester
+    row['score'] = rd.score
+    row['grade'] = rd.grade
+    row['weight'] = rd.weight
+    row['url'] = ro.absolute_url()
+    row['review_state'] = wf.getInfoFor(ro,'review_state','None')
+    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
+    if rd.semester == 1:
+        first.append(row)
+    else:
+        second.append(row)
+first.sort()
+second.sort()
+gpaf = 0.0
+if course_count:
+    gpaf = (float(sum)/course_count)
+info['doc'].edit(mapping={'gpa': gpaf})
+gpa = "%4.2f" % gpaf 
+info['gpa'] = gpa
+info['first'] = first
+info['second'] = second
+return info
Index: WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 722)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 723)
@@ -20,4 +20,8 @@
     return redirect("%s/srp_anonymous_view" % context.absolute_url())
 if context.isManager():
+    if context.portal_type == 'StudentStudyCourse':
+        return context.study_course_view()
+    elif context.portal_type == 'StudentStudyLevel':
+        return context.study_level_view()
     return redirect("%s/student_view" % context.absolute_url())
 if context.isStudent():
Index: WAeUP_SRP/trunk/skins/waeup_student/student_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_view.pt	(revision 722)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_view.pt	(revision 723)
@@ -23,5 +23,5 @@
           <tr tal:repeat="row rows"
             tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
-            <td><a href="view" tal:attributes="href string:${row/url}/academics_document_view">
+            <td><a href="view" tal:attributes="href string:${row/s_view_link}">
               <strong tal:content="row/title" /></a> </td>
             <td> 
Index: WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt	(revision 723)
+++ WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt	(revision 723)
@@ -0,0 +1,65 @@
+<metal:html tal:define="info context/getStudyCourseInfo;
+            is_manager info/is_manager|nothing;"
+            >
+  <metal:body use-macro="here/waeup_content_master/macros/master">
+    <metal:block fill-slot="header">
+      <a href=""
+         tal:attributes="href string:${here/academicsParent}">
+        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
+        Up one level
+      </a>
+      <h3 tal:content="here/title_or_id" />
+    </metal:block>
+    <metal:main fill-slot="main">
+      <span tal:omit-tag=""  
+            tal:content="structure python: info['doc'].render(layout_mode='view')" />
+      
+      <form action="" method="post" class="group"
+            tal:attributes="action info/action"
+            tal:define="rows python: info['items'];"
+            >
+        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+          <tr tal:repeat="row rows"
+            tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td align="left" valign="middle" style="width: 5px;" 
+                tal:condition="python: 0 and is_manager">
+              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                     tal:condition="is_manager"
+                     tal:define="id row/id"
+                     tal:attributes="value id;
+                     id python:'cb_' + id;
+                     checked python:id in info['choosen_ids'];" 
+                     />
+            </td>
+            <td><a href="view" tal:attributes="href string:${row/url}">
+              <strong tal:content="row/title" /></a> </td>
+          </tr>
+        </table>
+        <table width="100%" cellspacing="0" cellpadding="2"
+               summary="contents of the folder"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+              <span tal:condition="python:0 and is_manager">
+                <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="folder_delete:method" value="button_delete"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       (cpsmcat('description_confirm_delete'), )" 
+                       />
+              </span>
+            </td>
+          </tr>
+        </table>
+      </form>
+    </metal:main>
+    
+    <metal:sub fill-slot="sub"/>
+  </metal:body>
+</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 723)
+++ WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 723)
@@ -0,0 +1,94 @@
+<metal:html tal:define="info context/getStudyLevelInfo;
+            is_manager info/is_manager|nothing;"
+            >
+  <metal:body use-macro="here/waeup_content_master/macros/master">
+    <metal:block fill-slot="header">
+      <a href=""
+         tal:attributes="href string:${here/academicsParent}">
+        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
+        Up one level
+      </a>
+      <h3 tal:content="here/title_or_id" />
+      <div tal:condition="python:0" tal:content="info/container_path"/>
+      <div tal:condition="python:0" tal:content="info/cert_id"/>
+      <div tal:condition="python:0" tal:content="info/gpa"/>
+    </metal:block>
+    <metal:main fill-slot="main" tal:condition="python:1">
+      <span tal:omit-tag=""  
+            tal:content="structure python: info['doc'].render(layout_mode='view')" />
+      
+      <form action="" method="post" class="group"
+            tal:attributes="action info/action"
+            >
+        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">      
+          <span tal:repeat="sem python:('first','second')">
+            <tr><th colspan="3" tal:content="python: test(sem == 'first','First Semester', 'Second Semester')" />
+            <tr tal:repeat="row python: info[sem]"
+                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <td align="left" valign="middle" style="width: 5px;" 
+                  tal:condition="python:0 and is_manager">
+                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                       tal:condition="is_manager"
+                       tal:define="id row/id"
+                       tal:attributes="value id;
+                       id python:'cb_' + id;
+                       checked python:id in info['choosen_ids'];" 
+                       />
+                </td>
+                <td><a href="view" tal:attributes="href string:${row/url}">
+                    <strong tal:content="row/title" /></a> </td>
+                <td tal:content="row/id"></td>
+                <td tal:content="row/semester"></td>
+                <td tal:content="row/credits"></td>
+                <td tal:condition="is_manager" tal:content="row/score"></td>
+                <td tal:content="row/grade"></td>
+                <td tal:content="row/weight"></td>
+                <td tal:condition="python:0" tal:content="row/sum"></td>
+                <td tal:condition="python:0" tal:content="row/count"></td>
+                <td tal:condition="row/is_editable" tal:content="row/review_state"> </td>
+                <td> 
+                <a tal:condition="row/is_editable"
+                    href="edit" tal:attributes="href string:${row/url}/external_edit_form"
+                    target="edit"
+                    onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')">
+                    [edit]
+                    </a> 
+                </td>
+              </tr>
+            </span>
+          </table>
+        <table 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:0 and is_manager">
+                <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="approve_checked:method"
+                       class="context" value="Approve" />
+                <input type="submit" name="retract_checked:method"
+                       class="context" value="Retract" />
+                <input type="submit" name="folder_delete:method" value="button_delete"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       (cpsmcat('description_confirm_delete'), )" 
+                       />
+                <input tal:condition="python: context.portal_type not in ('Semester','Certificate')"
+                       type="submit" name="id_rename_form:method"
+                       class="context" value="Change Object ID" i18n:attributes="value" 
+                       />
+              </span>
+            </td>
+          </tr>
+        </table>
+      </form>
+    </metal:main>
+    
+    <metal:sub fill-slot="sub"/>
+  </metal:body>
+</metal:html>
