Index: WAeUP_SRP/base/skins/cps_custom/main_template_popup.pt
===================================================================
--- WAeUP_SRP/base/skins/cps_custom/main_template_popup.pt	(revision 2918)
+++ WAeUP_SRP/base/skins/cps_custom/main_template_popup.pt	(revision 2920)
@@ -1,28 +1,36 @@
-<metal:block define-macro="master" tal:define="
-  showthirdcol showthirdcol|python:1;
+<metal:block define-macro="master"
+  tal:define="showthirdcol showthirdcol|python:1;
   emptybody emptybody|request/emptybody|nothing;
+  mtool here/portal_membership;
+  
   utool nocall:here/portal_url;
   atool here/portal_actions;
-  mtool here/portal_membership;
   ttool here/portal_trees;
   wtool here/portal_workflow;
+  ptool here/portal_cpsportlets;
   context_url python:here.getContextUrl(utool=utool);
-  base_url python:utool.getBaseUrl();
-  
+  here_url here/absolute_url;
+  base_url here/getBaseUrl;
   static_dir here/portal_properties/static_dir;
   static_base_url string:${here/getBaseUrl}${static_dir};
-  
-  
-  here_url python:here.absolute_url();
   member mtool/getAuthenticatedMember;
   isAnon mtool/isAnonymousUser;
+  isHomeless python:isAnon or member.getProperty('homeless', 0);
+  isHomeless python:(isHomeless == '0' and [0] or [isHomeless])[0];
   actions python:atool.listFilteredActionsFor(here);
   wf_state python:wtool.getInfoFor(here,'review_state','');
-  uname python:isAnon and 'Guest' or member.getUserName();
-  checkPerm nocall:mtool/checkPermission;
+  uname python: isAnon and 'Guest' or member.getUserName();
+  checkPerm nocall: mtool/checkPermission;
   cpsmcat nocall:here/translation_service;
   locale here/translation_service/getSelectedLanguage;
   in_ws here/isInWorkspace;
-  "><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+  waeup_skin here/get_waeup_skin;
+  student_theme python:test(waeup_skin == 'WAeUP_Student',1,0);
+  navigation_slot python:test(student_theme,'student_navigation_slot','navigation_slot');
+  object_tabs python:test(student_theme,'student_object_slot','staff_object_slot');
+  
+  ">
+  
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
   tal:attributes="lang locale; xml:lang locale">
@@ -34,6 +42,5 @@
   <metal:block fill-slot="head_slot"><metal:block define-slot="head_slot"
     /></metal:block>
-  <metal:block fill-slot="style_slot"><metal:block define-slot="style_slot"
-    /></metal:block>
+
   <metal:block fill-slot="javascript_head_slot"><metal:block
     define-slot="javascript_head_slot"
Index: WAeUP_SRP/base/skins/waeup_layout/layout_application_edit.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_layout/layout_application_edit.pt	(revision 2918)
+++ WAeUP_SRP/base/skins/waeup_layout/layout_application_edit.pt	(revision 2920)
@@ -2,5 +2,7 @@
                           isStudent context/isStudent;
                           info context/getApplicationInfo;
-                          app_email info/app_doc/app_email">
+                          app_email info/app_doc/app_email|nothing;
+                          app_passport info/has_passport;
+                          ">
 
 <metal:block tal:condition="isStaff">              
@@ -10,5 +12,5 @@
 
 <metal:block define-macro="application_student_edit"
-  tal:condition="python:isStudent and not app_email"
+  tal:condition="python:isStudent"
   tal:define="layout options/layout;
   ds options/datastructure;
@@ -19,11 +21,12 @@
   proceed options/proceed|nothing;
   widgets python:context.getRenderedWidgets(layout);
-  fields python:( 'app_email',
-                  'app_mobile',)">
+  widget_email widgets/app_email|nothing;
+  widget_passport widgets/passport|nothing;
+  ">
   <table class="layoutDefault" summary="Form layout"
-         tal:condition="layout/rows">
+         >
 
-    <tr tal:condition="widgets/app_email|nothing" 
-        tal:define="cell widgets/app_email|nothing;">
+    <tr tal:condition="python: widget_email and not app_email" 
+        tal:define="cell widget_email">
       <tal:block tal:define="widget cell/widget;
       wid widget/getWidgetId;
@@ -56,4 +59,51 @@
       </tal:block>
     </tr>
+    <tr tal:condition="python: widget_passport and not app_passport" 
+        tal:define="cell widget_passport">
+      <tal:block tal:define="widget cell/widget;
+      wid widget/getWidgetId;
+      err python:ds.getError(wid);
+      err_mapping python:ds.getErrorMapping(wid);
+      is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes);
+      tooltip_id python:wid + '_help';
+      widget_css_class widget/widget_css_class|nothing;
+      css_class python:test(err, 'row error','row')"
+      >
+        <div tal:attributes="class widget_css_class;
+        id python:widget.getHtmlWidgetId()+'_widget';"
+        >
+          <td>
+            <div class="label" tal:condition="widget/label_edit"
+                 tal:attributes="class python:test(is_required, 'label required','label')">
+              <label tal:content="widget/label_edit"
+                     tal:attributes="for cell/widget_input_area_id|nothing;">label</label>:
+            
+            <button type="button" class="tooltipControl"
+                    tal:condition="widget/help"
+                    tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
+            </div>
+          </td>
+          <td>
+            <span class="field">
+              <div tal:replace="structure cell/widget_rendered"/>
+            </span>
+            <div class="tooltipArea" style="visibility: hidden;"
+                 tal:condition="widget/help"
+                 tal:attributes="id tooltip_id;
+                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
+                 >
+              <tal:block tal:content="widget/help">This is the help for this field
+              </tal:block>
+            </div>
+            <tal:block condition="err">
+              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
+                <br /><em style="color: red"
+                          tal:content="msg">err</em>
+              </tal:block>
+            </tal:block>
+          </td>
+        </div>
+      </tal:block>
+    </tr>    
   </table>
 </metal:block>
Index: WAeUP_SRP/base/skins/waeup_student/admission_form.pt
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/admission_form.pt	(revision 2918)
+++ 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 2918)
+++ 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 2918)
+++ 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 2918)
+++ 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 2918)
+++ 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)
