Index: /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: academics_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the appropriate page in the academics section
Index: /WAeUP_SRP/trunk/skins/waeup_academics/findCourseById.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/findCourseById.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/findCourseById.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: findCourseById.py 486 2006-09-06 10:09:39Z joachim $
 ''' find the course'''
 res = context.portal_catalog({'meta_type': 'Course',
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getAcademicsInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getAcademicsInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getAcademicsInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getAcademicsInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the current Student
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getCertificateInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about a Certificate
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCertificatesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCertificatesInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCertificatesInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getCertificatesInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getCoursesCertificatesInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getCoursesInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getDepartmentsInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getDocumentInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getDocumentInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getDocumentInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id:getFacultiesInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getLevelInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: searchAcademics.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the current Student
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: get_acco_folder_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the appropriate page in the academics section
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getAccoFolderInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getAccoHallInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Faculties
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/getBedTypeNames.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/getBedTypeNames.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/getBedTypeNames.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getBedTypeNames.py 486 2006-09-06 10:09:39Z joachim $
 
 return {'female_fr': 'Female New Student',
Index: /WAeUP_SRP/trunk/skins/waeup_default/campus_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/campus_index.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_default/campus_index.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: campus_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the correct campus_index_html
Index: /WAeUP_SRP/trunk/skins/waeup_default/index_html.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/index_html.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_default/index_html.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: index_html.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the correct index_html
Index: /WAeUP_SRP/trunk/skins/waeup_default/isManager.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isManager.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isManager.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: isManager.py 486 2006-09-06 10:09:39Z joachim $
 """
 return True if the member is considered a Manager,
Index: /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: isStudent.py 486 2006-09-06 10:09:39Z joachim $
 """
 return True if the member is considered a Student
@@ -19,5 +19,5 @@
 path_info = request.get('PATH_INFO').split('/')
 #roles = member.getRolesInContext(context)
-roles = member.getRoles()  # Student role is global 
+roles = member.getRoles()  # Student role is global
 isStudent = "Student" in roles
 return isStudent
Index: /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getBatchInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the current Batch
@@ -30,5 +30,5 @@
 for item in used:
     sno = item['student']
-    if len(sno)==10: 
+    if len(sno)==10:
     #if bd.prefix == "APP":
         res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication')
Index: /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py	(revision 801)
@@ -7,5 +7,5 @@
 ##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, action=None
 ##title=
-# $Id: student_edit.py 770 2006-10-29 05:24:04Z henrik $
+# $Id: clearance_edit.py 770 2006-10-29 05:24:04Z henrik $
 """
 """
@@ -33,5 +33,5 @@
 clear_doc = info['clear_doc']
 state = context.getStudentInfo()['review_state']
-is_valid, ds = clear_doc.validate(request=REQUEST, 
+is_valid, ds = clear_doc.validate(request=REQUEST,
                                 schema_id = 'student_clearance',
                                 layout_id = 'student_clearance_fe',
Index: /WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id:defer_admission.py 486 2006-09-06 10:09:39Z joachim $
 """
 defer student and print Info.
Index: /WAeUP_SRP/trunk/skins/waeup_student/getMaintenancePrefix.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getMaintenancePrefix.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getMaintenancePrefix.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id:getMaintenancePrefix.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the Prefix for hostel maintenance scratchcards
Index: /WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getStudentInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the current Student
Index: /WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getStudyCourseInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Students StudyCourse
Index: /WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: getStudyLevelInfo.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the Studylevel
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_application_create.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_application_create.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_application_create.pt	(revision 801)
@@ -8,5 +8,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction options/formaction|string:student_edit;
+  formaction options/formaction;
   creation creation|nothing;
   metadata metadata|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_enter_access_code.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_enter_access_code.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_enter_access_code.pt	(revision 801)
@@ -8,5 +8,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction options/formaction|string:student_edit;
+  formaction options/formaction;
   creation creation|nothing;
   metadata metadata|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_search_pume_create.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_search_pume_create.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_search_pume_create.pt	(revision 801)
@@ -8,5 +8,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction options/formaction|string:student_edit;
+  formaction options/formaction;
   creation creation|nothing;
   metadata metadata|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_create.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_create.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_create.pt	(revision 801)
@@ -8,5 +8,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction options/formaction|string:student_edit;
+  formaction options/formaction;
   creation creation|nothing;
   metadata metadata|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_edit.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_edit.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_student_acco_edit.pt	(revision 801)
@@ -8,5 +8,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction options/formaction|string:student_edit;
+  formaction options/formaction;
   creation creation|nothing;
   metadata metadata|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt	(revision 801)
@@ -15,5 +15,5 @@
   <span tal:condition="python:path('info/review_state')=='application_pin_entered'">
   <tr><td class="active">
-    <a href="" tal:attributes="href string:${info/url}/student_edit">
+    <a href="" tal:attributes="href string:${info/url}/application_edit">
     Admission started
     </a>
Index: /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: searchStudents.py 486 2006-09-06 10:09:39Z joachim $
 """
 return Info about the current Student
Index: eUP_SRP/trunk/skins/waeup_student/student_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_edit.py	(revision 800)
+++ 	(revision )
@@ -1,114 +1,0 @@
-## Script (Python) "cpsdocument_edit"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None
-##title=
-# $Id$
-"""
-"""
-wftool = context.portal_workflow
-from urllib import urlencode
-from Products.CPSDocument.utils import getFormUidUrlArg
-import DateTime
-current = DateTime.DateTime()
-
-# Until ajax posts directly to its own script...
-if 'ajax_edit' in REQUEST.form:
-    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
-
-# Check flexible controls
-#context.editLayouts(REQUEST=REQUEST)
-
-# Validate the document and write it if it's valid
-# (We don't call getEditableContent here, validate does it when needed.)
-info = context.getStudentInfo()
-
-student = info['student']
-app = info['app']
-app_doc = info['app_doc']
-clear = info['clear']
-clear_doc = info['clear_doc']
-state = context.getStudentInfo()['review_state']
-
-if context.portal_type == "Student":
-    if app_doc.passport is None:
-        is_valid, ds = app_doc.validate(request=REQUEST,
-                                    proxy=app_doc,
-                                    layout_id = "student_application_fe",
-                                    layout_mode = 'edit',
-                                    use_session=True)
-        action = "/application_edit"
-        if is_valid:
-            if app_doc.passport is not None:
-                psm = 'You successfully uploaded your passport image.'
-                args = {'apply_button': 'Apply',}
-            else:
-                psm = "You didn't upload a passport image."
-                args = {}
-        else:
-            psm = 'psm_content_error'
-            args = getFormUidUrlArg(REQUEST)
-    elif 'apply_admission' not in REQUEST.form:
-        is_valid, ds = app_doc.validate(request=REQUEST,
-                                    proxy=app_doc,
-                                    layout_id = "student_application_fe",
-                                    layout_mode = 'edit',
-                                    use_session=True)
-        action = "/application_edit"
-        if is_valid:
-            args = {}
-            if 'apply_admission' not in REQUEST.form:
-                args = {'apply_button': 'Apply',}
-                psm = 'You successfully uploaded your passport image.'
-            else:
-                psm = 'You applied for admission.'
-        else:
-            args = getFormUidUrlArg(REQUEST)
-            psm = 'psm_content_error'
-    else:
-        psm = ''
-        args = {}
-        if info['review_state'] == "student_created":
-            student.content_status_modify(workflow_action="apply_for_admission")
-            wftool.doActionFor(app,'close',dest_container= app)
-            psm = 'You applied for admission.'
-            action = "/application_view"
-        elif info['review_state'] == "admitted":
-            student.content_status_modify(workflow_action="enter_clearance_pin")
-            #wftool.doActionFor(info['clear'],'open',dest_container=info['clear'])
-            app_doc = info['app_doc']
-            dc = {}
-            dc['email'] = app_doc.app_email
-            info['clear_doc'].edit(mapping = dc)
-            wftool.doActionFor(app,'close',dest_container= app)
-            psm = 'You successfully started the clearance process.'
-            action = "/clearance_edit"
-        else:
-            action = "/clearance_view"
-
-else:
-    is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster,
-                                use_session=True)
-
-    if action is None:
-        ti = app.getTypeInfo()
-        action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
-        action = '/' + action
-
-    if is_valid:
-        comments = REQUEST.get('comments')
-        context.cpsdocument_notify_modification(comments=comments)
-        if cpsdocument_edit_and_view_button is not None:
-            action = ''
-        psm = 'psm_content_changed'
-        args = {}
-    else:
-        psm = 'psm_content_error'
-        args = getFormUidUrlArg(REQUEST)
-
-args['portal_status_message'] = psm
-url = context.absolute_url() + action + '?' + urlencode(args)
-REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_edit_not_used.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_edit_not_used.py	(revision 801)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_edit_not_used.py	(revision 801)
@@ -0,0 +1,114 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None
+##title=
+# $Id: student_edit.py 770 2006-10-29 05:24:04Z henrik $
+"""
+"""
+wftool = context.portal_workflow
+from urllib import urlencode
+from Products.CPSDocument.utils import getFormUidUrlArg
+import DateTime
+current = DateTime.DateTime()
+
+# Until ajax posts directly to its own script...
+if 'ajax_edit' in REQUEST.form:
+    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
+
+# Check flexible controls
+#context.editLayouts(REQUEST=REQUEST)
+
+# Validate the document and write it if it's valid
+# (We don't call getEditableContent here, validate does it when needed.)
+info = context.getStudentInfo()
+
+student = info['student']
+app = info['app']
+app_doc = info['app_doc']
+clear = info['clear']
+clear_doc = info['clear_doc']
+state = context.getStudentInfo()['review_state']
+
+if context.portal_type == "Student":
+    if app_doc.passport is None:
+        is_valid, ds = app_doc.validate(request=REQUEST,
+                                    proxy=app_doc,
+                                    layout_id = "student_application_fe",
+                                    layout_mode = 'edit',
+                                    use_session=True)
+        action = "/application_edit"
+        if is_valid:
+            if app_doc.passport is not None:
+                psm = 'You successfully uploaded your passport image.'
+                args = {'apply_button': 'Apply',}
+            else:
+                psm = "You didn't upload a passport image."
+                args = {}
+        else:
+            psm = 'psm_content_error'
+            args = getFormUidUrlArg(REQUEST)
+    elif 'apply_admission' not in REQUEST.form:
+        is_valid, ds = app_doc.validate(request=REQUEST,
+                                    proxy=app_doc,
+                                    layout_id = "student_application_fe",
+                                    layout_mode = 'edit',
+                                    use_session=True)
+        action = "/application_edit"
+        if is_valid:
+            args = {}
+            if 'apply_admission' not in REQUEST.form:
+                args = {'apply_button': 'Apply',}
+                psm = 'You successfully uploaded your passport image.'
+            else:
+                psm = 'You applied for admission.'
+        else:
+            args = getFormUidUrlArg(REQUEST)
+            psm = 'psm_content_error'
+    else:
+        psm = ''
+        args = {}
+        if info['review_state'] == "student_created":
+            student.content_status_modify(workflow_action="apply_for_admission")
+            wftool.doActionFor(app,'close',dest_container= app)
+            psm = 'You applied for admission.'
+            action = "/application_view"
+        elif info['review_state'] == "admitted":
+            student.content_status_modify(workflow_action="enter_clearance_pin")
+            #wftool.doActionFor(info['clear'],'open',dest_container=info['clear'])
+            app_doc = info['app_doc']
+            dc = {}
+            dc['email'] = app_doc.app_email
+            info['clear_doc'].edit(mapping = dc)
+            wftool.doActionFor(app,'close',dest_container= app)
+            psm = 'You successfully started the clearance process.'
+            action = "/clearance_edit"
+        else:
+            action = "/clearance_view"
+
+else:
+    is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster,
+                                use_session=True)
+
+    if action is None:
+        ti = app.getTypeInfo()
+        action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
+        action = '/' + action
+
+    if is_valid:
+        comments = REQUEST.get('comments')
+        context.cpsdocument_notify_modification(comments=comments)
+        if cpsdocument_edit_and_view_button is not None:
+            action = ''
+        psm = 'psm_content_changed'
+        args = {}
+    else:
+        psm = 'psm_content_error'
+        args = getFormUidUrlArg(REQUEST)
+
+args['portal_status_message'] = psm
+url = context.absolute_url() + action + '?' + urlencode(args)
+REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: student_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the current student_index_html
Index: /WAeUP_SRP/trunk/skins/waeup_student/students_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/students_index.py	(revision 800)
+++ /WAeUP_SRP/trunk/skins/waeup_student/students_index.py	(revision 801)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+# $Id: students_index.py 486 2006-09-06 10:09:39Z joachim $
 """
 return the current students_index_html
