Index: WAeUP_SRP/base/skins/waeup_student/admission_form.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/admission_form.pt	(revision 2913)
+++ WAeUP_SRP/base/skins/waeup_student/admission_form.pt	(revision 2920)
@@ -1,4 +1,7 @@
 <metal:html tal:define="info context/getStudentInfo;
-                        app_email info/app_doc/app_email|nothing">
+                        app_email info/app_doc/app_email|nothing;
+                        app_passport info/has_passport;
+                        data_complete python:app_passport and app_email;
+                        ">
   <span tal:condition="not: info">
     <span tal:content="here/illegal_view" />
@@ -77,8 +80,8 @@
                        (cpsmcat('Confirm that you want to raise an objection.'), )" 
                        />
-                <input tal:condition="python:review_state in ('admitted', 'objection_raised',) and not app_email" type="submit" name="application_edit:method"
+                <input tal:condition="python:review_state in ('admitted', 'objection_raised',) and not data_complete" type="submit" name="application_edit:method"
                        class="context" value="Continue" 
                        />
-                <input tal:condition="python:review_state in ('admitted', 'objection_raised',) and app_email" type="submit" name="start_clearance:method"
+                <input tal:condition="python:review_state in ('admitted', 'objection_raised',) and data_complete" type="submit" name="start_clearance:method"
                        class="context" value="Continue" 
                        />                       
Index: WAeUP_SRP/base/skins/waeup_student/application_edit.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/application_edit.py	(revision 2913)
+++ WAeUP_SRP/base/skins/waeup_student/application_edit.py	(revision 2920)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=REQUEST, cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, action=None
+##parameters=REQUEST, cpsdocument_edit_and_view_button=None, action=None, portal_status_message=''
 ##title=
 # $Id$
@@ -18,14 +18,10 @@
 logger = logging.getLogger('Skins.application_edit')
 
-# Until ajax posts directly to its own script...
-##if 'ajax_edit' in REQUEST.form:
-##    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
+psm = ""
+args = {}
 
-# Check flexible controls
-#context.editLayouts(REQUEST=REQUEST)
+info = context.getApplicationInfo()
 
-# Validate the document and write it if it's valid
-# (We don't call getEditableContent here, validate does it when needed.)
-info = context.getApplicationInfo()
+student = info['student']
 
 if info is None:
@@ -33,5 +29,23 @@
     return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
 
-student = info['student']
+if info['has_passport'] and info['app_doc'].app_email:
+    logger.info('%s proceeded to start clearance' % (info['id']))
+    action = "/start_clearance"
+    base_url = student.absolute_url()
+    url = base_url + action
+    return REQUEST.RESPONSE.redirect(url)
+elif not cpsdocument_edit_and_view_button:
+    action = "/application_edit_form"
+    base_url = student.absolute_url()
+    #url = base_url + action
+    if portal_status_message:
+        args['portal_status_message'] = portal_status_message
+        url = base_url + action + '?' + urlencode(args)
+    else:
+        url = base_url + action
+    return REQUEST.RESPONSE.redirect(url)
+
+
+
 app = info['app']
 app_doc = info['app_doc']
@@ -43,27 +57,17 @@
                                 use_session=False)
 
-psm = ""
-args = {}
-action = "/application_edit_form"
+
+action = "/application_edit"
 base_url = app.absolute_url()
 
 if is_valid:
-    if cpsdocument_edit_button:
-        if app_doc.passport is not None:
-            args['portal_status_message'] = 'You successfully uploaded your passport picture!'
-        else:
-            args['portal_status_message'] = "You didn't upload a passport picture!"
-    elif cpsdocument_edit_and_view_button:
-        if 1: ## app_doc.passport is not None:
-            logger.info('%s proceeded to start clearance' % (info['id']))
-            action = "/start_clearance"
-            base_url = student.absolute_url()
-            url = base_url + action
-            return REQUEST.RESPONSE.redirect(url)
-        else:
-            args['portal_status_message'] = "You didn't upload a passport picture!"
-if args:
-  url = base_url + action + '?' + urlencode(args)
+    args['portal_status_message'] = "You didn't upload all required data!"
+
 else:
-  url = base_url + action
-REQUEST.RESPONSE.redirect(url)
+    args['portal_status_message'] = "Please correct your error!"
+
+url = base_url + action + '?' + urlencode(args)
+
+
+  
+return REQUEST.RESPONSE.redirect(url)
Index: WAeUP_SRP/base/skins/waeup_student/application_edit_form.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/application_edit_form.pt	(revision 2913)
+++ WAeUP_SRP/base/skins/waeup_student/application_edit_form.pt	(revision 2920)
@@ -12,5 +12,7 @@
            form_action string:application_edit;
            edition python:True;
-           session2006 python:True;
+           app_email info/app_doc/app_email|nothing;
+           app_passport info/has_passport;
+           data_complete python:app_passport and app_email;
            metadata nothing;
             ">
@@ -33,18 +35,8 @@
       <br />
       <input type="submit" class="standalone" 
-             name="cpsdocument_edit_button"
-             value="Save & Return Later" 
-             id="cpsdocument_edit_button"
-             tal:condition="not:session2006" />
-      <input type="submit" class="standalone" 
-             name="cpsdocument_edit_and_view_button"
-             value="Save & Apply"
-             id="cpsdocument_edit_and_view_button" 
-             tal:condition="not:session2006" />
-      <input type="submit" class="standalone" 
              name="cpsdocument_edit_and_view_button"
              value="Save & Continue"
              id="cpsdocument_edit_and_view_button" 
-             tal:condition="session2006" />             
+             />             
     </form>
     </metal:main>
Index: WAeUP_SRP/base/skins/waeup_student/getApplicationInfo.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/getApplicationInfo.py	(revision 2913)
+++ WAeUP_SRP/base/skins/waeup_student/getApplicationInfo.py	(revision 2920)
@@ -36,4 +36,5 @@
     student_id = member_id
 
+info['has_passport'] = context.waeup_tool.picturesExist(('passport',), student_id)
 
 students_object = context.portal_url.getPortalObject().campus.students
Index: WAeUP_SRP/base/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/getStudentInfo.py	(revision 2913)
+++ WAeUP_SRP/base/skins/waeup_student/getStudentInfo.py	(revision 2920)
@@ -65,4 +65,5 @@
 info['app'] = student.application
 info['app_doc'] = student.application.getContent()
+info['has_passport'] = context.waeup_tool.picturesExist(('passport',), student_id)
 
 course = getattr(student,'study_course',None)
