Index: /WAeUP_SRP/branches/joachim-event-branch/Students.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/Students.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/Students.py	(revision 1597)
@@ -92,6 +92,4 @@
     portal_type = meta_type
     security = ClassSecurityInfo()
-
-
 
     security.declareProtected(ModifyPortalContent,"createDEStudents")###(
@@ -1246,7 +1244,5 @@
     ###)
 
-
-
-    security.declareProtected(View,"fixOwnership")
+    security.declareProtected(View,"fixOwnership") ###(
     def fixOwnership(self):
         """fix Ownership"""
@@ -1257,9 +1253,11 @@
             student.application.manage_setLocalRoles(sid, ['Owner',])
             student.personal.manage_setLocalRoles(sid, ['Owner',])
-
-    security.declareProtected(View,"Title")
+    ###)
+
+    security.declareProtected(View,"Title") ###(
     def Title(self):
         """compose title"""
         return "Student Section"
+    ###)
 
     def generateStudentId(self,letter): ###(
@@ -1278,9 +1276,12 @@
 InitializeClass(StudentsFolder)
 
-def addStudentsFolder(container, id, REQUEST=None, **kw):
+def addStudentsFolder(container, id, REQUEST=None, **kw): ###(
     """Add a Student."""
     ob = StudentsFolder(id, **kw)
     return CPSBase_adder(container, ob, REQUEST=REQUEST)
+    ###)
+
 ###)
+
 
 class Student(CPSDocument): ###(
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py	(revision 1597)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=
+##parameters=REQUEST=None, action_after_validate=None
 ##title=
 ##
@@ -57,5 +57,5 @@
     return request.RESPONSE.redirect(url)
 
-   
+
 cr_id = context.invokeFactory('StudentCourseResult',course_id)
 #set_trace()
@@ -66,8 +66,10 @@
 args['course_id'] = course_id
 
-logger.info('%s added StudentCourseResult object %s' % (member,course_id))   
+logger.info('%s added StudentCourseResult object %s' % (member,course_id))
 
-from urllib import urlencode
-url = "%s?%s" % (context.absolute_url(),urlencode(args))
-return request.RESPONSE.redirect(url)
+args = {}
+psm = "You successfully added course %s!" % course_id
+args['portal_status_message'] = psm
+url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
+return REQUEST.RESPONSE.redirect(url)
 
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt	(revision 1597)
@@ -28,4 +28,6 @@
       <input type="hidden" name="probtype" type="text" id="probtype"
              tal:attributes="value subject"/>     
+      <input type="hidden" name="action" type="text" id="action"
+             tal:attributes="value continue"/>  
              
       <table width="100%" border="0" cellspacing="5" cellpadding="0">
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py	(revision 1597)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=ids=[], REQUEST=None
+##parameters=ids=[], REQUEST=None, action_after_reject=None, action_after_validate=None
 ##title=
 ##
@@ -15,5 +15,5 @@
 from Products.CMFCore.utils import getToolByName
 here = context
-
+from urllib import urlencode
 import logging
 logger = logging.getLogger('Skins.delete_course_result')
@@ -32,8 +32,11 @@
         context.manage_delObjects(real_ids)
         logger.info('%s deleted StudentCourseResult object %s' % (member,id))
-        message = 'portal_status_message=psm_item(s)_deleted'
+        message = 'psm_item(s)_deleted'
 else:
-    message = 'portal_status_message=psm_select_at_least_one_document'
-
+    message = 'psm_select_at_least_one_document'
+    
+args = {}
+args['portal_status_message'] = message
+url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
 if REQUEST is not None:
-    return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
+    return REQUEST.RESPONSE.redirect(url)    
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt	(revision 1597)
@@ -191,4 +191,6 @@
                      class="context" value="Add Course" 
                      />
+              <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
+                       tal:attributes="value string:external_study_level_view"/>                      
             </td>                
         </table>
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py	(revision 1597)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None
+##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None, action=None
 ##title=
 ##
@@ -27,11 +27,13 @@
 #prop.email_from_address should be used for To:
 REQUEST = context.REQUEST
