Index: WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 1024)
+++ WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 1025)
@@ -23,4 +23,12 @@
 # (We don't call getEditableContent here, validate does it when needed.)
 doc = context.getContent()
+if context.portal_type == "StudentStudyCourse":
+    if len(context.objectIds()) > 0:
+        psm = 'Edit of StudyCourse is only possible if there are no levels'
+        args = getFormUidUrlArg(REQUEST)
+        args['portal_status_message'] = psm
+        url = context.absolute_url() + '?' + urlencode(args)
+        REQUEST.RESPONSE.redirect(url)
+        
 is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
                             use_session=True)
@@ -36,4 +44,17 @@
     comments = REQUEST.get('comments')
     context.cpsdocument_notify_modification(comments=comments)
+    if context.portal_type == "StudentStudyCourse":
+        course = ds.get('study_course')
+        student_id = context.getStudentId()
+        res = context.portal_catalog(portal_type='Certificate',id = course)
+        if res:
+            c_brain = res[0]
+            c_path = c_brain.getPath().split('/')
+            student_id = context.getStudentId()
+            context.students_catalog.modifyRecord(id = student_id,
+                                                  course = course,
+                                                  faculty = c_path[-4],
+                                                  department = c_path[-3],
+                                                  )
     if cpsdocument_edit_and_view_button is not None:
         action = ''
Index: WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 1024)
+++ WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 1025)
@@ -1,4 +1,8 @@
-<metal:html tal:define="info context/getStudentInfo;
-            rendered_main python:info['app_doc'].render(
+<metal:html tal:define="info context/getStudentInfo">
+  <span tal:condition="not: info">
+    <metal:block use-macro="here/error_not_found/macros/not_found" />
+  </span>
+<metal:block tal:condition="info"> 
+<metal:block tal:define="rendered_main python:info['app_doc'].render(
                       layout_mode='edit',
                       schema_id = 'student_application',
@@ -50,3 +54,5 @@
     </metal:main>
   </metal:body>
+</metal:block>
+</metal:block>
 </metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py	(revision 1025)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py	(revision 1025)
@@ -0,0 +1,18 @@
+## Script (Python) "getStudentId"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return StudentId from request
+"""
+ptl = context.REQUEST.get('PATH_TRANSLATED').split('/')
+id_index = ptl.index('students')
+if len(ptl) > id_index + 2:
+    return ptl[id_index + 1]
+return None
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 1024)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 1025)
@@ -43,5 +43,5 @@
             logger.info("student %s tried to access %s" % (member_id,requested_id))
             student_id = member_id
-            #mtool.assertViewable(context)
+            mtool.assertViewable(context)
             break
         student_id = member_id
@@ -78,7 +78,19 @@
         info['sex'] = 'female'
 course = getattr(student,'study_course',None)
-info['course'] = course
 if course:
-    info['course_doc'] = student.study_course.getContent()
+    cert_id = course.getContent().study_course
+    res = context.portal_catalog(portal_type = "Certificate", id = cert_id)
+    ci = {}
+    if len(res) > 0:
+        info['course'] = course
+        brain = res[0]
+        ci['study_course'] = brain.getId
+        ci['title'] = brain.Title
+        pl = brain.getPath().split('/')
+        ci['faculty'] = pl[-4]
+        ci['department'] = pl[-3]
+        info['course_doc'] = ci
+    else:
+        info['course'] = None
 #
 acco = getattr(student,'accommodation_2006',None)
Index: WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt	(revision 1024)
+++ WAeUP_SRP/trunk/skins/waeup_student/study_course_view.pt	(revision 1025)
@@ -19,6 +19,30 @@
     </metal:block>
     <metal:main fill-slot="main">
-      <span tal:omit-tag=""  
+      <span tal:omit-tag="" tal:condition="nothing"
             tal:content="structure python: info['doc'].render(layout_mode='view')" />
+      <table tal:define="sc python: s_info['course_doc']">
+        <tr>
+          <td width="180px">Certificate:</td> 
+          <td><span tal:content="sc/title" /></td>
+        </tr>
+        <tr>
+          <td>Certificate ID:</td>
+          <td tal:content="sc/study_course" />
+        </tr>
+          <span tal:define="f_id sc/faculty;
+          d_id sc/department;
+          f_title context/academics/?f_id/Title|string:Faculty not yet in Prospectus;
+          d_title context/academics/?f_id/?d_id/Title|string:Department not yet in Prospectus"
+          >
+            <tr>
+              <td>Faculty:</td>
+              <td tal:content="f_title" />
+            </tr>
+            <tr>
+              <td>Department:</td> 
+              <td><span tal:content="d_title" /></td>
+            </tr>
+          </span>
+        </table>        
       
       <form action="" method="post" class="group"
