Index: WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 784)
+++ WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 785)
@@ -60,10 +60,10 @@
                 da['app_ac_date'] = current
                 app_doc.edit(mapping = da)
-                dc = {}
-                dc['clr_ac_pin'] = pin
-                dc['entry_date'] = current
-                dc['session'] = "%s" % current.year()
-                dc['lga'] = app_doc.jamb_lga
-                info['clear_doc'].edit(mapping = dc)
+##                dc = {}
+##                dc['clr_ac_pin'] = pin
+##                dc['entry_date'] = current
+##                dc['session'] = "%s" % current.year()
+##                dc['lga'] = app_doc.jamb_lga
+##                info['clear_doc'].edit(mapping = dc)
         elif "Manager" in member.getRoles():
             pass
Index: WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt	(revision 784)
+++ WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt	(revision 785)
@@ -6,5 +6,5 @@
   <tal:block condition="context/isStudent">
        <strong> 
-         <span tal:condition="info/is_student" tal:content="python:info['student_doc'].Title()" /> 
+         <span tal:condition="info/is_student|nothing" tal:content="python:info['student_doc'].Title()" /> 
        </strong>
   </tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/check_admission.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/check_admission.py	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/check_admission.py	(revision 785)
@@ -0,0 +1,55 @@
+##parameters=REQUEST
+# $Id: apply_admission.py 649 2006-10-11 06:24:39Z joachim $
+"""
+request Clearance
+"""
+import DateTime
+current = DateTime.DateTime()
+pr = context.portal_registration
+
+
+type_name = 'StudentApplication'
+ti = context.portal_types[type_name]
+REQUEST.set('type_name',type_name)
+redirect = REQUEST.RESPONSE.redirect
+wf = context.portal_workflow
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+pr = context.portal_registration
+
+res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe',
+                      schema_id= 'student_application',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      formaction = "check_admission",
+                      button = "Check Admission",
+                      )
+if psm == 'invalid':
+    return context.check_admission_pin_form(rendered = res,
+                                 psm = "Please correct your input.",
+                                 #psm = "%s, %s" % (psm,ds),
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.check_admission_pin_form(rendered = res,
+                                 psm = None,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    s_id = ds.get('s_id')
+    student = getattr(context.campus.students, s_id)
+    review_state = wf.getInfoFor(student,'review_state',None)
+    if review_state == "finally_rejected":
+        url = "%s/campus/students/%s/pume/finally_rejected_view" % (context.portal_url(),s_id)
+        return redirect(url)
+    pin = str(ds.get('app_ac_pin'))
+    return redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
+          % (context.absolute_url(),s_id,pin.split('-')[2],pin))
+return
Index: WAeUP_SRP/trunk/skins/waeup_student/check_admission_pin_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/check_admission_pin_form.pt	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/check_admission_pin_form.pt	(revision 785)
@@ -0,0 +1,29 @@
+<tal:block define="rendered_main options/rendered;
+                   portal_status_message options/psm;
+                   data_storage options/ds;
+                   jamb options/jamb/getContent|nothing;
+                   edition python:1;"
+                   >
+<metal:block define-macro="edit_form">
+  <metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="header"
+    tal:define="creation creation|nothing;
+                edition edition|nothing;
+                metadata metadata|nothing"
+                >
+    </metal:block>
+      <metal:block fill-slot="main">
+        <h3>Check if your admitted! </h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+          <p>Instructions :</p>
+          <ul>
+            <li>Buy an Admission Scratch Card.</li> 
+            <li>Enter your JAMB registration number and the Admission PIN above.</li> 
+          </ul>
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/defer_admission.py	(revision 785)
@@ -0,0 +1,26 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+defer student and print Info.
+"""
+import DateTime
+current = DateTime.DateTime()
+request = context.REQUEST
+wf = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+roles = member.getRoles()
+
+info = context.getStudentInfo()
+
+info['app_doc'].edit(mapping={'defer_date':current,})
+wf.doActionFor(info['student'],'defer')
+return context.defer_done_view(info=info)
Index: WAeUP_SRP/trunk/skins/waeup_student/defer_done_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/defer_done_view.pt	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/defer_done_view.pt	(revision 785)
@@ -0,0 +1,31 @@
+<metal:html tal:define="info options/info|context/getStudentInfo">
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+      <span tal:condition="not: info">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+      </span>
+      <span tal:condition="info"
+            tal:define="review_state info/review_state">
+            
+        <h3>You defered your Study</h3>
+        <h3>My Application Record</h3>
+        <br />
+        <span tal:omit-tag=""
+              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
+              layout_mode='view', 
+              layout_id='student_application_fe')" 
+              />
+      </span>
+        <h3>My Study Course</h3>
+      <br />
+      <table tal:define="sc python: info['course_doc']">
+        <tr>
+          <td tal:content="sc/title" /> <td>ID: <span tal:content="sc/study_course" /></td>
+        </tr>
+        <tr>
+          <td tal:content="sc/title" /> <td tal:content="sc/study_course" />
+        </tr>
+      </table>
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_student/defer_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/defer_view.pt	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/defer_view.pt	(revision 785)
@@ -0,0 +1,62 @@
+<metal:html tal:define="info context/getStudentInfo">
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+      <span tal:condition="not: info">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+      </span>
+      <span tal:condition="info"
+            tal:define="review_state info/review_state">
+            
+        <div style="text-align: right"
+             tal:condition="python:review_state in ('admission_applied', 'clearance_pin_entered',)">
+        <a href="" target="slip" tal:attributes="href string:application_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Application Slip
+        </a>
+        
+        </div>
+
+        <h3>My Application Record</h3>
+        <br />
+        <span tal:omit-tag=""
+              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
+              layout_mode='view', 
+              layout_id='student_application_fe')" 
+              />
+      </span>
+        <h3>My Study Course</h3>
+      <br />
+      <table tal:define="sc python: info['course_doc']">
+        <tr>
+          <td tal:content="sc/title" /> <td tal:content="sc/study_course" />
+        </tr>
+      </table>
+        <span tal:condition="python:0" tal:omit-tag=""
+              tal:content="structure python: info['course_doc'].render(proxy=info['course_doc'],
+              layout_mode='view_student_course', 
+              layout_id='student_study_course')" 
+              />
+      
+      <form action="." method="post" class="group"
+            >
+        <table width="100%" cellspacing="0" cellpadding="2"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+                <input type="submit" name="defer_admission:method" value="defer"
+                       class="destructive"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       (cpsmcat('confirm that you defer'), )" 
+                       />
+                <input type="submit" name="request_clearance:method"
+                       class="context" value="request Clearance" 
+                       />
+            </td>
+          </tr>
+        </table>
+      </form>
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_student/finally_rejected_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/finally_rejected_view.pt	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/finally_rejected_view.pt	(revision 785)
@@ -0,0 +1,31 @@
+<metal:html tal:define="app_doc python: context.aq_parent.application.getContent();
+                        pume_doc python: context.getContent()">
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+
+            
+        <div style="text-align: right">
+        <a href="" target="slip" tal:attributes="href string:pume_anon_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+        
+        </a>
+        </div>
+
+        <h3><span tal:content="app_doc/jamb_firstname" />
+                            <span tal:content="app_doc/jamb_lastname" /> is not admitted</h3>
+
+        <span tal:omit-tag=""
+              tal:content="structure python: app_doc.render(proxy=app_doc,
+              layout_mode='view_info', 
+              layout_id='student_application_fe')" 
+              />        
+        <span tal:omit-tag=""
+              tal:content="structure python: pume_doc.render(proxy=pume_doc,
+              layout_mode='view', 
+              layout_id='student_pume_fe')" 
+              />
+
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 784)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 785)
@@ -28,14 +28,19 @@
     if context.isManager() and 'students' in path_info:
         student_id = path_info[path_info.index('students')+1]
+    elif member_id == "Anonymous User":
+        return None
     else:
         student_id = member_id
 else:
     student_id = student.getId()
-res = context.portal_catalog(id = student_id,portal_type='Student')
-if not res:# or len(res) > 1:
+student_path = "/srp/campus/students/%s" % student_id
+student = context.restrictedTraverse(student_path,default=None)
+if student is None or student.portal_type != 'Student':
     return None
-brain = res[-1]
-student = brain.getObject()
-student_path = brain.getPath()
+##res = context.portal_catalog(id = student_id,portal_type='Student')
+##if not res:# or len(res) > 1:
+##    return None
+##brain = res[-1]
+##student = brain.getObject()
 info['review_state'] = wf.getInfoFor(student,'review_state',None)
 info['student'] = student
@@ -47,31 +52,41 @@
 info['per'] = student.personal
 info['per_doc'] = student.personal.getContent()
+course = getattr(student,'study_course',None)
+info['course'] = course
+if course:
+    info['course_doc'] = student.study_course.getContent()
 info['sex'] = 'male'
 if info['per_doc'].sex:
     info['sex'] = 'female'
-res = context.portal_catalog(container_path=student_path,
-                             portal_type='StudentAccommodation')
-if res:
-    acco = res[0].getObject()
-    info['acco'] = acco
+##res = context.portal_catalog(container_path=student_path,
+##                             portal_type='StudentAccommodation')
+##if res:
+##    acco = res[0].getObject()
+acco = getattr(student,'accommodation',None)
+if acco.portal_type != "StudentAccomodation":
+    acco = None
+info['acco'] = acco
+if acco is not None:
     info['acco_doc'] = acco.getContent()
     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
-else:
-    info['acco'] = None
-res = context.portal_catalog(container_path=student_path,
-                             portal_type='StudentClearance')
-if res:
-    clear = res[0].getObject()
-    info['clear'] = clear
+##res = context.portal_catalog(container_path=student_path,
+##                             portal_type='StudentClearance')
+##if res:
+##    clear = res[0].getObject()
+##    info['clear'] = clear
+clear = getattr(student,'clearance',None)
+info['clear'] = clear
+if clear is not None:
     info['clear_doc'] = clear.getContent()
     info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None)
-else:
-    info['clear'] = None
 
-res = context.portal_catalog(container_path=student_path,
-                             portal_type='StudentPume')
-if res:
-    pume = res[0].getObject()
-    info['pume'] = clear
+##res = context.portal_catalog(container_path=student_path,
+##                             portal_type='StudentPume')
+##if res:
+##    pume = res[0].getObject()
+##    info['pume'] = clear
+pume = getattr(student,'pume',None)
+info['pume'] = pume
+if pume is not None:
     info['pume_doc'] = pume.getContent()
     info['pume_review_state'] = wf.getInfoFor(pume,'review_state',None)
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_waeup_view_student_course.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_waeup_view_student_course.pt	(revision 785)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_waeup_view_student_course.pt	(revision 785)
@@ -0,0 +1,32 @@
+<!-- $Id: layout_waeup_lib.pt 770 2006-10-29 05:24:04Z henrik $ -->
+<metal:block define-macro="table_view"
+             tal:define="layout options/layout;
+             widgets python:context.getRenderedWidgets(layout);
+             fields python:(
+                            'title',
+                            'study_course',
+                            'faculty',
+                            'department',
+                            )"
+                                  >
+  <table>
+    <tr tal:repeat="field fields">
+      <tal:block tal:define="cell python: widgets[field]">
+        <tal:block define="widget cell/widget">
+          <div tal:attributes="class cell/widget_css_class|string:label;
+          id python:widget.getHtmlWidgetId()+'_widget';"
+          >
+            <td >
+              <span class="dlabel"
+                    tal:condition="widget/label"
+                    tal:content="widget/label">label</span>:
+            </td>
+            <td> 
+              <span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </div>
+        </tal:block>
+      </tal:block>
+    </tr>
+  </table>
+</metal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt	(revision 784)
+++ WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt	(revision 785)
@@ -11,5 +11,5 @@
                    
                    
-<table class="registration">
+<table class="registration" tal:condition="info|nothing">
   
   <span tal:condition="python:path('info/review_state')=='application_pin_entered'">
Index: WAeUP_SRP/trunk/skins/waeup_student/request_clearance.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/request_clearance.py	(revision 784)
+++ 	(revision )
@@ -1,51 +1,0 @@
-##parameters=REQUEST
-# $Id: apply_admission.py 649 2006-10-11 06:24:39Z joachim $
-"""
-request Clearance
-"""
-import DateTime
-current = DateTime.DateTime()
-pr = context.portal_registration
-
-
-type_name = 'StudentApplication'
-ti = context.portal_types[type_name]
-REQUEST.set('type_name',type_name)
-
-validate = REQUEST.has_key("cpsdocument_create_button")
-
-lt = context.portal_layouts
-pr = context.portal_registration
-
-res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe',
-                      schema_id= 'student_application',
-                      context=context,
-                      mapping=validate and REQUEST,
-                      ob={},
-                      layout_mode='create',
-                      formaction = "request_clearance",
-                      button = "Request Clearance",
-                      )
-if psm == 'invalid':
-    return context.clearance_pin_form(rendered = res,
-                                 psm = "Please correct your input.",
-                                 #psm = "%s, %s" % (psm,ds),
-                                 firstlayout = True,
-                                 lastlayout = True,
-                                 ds = ds,
-                                 )
-elif psm == '':
-    return context.clearance_pin_form(rendered = res,
-                                 psm = None,
-                                 firstlayout = True,
-                                 lastlayout = True,
-                                 ds = ds,
-                                 )
-elif psm == 'valid':
-    s_id = ds.get('s_id')
-    pin = str(ds.get('app_ac_pin'))
-    return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
-          % (context.absolute_url(),s_id,pin.split('-')[2],pin))
-return
-
-
Index: WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 784)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 785)
@@ -32,6 +32,8 @@
     if state == 'admission_applied':
         return redirect("%s/application_view" % student.absolute_url())
-    elif state in ('application_pin_entered','admitted'):
+    elif state in ('application_pin_entered',):
         return redirect("%s/application_edit" % student.absolute_url())
+    elif state in ('admitted',):
+        return redirect("%s/defer_view" % student.absolute_url())
     elif state == 'clearance_pin_entered':
         return redirect("%s/student_view" % info['clear'].absolute_url())