-url_tuple = REQUEST.HTTP_REFERER.split('?')
-if len(url_tuple) == 2:
-    url_tuple[1] ='portal_status_message=Your message has been sent!'
-else:
-    url_tuple.append('portal_status_message=Your message has been sent!')
-redirect_url = "?".join(url_tuple)
-REQUEST.set('rurl', redirect_url) # to see the result in the error log
+
+#url_tuple = REQUEST.HTTP_REFERER.split('?')
+#if len(url_tuple) == 2:
+#    url_tuple[1] ='portal_status_message=Your message has been sent!'
+#else:
+#    url_tuple.append('portal_status_message=Your message has been sent!')
+#redirect_url = "?".join(url_tuple)
+#REQUEST.set('rurl', redirect_url) # to see the result in the error log
+
 msg = message % (
      co_name,
@@ -47,6 +49,16 @@
 mhost.send(msg)
 
-REQUEST = context.REQUEST
-RESPONSE = REQUEST.RESPONSE
 
-RESPONSE.redirect(redirect_url)
+#REQUEST = context.REQUEST
+#RESPONSE = REQUEST.RESPONSE
+#RESPONSE.redirect(redirect_url)
+
+args = {}
+psm = "Your message has been sent!"
+args['portal_status_message'] = psm
+url = context.absolute_url() + '/' + action + '?' + urlencode(args)
+return REQUEST.RESPONSE.redirect(url)
+
+
+
+
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py	(revision 1597)
@@ -1,3 +1,9 @@
-##parameters=
+## Script (Python) "refresh_level"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
 # $Id$
 """
@@ -19,4 +25,6 @@
 logger = logging.getLogger('Skins.refresh_level')
 
+from urllib import urlencode
+
 current = DateTime.DateTime()
 request = context.REQUEST
@@ -35,5 +43,5 @@
 if in_progress == 'finished':
     session.set('in_progress','started')
-    view = context.in_progress_view(refresh=3,page='study_level_view')
+    view = context.in_progress_view(refresh=3,page=action_after_validate)
     response.setHeader('Content-type','text/html; charset=ISO-8859-15')
     response.setHeader('Content-length','%d' % (len(view)))
@@ -100,4 +108,8 @@
 session.set('in_progress','finished')
 logger.info('%s updated course list' % member)
-return
-return response.redirect("%s" % level.absolute_url())
+
+args = {}
+psm = "Course list updated!"
+args['portal_status_message'] = psm
+url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
+return REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py	(revision 1597)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=student=None
+##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
 ##title=
 ##
@@ -18,4 +18,6 @@
     def set_trace():
         pass
+
+from urllib import urlencode        
 
 request = context.REQUEST
@@ -40,4 +42,9 @@
     logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     return request.RESPONSE.redirect("%s" % context.absolute_url())
-logger.info('%s registered course list for %s' % (member_id,student_id))
-return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s registered course list of %s' % (member_id,student_id))
+
+args = {}
+psm = "You successfully submitted your course list!"
+args['portal_status_message'] = psm
+url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
+return REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py	(revision 1597)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=REQUEST, student=None, action_after_reject=None, action_after_validate=None
+##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
 ##title=
 ##
@@ -12,4 +12,5 @@
 close the Students StudyLevel
 """
+from Products.CMFCore.WorkflowCore import WorkflowException
 try:
     from Products.zdb import set_trace
@@ -29,7 +30,12 @@
 wftool.doActionFor(context,'close_for_edit')
 students_folder = context.portal_url.getPortalObject().campus.students
-student = getattr(students_folder,context.getStudentId())
-wftool.doActionFor(student,'reject_courses')
-logger.info('%s rejected course list of %s' % (member,student.getId()))
+student_id = context.getStudentId()
+student = getattr(students_folder,student_id)
+try:
+    wftool.doActionFor(student,'reject_courses')
+except WorkflowException,E:
+    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
+    return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s rejected course list of %s' % (member_id,student_id))
 
 args = {}
@@ -42,4 +48,2 @@
 url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
 return REQUEST.RESPONSE.redirect(url)
-
-#return request.RESPONSE.redirect("%s" % context.absolute_url())
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt	(revision 1597)
@@ -142,4 +142,9 @@
                 <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
                        class="context" value="Reject" />
+                       
+                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
+                       tal:attributes="value string:/study_level_view"/>                         
+                <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
+                       tal:attributes="value string:/contact_student_form"/>                         
 
             </td>
@@ -198,4 +203,6 @@
                      class="context" value="Add Course" 
                      />
+              <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
+                       tal:attributes="value string:/study_level_view"/>                       
             </td>                
         </table>
Index: /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py
===================================================================
--- /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py	(revision 1596)
+++ /WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py	(revision 1597)
@@ -12,4 +12,5 @@
 close the Students StudyLevel
 """
+from Products.CMFCore.WorkflowCore import WorkflowException
 try:
     from Products.zdb import set_trace
@@ -27,11 +28,14 @@
 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 course list of %s' % (member,student.getId()))
+student_id = context.getStudentId()
+student = getattr(students_folder,student_id)
+try:
+    wftool.doActionFor(student,'validate_courses')
+except WorkflowException,E:
+    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
+    return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s validated course list of %s' % (member_id,student_id))
 
 psm = 'portal_status_message=Course list validated!'
 url = context.absolute_url() + '/' + action_after_validate +  '?' + psm
 return request.RESPONSE.redirect(url)
-
-
