Index: /waeup_product/trunk/Extensions/install.py
===================================================================
--- /waeup_product/trunk/Extensions/install.py	(revision 165)
+++ /waeup_product/trunk/Extensions/install.py	(revision 166)
@@ -110,5 +110,5 @@
         waeup_ptypes = "'University','StudentsFolder','Student','Jamb','Faculty','Department','Course'"
         waeup_ptypes += ",'AccoFolder','Accommodation','StudentPersonal','AcademicsFolder'"
-        waeup_ptypes += ",'StudyLevel','Semester','CourseTicket'"
+        waeup_ptypes += ",'StudyLevel','Semester','CourseTicket','StudentDocuments'"
         if CPSSubscriptions: ###(
 
@@ -429,4 +429,5 @@
                       'Student': 'waeup_student_wf',
                       'StudentPersonal': 'waeup_student_wf',
+                      'StudentDocuments': 'waeup_student_wf',
                       'Jamb': 'waeup_section_wf',
                       'ScratchCard': 'waeup_section_wf',
Index: /waeup_product/trunk/Students.py
===================================================================
--- /waeup_product/trunk/Students.py	(revision 165)
+++ /waeup_product/trunk/Students.py	(revision 166)
@@ -78,9 +78,13 @@
                 '%s_sc_id' % ident : ds.get('sc_id'),
                 '%s_sc_value' % ident : ds.get('sc_value'),
+                '%s_date' % ident : ds.get('sc_date'),
                 }
-        tmp_user = CPSUnrestrictedUser('pseudo', '',
+                
+        if self.portal_membership.isAnonymousUser():
+            tmp_user = CPSUnrestrictedUser('s%(jamb_id)s' % ds, '',
                                        ['StudentManager'], '')
-        tmp_user = tmp_user.__of__(self.acl_users)
-        newSecurityManager(None, tmp_user)
+            tmp_user = tmp_user.__of__(self.acl_users)
+            newSecurityManager(None, tmp_user)
+        #print str(dict)
         self.edit(mapping=dict)
 
@@ -94,4 +98,26 @@
         return False
 
+    security.declareProtected(View,"accommodationIsBooked")
+    def accommodationIsBooked(self):
+        """is the accommodation booked"""
+        if self.accommodation_sc_pin != '':
+            return True
+        return False
+
+    security.declareProtected(View,"accommodationIsPayed")
+    def accommodationIsPayed(self):
+        """is the accommodation payed"""
+        if self.accommodation_sc_pin != '':
+            return True
+        return False
+
+    security.declareProtected(View,"isRegisteredForCurrentLevel")
+    def isRegisteredForCurrentLevel(self):
+        """is the student registered for the current level"""
+        for l in  self.aq_parent.objectValues():
+            if l.portal_type == 'StudyLevel':
+                return True
+        return False
+
 InitializeClass(Student)
 
@@ -138,4 +164,43 @@
     """Add a Students personal data."""
     ob = StudentPersonal(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+
+###)
+
+studentdocuments_fti = { ###(
+    'title': 'WAeUP StudentDocuments',
+    'description': '',
+    'content_icon': 'student.gif',
+    'content_meta_type': 'StudentDocuments',
+    'factory': 'addStudent',
+    'immediate_view': 'temporary_view_all',
+    'global_allow': True,
+    'filter_content_types': True,
+    'allowed_content_types': (),
+    'allow_discussion': False,
+}
+
+###)
+
+class StudentDocuments(CPSDocument): ###(
+    """
+    WAeUP Student container for the various student data
+    """
+    meta_type = 'StudentDocuments'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        content = self.getContent()
+        return "Scanned Documents"
+
+
+InitializeClass(StudentDocuments)
+
+def addStudentDocuments(container, id, REQUEST=None, **kw):
+    """Add a Students documents"""
+    ob = StudentDocuments(id, **kw)
     return CPSBase_adder(container, ob, REQUEST=REQUEST)
 
Index: /waeup_product/trunk/University.py
===================================================================
--- /waeup_product/trunk/University.py	(revision 165)
+++ /waeup_product/trunk/University.py	(revision 166)
@@ -28,4 +28,26 @@
         return self.REQUEST
     
+    
+##    security.declarePublic('backEnd')
+##    def backEnd(self):
+##        """ are we in back-end mode"""
+##        mtool = self.portal_membership
+##        member = mtool.getAuthenticatedMember()
+##        roles = member.getRoles()
+##        if 'UniversityManager' in roles or 'StudentManager' in roles:
+##            return True
+##        return False
+##
+##    security.declarePublic('frontEnd')
+##    def frontEnd(self):
+##        """ are we in front-end mode"""
+##        mtool = self.portal_membership
+##        member = mtool.getAuthenticatedMember()
+##        roles = member.getRoles()
+##        if 'Student' in roles:
+##            return True
+##        return False
+    
+        
 InitializeClass(University)
 
Index: /waeup_product/trunk/__init__.py
===================================================================
--- /waeup_product/trunk/__init__.py	(revision 165)
+++ /waeup_product/trunk/__init__.py	(revision 166)
@@ -13,4 +13,5 @@
 
 fti = (Students.student_fti,
+       Students.studentdocuments_fti,
        Students.studentpersonal_fti,
        Students.jamb_fti,
@@ -28,4 +29,5 @@
                   Students.StudentsFolder,
                   Students.Student,
+                  Students.StudentDocuments,
                   Students.StudentPersonal,
                   Students.Jamb,
@@ -43,4 +45,5 @@
                        Students.addStudentsFolder,
                        Students.addStudent,
+                       Students.addStudentDocuments,
                        Students.addStudentPersonal,
                        Students.addJamb,
Index: /waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
===================================================================
--- /waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py	(revision 166)
@@ -202,109 +202,4 @@
 ###)
 
-student_layout = { ###(
-    'widgets': {
-        'jamb_is_admitted': {
-            'type': 'Boolean Widget',
-            'data': {
-                'title': 'JAMB Admission',
-                'fields': ('jamb_is_admitted',),
-                'is_required': False,
-                'label': 'JAMB Admission',
-                'label_edit': 'JAMB Admission',
-                'description': '',
-                'help': '',
-                'is_i18n': False,
-                'readonly_layout_modes': (),
-                'hidden_layout_modes': (),
-                'hidden_readonly_layout_modes': (),
-                'hidden_empty': False,
-                'hidden_if_expr': '',
-                'css_class': '',
-                'widget_mode_expr': '',
-                'display_width': 10,
-                'size_max': 0,
-            },
-        },
-##        'accommodation': {
-##            'type': 'String Widget',
-##            'data': {
-##                'title': 'Accommodation',
-##                'fields': ('accommodation',),
-##                'is_required': False,
-##                'label': 'Accommodation',
-##                'label_edit': 'Accommodation',
-##                'description': '',
-##                'help': '',
-##                'is_i18n': False,
-##                'readonly_layout_modes': (),
-##                'hidden_layout_modes': (),
-##                'hidden_readonly_layout_modes': (),
-##                'hidden_empty': False,
-##                'hidden_if_expr': '',
-##                'css_class': '',
-##                'widget_mode_expr': '',
-##                'display_width': 10,
-##                'size_max': 0,
-##            },
-##        },
-##        'accommodation_sc_pin': {
-##            'type': 'String Widget',
-##            'data': {
-##                'title': 'Accommodation SC Pin',
-##                'fields': ('accommodation_sc_pin',),
-##                'is_required': False,
-##                'label': 'Accommodation SC Pin',
-##                'label_edit': 'Accommodation SC Pin',
-##                'description': '',
-##                'help': '',
-##                'is_i18n': False,
-##                'readonly_layout_modes': (),
-##                'hidden_layout_modes': (),
-##                'hidden_readonly_layout_modes': (),
-##                'hidden_empty': False,
-##                'hidden_if_expr': '',
-##                'css_class': '',
-##                'widget_mode_expr': '',
-##                'display_width': 10,
-##                'size_max': 0,
-##            },
-##        },
-        'faculty': {
-            'type': 'String Widget',
-            'data': {
-                'title': 'Faculty',
-                'fields': ('faculty',),
-                'is_required': False,
-                'label': 'Faculty',
-                'label_edit': 'Faculty',
-                'description': '',
-                'help': '',
-                'is_i18n': False,
-                'readonly_layout_modes': (),
-                'hidden_layout_modes': (),
-                'hidden_readonly_layout_modes': (),
-                'hidden_empty': False,
-                'hidden_if_expr': '',
-                'css_class': '',
-                'widget_mode_expr': '',
-                'display_width': 10,
-                'size_max': 0,
-            },
-        },
-    },
-    'layout': {
-        'style_prefix': 'layout_default_',
-        'flexible_widgets': (),
-        'ncols': 1,
-        'rows': [
-            #[{'widget_id': 'jamb_is_admitted', 'ncols': 1},],
-            #[{'widget_id': 'accommodation', 'ncols': 1},],
-            #[{'widget_id': 'accommodation_sc_pin', 'ncols': 1},],
-            #[{'widget_id': 'faculty', 'ncols': 1},],
-        ]
-    },
-}
-###)
-
 firstname = { ###(
             'type': 'String Widget',
@@ -473,4 +368,452 @@
 ###)
 
+student_layout = { ###(
+    'widgets': {
+        'jamb_is_admitted': {
+            'type': 'Boolean Widget',
+            'data': {
+                'title': 'JAMB Admission',
+                'fields': ('jamb_is_admitted',),
+                'is_required': False,
+                'label': 'JAMB Admission',
+                'label_edit': 'JAMB Admission',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+
+        'faculty': {
+            'type': 'String Widget',
+            'data': {
+                'title': 'Faculty',
+                'fields': ('faculty',),
+                'is_required': False,
+                'label': 'Faculty',
+                'label_edit': 'Faculty',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+        'accommodation': {
+            'type': 'String Widget',
+            'data': {
+                'title': 'Accommodation',
+                'fields': ('accommodation',),
+                'is_required': False,
+                'label': 'Accommodation',
+                'label_edit': 'Accommodation',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+        'accommodation_sc_id': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'Accommodation SC ID',
+                'fields': ('accommodation_sc_id',),
+                'is_required': False,
+                'label': 'Accommodation SC ID',
+                'label_edit': 'Accommodation SC ID',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'accommodation_sc_pin': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'Accommodation SC Pin',
+                'fields': ('accommodation_sc_pin',),
+                'is_required': False,
+                'label': 'Accommodation SC Pin',
+                'label_edit': 'Accommodation SC Pin',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'accommodation_sc_value': { ###(
+            'type': 'Float Widget',
+            'data': {
+                'title': 'Accommodation SC Value',
+                'fields': ('accommodation_sc_value',),
+                'is_required': False,
+                'label': 'Accommodation SC Value',
+                'label_edit': 'Accommodation SC Value',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'accommodation_date': { ###(
+            'type': 'DateTime Widget',
+            'data': {
+                'title': 'Accommodation SC Pin',
+                'fields': ('accommodation_date',),
+                'is_required': False,
+                'label': 'Accommodation SC Date',
+                'label_edit': 'Accommodation SC Date',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'hostel_fee_sc_id': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'hostel_fee SC ID',
+                'fields': ('hostel_fee_sc_id',),
+                'is_required': False,
+                'label': 'Hostel Fee SC ID',
+                'label_edit': 'Hostel Fee SC ID',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'hostel_fee_sc_pin': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'hostel_fee SC Pin',
+                'fields': ('hostel_fee_sc_pin',),
+                'is_required': False,
+                'label': 'Hostel Fee SC Pin',
+                'label_edit': 'Hostel Fee SC Pin',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'hostel_fee_sc_value': { ###(
+            'type': 'Float Widget',
+            'data': {
+                'title': 'hostel_fee SC Value',
+                'fields': ('hostel_fee_sc_value',),
+                'is_required': False,
+                'label': 'Hostel Fee SC Value',
+                'label_edit': 'Hostel Fee SC Value',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'hostel_fee_date': { ###(
+            'type': 'DateTime Widget',
+            'data': {
+                'title': 'hostel_fee SC Pin',
+                'fields': ('hostel_fee_date',),
+                'is_required': False,
+                'label': 'Hostel Fee SC Date',
+                'label_edit': 'Hostel Fee SC Date',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'adm_check_sc_id': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'Admission check SC ID',
+                'fields': ('adm_check_sc_id',),
+                'is_required': False,
+                'label': 'Admission check SC ID',
+                'label_edit': 'Admission check SC ID',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'adm_check_sc_pin': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'Admission check SC Pin',
+                'fields': ('adm_check_sc_pin',),
+                'is_required': False,
+                'label': 'Admission check SC Pin',
+                'label_edit': 'Admission check SC Pin',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'adm_check_sc_value': { ###(
+            'type': 'Float Widget',
+            'data': {
+                'title': 'Admission check SC Value',
+                'fields': ('adm_check_sc_value',),
+                'is_required': False,
+                'label': 'Admission check SC Value',
+                'label_edit': 'Admission check SC Value',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'adm_check_date': { ###(
+            'type': 'DateTime Widget',
+            'data': {
+                'title': 'Admission check SC Pin',
+                'fields': ('adm_check_date',),
+                'is_required': False,
+                'label': 'Admission check SC Date',
+                'label_edit': 'Admission check SC Date',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'clearence_sc_id': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'Clearence SC ID',
+                'fields': ('clearence_sc_id',),
+                'is_required': False,
+                'label': 'Clearence SC ID',
+                'label_edit': 'Clearence SC ID',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'clearence_sc_pin': { ###(
+            'type': 'String Widget',
+            'data': {
+                'title': 'clearence SC Pin',
+                'fields': ('clearence_sc_pin',),
+                'is_required': False,
+                'label': 'Clearence SC Pin',
+                'label_edit': 'Clearence SC Pin',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'clearence_sc_value': { ###(
+            'type': 'Float Widget',
+            'data': {
+                'title': 'clearence SC Value',
+                'fields': ('clearence_sc_value',),
+                'is_required': False,
+                'label': 'Clearence SC Value',
+                'label_edit': 'Clearence SC Value',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+        'clearence_date': { ###(
+            'type': 'DateTime Widget',
+            'data': {
+                'title': 'clearence SC Pin',
+                'fields': ('clearence_date',),
+                'is_required': False,
+                'label': 'Clearence SC Date',
+                'label_edit': 'Clearence SC Date',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },###)
+    },
+    'layout': {
+        'style_prefix': 'layout_default_',
+        'flexible_widgets': (),
+        'ncols': 1,
+        'rows': [
+            [{'widget_id': 'adm_check_sc_id', 'ncols': 1},],
+            [{'widget_id': 'adm_check_sc_pin', 'ncols': 1},],
+            [{'widget_id': 'adm_check_sc_value', 'ncols': 1},],
+            [{'widget_id': 'adm_check_date', 'ncols': 1},],
+            [{'widget_id': 'clearence_sc_id', 'ncols': 1},],
+            [{'widget_id': 'clearence_sc_pin', 'ncols': 1},],
+            [{'widget_id': 'clearence_sc_value', 'ncols': 1},],
+            [{'widget_id': 'clearence_date', 'ncols': 1},],
+            [{'widget_id': 'accommodation', 'ncols': 1},],
+            [{'widget_id': 'accommodation_sc_id', 'ncols': 1},],
+            [{'widget_id': 'accommodation_sc_pin', 'ncols': 1},],
+            [{'widget_id': 'accommodation_sc_value', 'ncols': 1},],
+            [{'widget_id': 'accommodation_date', 'ncols': 1},],
+            [{'widget_id': 'hostel_fee_sc_id', 'ncols': 1},],
+            [{'widget_id': 'hostel_fee_sc_pin', 'ncols': 1},],
+            [{'widget_id': 'hostel_fee_sc_value', 'ncols': 1},],
+            [{'widget_id': 'hostel_fee_date', 'ncols': 1},],
+        ]
+    },
+}###)
+
 student_personal_layout = { ###(
     'widgets': {
@@ -499,61 +842,4 @@
                 'display_width': 10,
                 'size_max': 0,
-            },
-        },
-        'photo': {
-            'type': 'Photo Widget',
-            'data': {
-                'title': '',
-                'fields': ('photo',),
-                'is_required': False,
-                'label': 'Personal Picture',
-                'label_edit': 'Personal Picture',
-                'description': '',
-                'help': '',
-                'is_i18n': False,
-                'readonly_layout_modes': (),
-                'hidden_layout_modes': (),
-                'hidden_readonly_layout_modes': (),
-                'hidden_empty': False,
-                'hidden_if_expr': '',
-                'widget_mode_expr': '',
-                'css_class': '',
-                'css_class_expr': '',
-                'javascript_expr': '',
-                'deletable': True,
-                'size_max': 4194304,
-                'display_width': 90,
-                'display_height': 180,
-                'allow_resize': True,
-                'render_position': 'left',
-                'configurable': 'nothing',
-                'keep_original': 1,
-            },
-        },
-        'birth_certificate': {
-            'type': 'Image Widget',
-            'data': {
-                'title': '',
-                'fields': ('birth_certificate',),
-                'is_required': False,
-                'label': 'Birth Certificate',
-                'label_edit': 'Birth Certificate',
-                'description': '',
-                'help': '',
-                'is_i18n': False,
-                'readonly_layout_modes': (),
-                'hidden_layout_modes': (),
-                'hidden_readonly_layout_modes': (),
-                'hidden_empty': False,
-                'hidden_if_expr': '',
-                'widget_mode_expr': '',
-                'css_class': '',
-                'css_class_expr': '',
-                'javascript_expr': '',
-                'deletable': True,
-                'size_max': 4194304,
-                'display_width': 300,
-                'display_height':600,
-                'allow_resize': True,
             },
         },
@@ -569,6 +855,159 @@
             [{'widget_id': 'sex', 'ncols': 1},],
             [{'widget_id': 'birthday', 'ncols': 1},],
+        ]
+    },
+}###)
+
+student_documents = { ###(
+    'widgets': {
+        'photo': { ###(
+            'type': 'Photo Widget',
+            'data': {
+                'title': '',
+                'fields': ('photo',),
+                'is_required': True,
+                'label': 'Personal Picture',
+                'label_edit': 'Personal Picture',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'widget_mode_expr': '',
+                'css_class': '',
+                'css_class_expr': '',
+                'javascript_expr': '',
+                'deletable': True,
+                'size_max': 40960,
+                'display_width': 90,
+                'display_height': 180,
+                'allow_resize': True,
+                'render_position': 'left',
+                'configurable': 'nothing',
+                'keep_original': 1,
+            },
+        },###)
+        'birth_certificate': { ###(
+            'type': 'Image Widget',
+            'data': {
+                'title': '',
+                'fields': ('birth_certificate',),
+                'is_required': True,
+                'label': 'Birth Certificate',
+                'label_edit': 'Birth Certificate',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'widget_mode_expr': '',
+                'css_class': '',
+                'css_class_expr': '',
+                'javascript_expr': '',
+                'deletable': True,
+                'size_max': 40960,
+                'display_width': 300,
+                'display_height':600,
+                'allow_resize': True,
+            },
+        },###)
+        'passport': { ###(
+            'type': 'Image Widget',
+            'data': {
+                'title': '',
+                'fields': ('passport',),
+                'is_required': True,
+                'label': 'scanned Passport',
+                'label_edit': 'scanned Passport',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'widget_mode_expr': '',
+                'css_class': '',
+                'css_class_expr': '',
+                'javascript_expr': '',
+                'deletable': True,
+                'size_max': 40960,
+                'display_width': 300,
+                'display_height':600,
+                'allow_resize': True,
+            },
+        },###)
+        'results_first': { ###(
+            'type': 'Image Widget',
+            'data': {
+                'title': '',
+                'fields': ('results_first',),
+                'is_required': True,
+                'label': '1st Sitting Results',
+                'label_edit': '1st Sitting Results',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'widget_mode_expr': '',
+                'css_class': '',
+                'css_class_expr': '',
+                'javascript_expr': '',
+                'deletable': True,
+                'size_max': 40960,
+                'display_width': 300,
+                'display_height':600,
+                'allow_resize': True,
+            },
+        },###)
+        'results_second': { ###(
+            'type': 'Image Widget',
+            'data': {
+                'title': '',
+                'fields': ('results_second',),
+                'is_required': False,
+                'label': '2nd Sitting Results',
+                'label_edit': '2nd Sitting Results',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'widget_mode_expr': '',
+                'css_class': '',
+                'css_class_expr': '',
+                'javascript_expr': '',
+                'deletable': True,
+                'size_max': 40960,
+                'display_width': 300,
+                'display_height':600,
+                'allow_resize': True,
+            },
+        },###)
+    },
+    'layout': {
+        'style_prefix': 'layout_personal_',
+        'flexible_widgets': (),
+        'ncols': 1,
+        'rows': [
             [{'widget_id': 'photo', 'ncols': 1},],
             [{'widget_id': 'birth_certificate', 'ncols': 1},],
+            [{'widget_id': 'passport', 'ncols': 1},],
+            [{'widget_id': 'results_first', 'ncols': 1},],
+            [{'widget_id': 'results_second', 'ncols': 1},],
         ]
     },
@@ -759,5 +1198,5 @@
     },
    'layout': {
-        'style_prefix': 'layout_admission_',
+        'style_prefix': 'layout_sc_',
         'flexible_widgets': (),
         'ncols': 1,
@@ -865,5 +1304,5 @@
     },
    'layout': {
-        'style_prefix': 'layout_clearence_',
+        'style_prefix': 'layout_sc_',
         'flexible_widgets': (),
         'ncols': 1,
@@ -1614,5 +2053,5 @@
         'data': {
                 'title': 'SC ID',
-                'fields': ('accommodation_sc_id'),
+                'fields': ('sc_id'),
                 'is_required': False,
                 'label': 'Card Serial Number ',
@@ -1632,9 +2071,9 @@
             }
         },###)
-        'sc_pin': { ###(
+    'sc_pin': { ###(
          'type': 'Scratchcard Pin Widget',
          'data': {
                 'title': 'SC Pin',
-                'fields': ('accommodation_sc_pin'),
+                'fields': ('sc_pin'),
                 'is_required': True,
                 'label': 'enter  PIN',
@@ -1654,9 +2093,9 @@
             },
         },###)
-        'sc_value': { ###(
+    'sc_value': { ###(
          'type': 'Float Widget',
          'data': {
                 'title': 'Scratch card value',
-                'fields': ('accommodation_sc_value',),
+                'fields': ('sc_value',),
                 'is_required': False,
                 'label': 'SC Value',
@@ -1678,5 +2117,5 @@
                },
    'layout': {
-        'style_prefix': 'layout_accobook_',
+        'style_prefix': 'layout_sc_',
         'flexible_widgets': (),
         'ncols': 1,
@@ -1690,4 +2129,85 @@
 ###)
 
+accopay = { ###(
+    'widgets': {
+     'sc_id': { ###(
+        'type': 'String Widget',
+        'data': {
+                'title': 'SC ID',
+                'fields': ('sc_id'),
+                'is_required': False,
+                'label': 'Card Serial Number ',
+                'label_edit': 'Card Serial Number',
+                'description': 'Card Serial Number ',
+                'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': 'python:1',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 0,
+            }
+        },###)
+    'sc_pin': { ###(
+         'type': 'Scratchcard Pin Widget',
+         'data': {
+                'title': 'SC Pin',
+                'fields': ('sc_pin'),
+                'is_required': True,
+                'label': 'enter  PIN',
+                'label_edit': 'enter an Hostel payment PIN',
+                'description': '',
+                'help': 'Please enter a PIN valid for paying hostel fee',
+                'is_i18n': False,
+                'readonly_layout_modes': (),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 10,
+            },
+        },###)
+    'sc_value': { ###(
+         'type': 'Float Widget',
+         'data': {
+                'title': 'Scratch card value',
+                'fields': ('sc_value',),
+                'is_required': False,
+                'label': 'SC Value',
+                'label_edit': 'Scratcard Value',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'readonly_layout_modes': ('create'),
+                'hidden_layout_modes': (),
+                'hidden_readonly_layout_modes': (),
+                'hidden_empty': False,
+                'hidden_if_expr': '',
+                'css_class': '',
+                'widget_mode_expr': '',
+                'display_width': 10,
+                'size_max': 10,
+            },
+        },###)
+               },
+   'layout': {
+        'style_prefix': 'layout_sc_',
+        'flexible_widgets': (),
+        'ncols': 1,
+        'rows': [
+            #[{'widget_id': 'sc_id', 'ncols': 1},],
+            [{'widget_id': 'sc_value', 'ncols': 1},],
+            [{'widget_id': 'sc_pin', 'ncols': 1},],
+        ]
+    },
+}###)
+
 layouts = {}
 layouts['university'] = common_layout
@@ -1695,8 +2215,10 @@
 layouts['student'] = student_layout
 layouts['study_level'] = study_level
+layouts['student_documents'] = student_documents
 layouts['student_personal'] = student_personal_layout
 layouts['student_eligibility'] = student_eligibility
 layouts['accommodation'] = accommodation
 layouts['accobook'] = accobook
+layouts['accopay'] = accopay
 layouts['scratch_card'] = scratch_card
 layouts['admission'] = admission
Index: /waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
===================================================================
--- /waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py	(revision 166)
@@ -45,4 +45,23 @@
 sc_value = { ###(
         'type': 'CPS Float Field',
+        'data': {
+            'default_expr': 'python:0.',
+            'is_searchabletext': True,
+            'acl_read_permissions': '',
+            'acl_read_roles': '',
+            'acl_read_expr': '',
+            'acl_write_permissions': '',
+            'acl_write_roles': '',
+            'acl_write_expr': '',
+            'read_ignore_storage': False,
+            'read_process_expr': '',
+            'read_process_dependent_fields': (),
+            'write_ignore_storage': False,
+            'write_process_expr': '',
+            },
+        }
+###)
+sc_date = { ###(
+        'type': 'CPS DateTime Field',
         'data': {
             'default_expr': 'python:500.',
@@ -137,5 +156,4 @@
         'data': {
             'is_searchabletext': 0,
-            'acl_write_roles': 'SectionReader',
         },
     }, 
@@ -150,4 +168,22 @@
         },
     }, 
+    'accommodation' : { ###(
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+            'acl_read_permissions': '',
+            'acl_read_roles': '',
+            'acl_read_expr': '',
+            'acl_write_permissions': '',
+            'acl_write_roles': '',
+            'acl_write_expr': '',
+            'read_ignore_storage': False,
+            'read_process_expr': '',
+            'read_process_dependent_fields': (),
+            'write_ignore_storage': False,
+            'write_process_expr': '',
+             },
+        }, ###)
     'accommodation_sc_id' : sc_id, 
     'accommodation_sc_pin' : sc_pin, 
@@ -160,4 +196,14 @@
         },
     }, 
+    'hostel_fee_sc_id' : sc_id, 
+    'hostel_fee_sc_pin' : sc_pin, 
+    'hostel_fee_sc_value' : sc_value, 
+    'hostel_fee_date' : {
+        'type': 'CPS DateTime Field',
+        'data': {
+            'is_searchabletext': 0,
+            'acl_write_roles': 'SectionReader',
+        },
+    }, 
 }
 ###)
@@ -205,4 +251,46 @@
 ###)
 
+student_hostel_fee = { ###(
+    'sc_id': sc_id,
+    'sc_pin': sc_pin,
+    'sc_value': { ###(
+        'type': 'CPS Float Field',
+        'data': {
+            'default_expr': 'python:2500.',
+            'is_searchabletext': True,
+            'acl_read_permissions': '',
+            'acl_read_roles': '',
+            'acl_read_expr': '',
+            'acl_write_permissions': '',
+            'acl_write_roles': '',
+            'acl_write_expr': '',
+            'read_ignore_storage': False,
+            'read_process_expr': '',
+            'read_process_dependent_fields': (),
+            'write_ignore_storage': False,
+            'write_process_expr': '',
+            },
+        },###)
+    'accommodation': {
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+            'acl_read_permissions': '',
+            'acl_read_roles': '',
+            'acl_read_expr': '',
+            'acl_write_permissions': '',
+            'acl_write_roles': '',
+            'acl_write_expr': '',
+            'read_ignore_storage': False,
+            'read_process_expr': '',
+            'read_process_dependent_fields': (),
+            'write_ignore_storage': False,
+            'write_process_expr': '',
+             },
+        },
+}
+###)
+
 student_admission = { ###(
     'sc_id': sc_id,
@@ -346,4 +434,8 @@
         },
     },
+}
+###)
+
+student_documents = { ###(
      'photo': {
         'type': 'CPS Image Field',
@@ -353,4 +445,22 @@
     },
      'birth_certificate': {
+        'type': 'CPS Image Field',
+        'data': {
+            'is_searchabletext': 0,
+        },
+    },
+     'passport': {
+        'type': 'CPS Image Field',
+        'data': {
+            'is_searchabletext': 0,
+        },
+    },
+     'results_first': {
+        'type': 'CPS Image Field',
+        'data': {
+            'is_searchabletext': 0,
+        },
+    },
+     'results_second': {
         'type': 'CPS Image Field',
         'data': {
@@ -764,6 +874,8 @@
 schemas['student_admission'] = student_admission
 schemas['student_clearence'] = student_clearence
+schemas['student_documents'] = student_documents
 schemas['student_eligibility'] = student_eligibility
 schemas['student_accommodation'] = student_accommodation
+schemas['student_hostel_fee'] = student_hostel_fee
 schemas['study_level'] = study_level
 schemas['course_results'] = course_results_schema
Index: /waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
===================================================================
--- /waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 166)
@@ -154,80 +154,4 @@
 ###)
 
-student_type = { ###(
-    'title': 'WAeUP Student',
-    'description': '',
-    'content_icon': 'student.gif',
-    'content_meta_type': 'Student',
-    'product': 'WAeUP',
-    'factory': 'addStudent',
-    'immediate_view': 'folder_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': ('Jamb','StudentPersonal','StudyLevel'),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'folder',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','student'],
-    'layouts': ['waeup_common','student'],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata'],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'Standard View',
-          #'action': 'string:${object_url}/student_index_html',
-          'action': 'temporary_view_all',
-          'condition':  'object/memberIsOwner',
-          'permission': (View,),
-          'category': 'object',
-          'visible': True,
-          },
-         {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (UniversityManage,)},
-         {'id': 'localroles',
-          'name': 'delegate',
-          'action': 'folder_localrole_form',
-          'permissions': (ModifyPortalContent),
-          'visible' : 0,
-          },
-         {'id'        : 'eligibility',
-          'name'      : 'eligibility',
-          'action'    : 'eligibility',
-          'condition':  'object/memberIsOwner',
-          'permission': (ModifyPortalContent,),
-          'visible': False,
-          },
-         {'id'        : 'JAMB',
-          'name'      : 'JAMB Data',
-          'action'    : 'string:${object/absolute_url}/JAMB',
-          'condition':  'object/memberIsOwner',
-          'permission': (ModifyPortalContent,)},
-          {
-          'id'        : 'PERSONAL',
-          'name'      : 'Personal Data',
-          'action'    : 'string:${object/absolute_url}/PERSONAL',
-          'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
-          'permission': (ModifyPortalContent,)},
-          {
-          'id'        : 'study_level',
-          'name'      : 'Register for next Level',
-          'action'    : 'string:${object/absolute_url}/register_level',
-          'condition':  'object/memberIsOwner',
-          'permission': (ModifyPortalContent,)},
-          {
-          'id'        : 'book_accomodation',
-          'name'      : 'Book Accomodation',
-          'action'    : 'string:${object/absolute_url}/book_accommodation',
-          'condition':  'object/memberIsOwner',
-          'permission': (ModifyPortalContent,)},
-          )
-}
-###)
-
 academics_folder_type = { ###(
     'title': 'WAeUP Academics Folder',
@@ -323,4 +247,94 @@
 ###)
 
+student_type = { ###(
+    'title': 'WAeUP Student',
+    'description': '',
+    'content_icon': 'student.gif',
+    'content_meta_type': 'Student',
+    'product': 'WAeUP',
+    'factory': 'addStudent',
+    'immediate_view': 'folder_view',
+    'global_allow': True,
+    'filter_content_types': True,
+    'allowed_content_types': ('Jamb','StudentDocuments','StudentPersonal','StudyLevel'),
+    'allow_discussion': False,
+    'cps_is_searchable': True,
+    'cps_proxy_type': 'folder',
+    'cps_display_as_document_in_listing': True,
+    'schemas': ['metadata','common','student'],
+    'layouts': ['waeup_common','student'],
+    'flexible_layouts': (),
+    'layout_clusters': ['metadata:metadata'],
+    'cps_section_wf': 'waeup_section_wf',
+    'use_content_status_history': 0,
+    'actions': (
+         {'id': 'view',
+          'name': 'Standard View',
+          #'action': 'string:${object_url}/student_index_html',
+          'action': 'string:${object_url}/temporary_view_all',
+          'condition':  'python:object.getContent().memberIsOwner()',
+          'permission': (View,),
+          'category': 'object',
+          'visible': True,
+          },
+         {'id': 'metadata',
+          'name': 'action_metadata',
+          'action': 'cpsdocument_metadata',
+          'condition': "python:member and 'Manager' in member.getRoles()",
+          'permissions': (UniversityManage,),
+          },
+         {'id': 'localroles',
+          'name': 'delegate',
+          'action': 'folder_localrole_form',
+          'permissions': (ModifyPortalContent),
+          'visible' : 0,
+          },
+         {'id'        : 'eligibility',
+          'name'      : 'eligibility',
+          'action'    : 'eligibility',
+          'condition':  'object/memberIsOwner',
+          'permission': (ModifyPortalContent,),
+          'visible': False,
+          },
+         {'id'        : 'JAMB',
+          'name'      : 'JAMB Data',
+          'action'    : 'string:${object/absolute_url}/JAMB',
+          'condition':  'python:object.getContent().memberIsOwner()',
+          'permission': (ModifyPortalContent,),
+          'visible': False,
+          },
+          {
+          'id'        : 'DOCUMENTS',
+          'name'      : 'upload Documents',
+          'action'    : 'string:${object/absolute_url}/DOCUMENTS',
+          'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
+          'permission': (ModifyPortalContent,)},
+          {
+          'id'        : 'PERSONAL',
+          'name'      : 'Personal Data',
+          'action'    : 'string:${object/absolute_url}/PERSONAL',
+          'condition':  "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)",
+          'permission': (ModifyPortalContent,)},
+          {
+          'id'        : 'register_study_level',
+          'name'      : 'Register for next Level',
+          'action'    : 'string:${object/absolute_url}/register_level',
+          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().isRegisteredForCurrentLevel()',
+          'permission': (ModifyPortalContent,)},
+          {
+          'id'        : 'book_accomodation',
+          'name'      : 'Book Accomodation',
+          'action'    : 'string:${object/absolute_url}/book_accommodation',
+          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().accommodationIsBooked()',
+          'permission': (ModifyPortalContent,)},
+          {
+          'id'        : 'pay_hostel_fee',
+          'name'      : 'Pay Hostel Fee',
+          'action'    : 'string:${object/absolute_url}/pay_hostel_fee',
+          'condition':  'python: object.getContent().memberIsOwner() and not object.getContent().accommodationIsPayed()',
+          'permission': (ModifyPortalContent,)},
+          )
+}###)
+
 jamb_type = { ###(
     'title': "JAMB data",
@@ -388,5 +402,5 @@
     'product': 'WAeUP',
     'factory': 'addStudentPersonal',
-    'immediate_view': 'student_personal_index_html',
+    'immediate_view': 'temporary_view_all',
     'global_allow': True,
     'filter_content_types': True,
@@ -406,6 +420,4 @@
          {'id': 'view',
           'name': 'Standard View',
-          #'action': 'string:${object_url}/student_personal_index_html',
-          #'action': 'string:${object_url}/cpsdocument_view',
           'action': 'temporary_view_all',
           'permission': (View,),
@@ -415,8 +427,53 @@
           'name': 'action_edit',
           'action': 'string:${object_url}/student_personal_edit_form',
-          'condition': '',
           'permission': (ModifyPortalContent,),
           'category': 'object',
           'visible': True,},
+         {'id': 'metadata',
+          'name': 'action_metadata',
+          'action': 'cpsdocument_metadata',
+          'condition': "python:member and 'Manager' in member.getRoles()",
+          'permissions': (UniversityManage,)},
+          )
+}
+###)
+
+student_documents = { ###(
+    'title': "Students documents data",
+    'description': '',
+    'content_icon': '',
+    'content_meta_type': 'StudentDocuments',
+    'product': 'WAeUP',
+    'factory': 'addStudentDocuments',
+    'immediate_view': 'temporary_view_all',
+    'global_allow': True,
+    'filter_content_types': True,
+    'allowed_content_types': (),
+    'allow_discussion': False,
+    'cps_is_searchable': True,
+    'cps_proxy_type': 'document',
+    'cps_display_as_document_in_listing': True,
+    'cps_is_portalbox': False,
+    'schemas': ['student_documents'],
+    'layouts': ['student_documents'],
+    'flexible_layouts': (),
+    'storage_methods': (),
+    'cps_workspace_wf': 'workspace_content_wf',
+    'cps_section_wf': 'section_content_wf',
+    'actions': (
+         {'id': 'view',
+          'name': 'View',
+          'action': 'string:${object_url}/temporary_view_all',
+          'permission': (View),
+          'category': 'object',
+          'visible': True,
+          },
+         {'id': 'edit',
+          'name': 'action_edit',
+          'action': 'string:${object_url}/student_documents_edit_form',
+          'permission': (ModifyPortalContent,),
+          'category': 'object',
+          'visible': True,
+          },
          {'id': 'metadata',
           'name': 'action_metadata',
@@ -432,5 +489,5 @@
     'description': '',
     'content_icon': '',
-    'content_meta_type': 'Level',
+    'content_meta_type': 'StudyLevel',
     'product': 'WAeUP',
     'factory': 'addStudyLevel',
@@ -453,5 +510,5 @@
           'name': 'Standard View',
           #'action': 'accommodation_index_html',
-          'action': 'temporary_view_all',
+          'action': 'string:${object_url}/temporary_view_all',
           'condition': '',
           'permission': (View,),
@@ -877,4 +934,5 @@
 types['AcademicsFolder'] = academics_folder_type
 types['Student'] = student_type
+types['StudentDocuments'] = student_documents
 types['StudentPersonal'] = student_personal_type
 types['StudyLevel'] = study_level_folder
Index: /waeup_product/trunk/skins/waeup_default/portlet_session_info.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_default/portlet_session_info.pt	(revision 165)
+++ /waeup_product/trunk/skins/waeup_default/portlet_session_info.pt	(revision 166)
@@ -1,30 +1,41 @@
 <tal:block define="mtool here/portal_membership;
-           anonymous mtool/isAnonymousUser;
-           member mtool/getAuthenticatedMember"
+           member mtool/getAuthenticatedMember;
+           isAnon mtool/isAnonymousUser;
+           roles member/getRoles;
+           backend python:'UniversityManager' in roles or 'StudentManager' in roles;
+           frontend python:'Student' in roles or isAnon;"
            >
-  <tal:block condition="not:anonymous">
-    <div i18n:translate="">You are currently logged in as
-      <em i18n:name="member"
-          tal:content="member" /><br />with Basic Roles <span tal:content="member/getRoles" /><br />
-      <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
-    </div>
+  <tal:block condition="not:isAnon">
+    <tal:block condition="backend">
+      <em tal:content="member" /> is working in back-end mode<br />
+      <span  tal:condition="python: 1" >
+        with Basic Roles <span tal:content="member/getRoles" /><br />
+        <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
+      </span>
+    </tal:block>
+    <tal:block condition="not:backend">
+      <em tal:content="member" /> is working in front-end mode<br />
+      <span  tal:condition="python: 1" >
+        with Basic Roles <span tal:content="member/getRoles" /><br />
+        <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" />
+      </span>
+    </tal:block>
     <br />
     <a href="" tal:condition="python: 'Student' in member.getRoles() and not 'UniversityManager' in member.getRoles()" 
-               tal:attributes="href string:${context/portal_url}/students/${member}">
-           Go to your personal area
+       tal:attributes="href string:${context/portal_url}/students/${member}">
+      Go to your personal area
     </a>
     <br />
     <a href="" tal:condition="python: 0" 
-               tal:attributes="href string:${context/portal_url}/cpsdirectory_entry_view?dirname=members&id=${member}">        
-          Edit your Preferences
+       tal:attributes="href string:${context/portal_url}/cpsdirectory_entry_view?dirname=members&id=${member}">        
+      Edit your Preferences
     </a>
     <br />
     <a href="" i18n:translate=""
-               tal:attributes="href string:logout">
-          Log out
+       tal:attributes="href string:logout">
+      Log out
     </a>
-    
   </tal:block>
-  <tal:block condition="anonymous">
+  <tal:block condition="isAnon">
     <div>You are not logged in. </div>
     <br />
@@ -32,3 +43,2 @@
   </tal:block>
 </tal:block>
-            
Index: eup_product/trunk/skins/waeup_default/temporary_view_all.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_default/temporary_view_all.pt	(revision 165)
+++ 	(revision )
@@ -1,63 +1,0 @@
-<html metal:use-macro="here/content_lib_master/macros/master">
-
-  <metal:block fill-slot="head_slot">
-  </metal:block>
-
-  <metal:block fill-slot="css_slot">
-    <link rel="Stylesheet" type="text/css" href=""
-      tal:attributes="href string:${base_url}document.css" />
-  </metal:block>
-  <metal:block fill-slot="header">
-  </metal:block>
-
-  <metal:block fill-slot="main"
-               tal:define="folder here/getContent;
-               items python:context.filterContents(items=context.contentValues());"
-               >
-    <h1> <span tal:content="context/title_or_id" /></h1>      
-  
-    <p>This is a temporary view of the object with id <em tal:content="here/id" /> 
-       of type <em tal:content="here/portal_type" /> 
-       which can be customized according to the customer's needs.</p>       
-  
-    <br />
-    
-    <span  tal:condition="python:context.portal_type != 'University'"  tal:omit-tag="">
-      <p>Exemplary view of the <strong>object's data fields</strong>: </p>
-      <tal:block  tal:content="structure rendered_main|python:doc.render(proxy=here)" />
-      
-      <p tal:condition="python: 0">(data field listing  not yet implemented)</p>
-    </span>
-    <br />      
-    <p>Exemplary view of the <strong>list of items attached to (or contained in) the object</strong>: </p>
-  
- 
-  
-    <tal:block condition="python: len(items)">  
-    <table>
-    <span tal:repeat="item items">
-    <tr>
-     <td>
-      <span tal:content="item/portal_type" />:
-     </td>
-     <td>
-      <i>
-      <a href="xxx" tal:condition="python: checkPerm('View',item)" 
-               tal:attributes="href item/absolute_url"
-               tal:content="item/title_or_id"></a>
-     <span tal:condition="python: not checkPerm('View',item)" tal:content="item/title_or_id"/>
-     </i>
-     </td>
-     </tr>
-    </span>
-    </table>
-    </tal:block>
-    
-    <tal:block condition="python: not len(items)">
-        (No items contained here!)
-    </tal:block>
-  
-  </metal:block>
-  <metal:block fill-slot="sub">
-  </metal:block>
-</html>
Index: /waeup_product/trunk/skins/waeup_default/temporary_view_all.py
===================================================================
--- /waeup_product/trunk/skins/waeup_default/temporary_view_all.py	(revision 166)
+++ /waeup_product/trunk/skins/waeup_default/temporary_view_all.py	(revision 166)
@@ -0,0 +1,22 @@
+##parameters=psm=None
+# $Id$
+
+"""Default view for the forum. If post_id is not None, post with id = <post_id>
+will be displayed, otherwise first post will be displayed."""
+
+member = context.portal_membership.getAuthenticatedMember()
+uname = str(member)
+roles = member.getRoles()
+cat = context.portal_catalog
+request = context.REQUEST
+url0 = request.get('URL0')
+if context.portal_membership.isAnonymousUser():
+    return context.temporary_view_all_form(psm=psm)
+else:
+    if url0.find(uname) > 0 or 'UniversityManager' in roles:
+        return context.temporary_view_all_form(psm=psm)
+    elif 'Student' in roles:
+        res = cat(id=uname)
+        if len(res) > 0:
+            return res[0].getObject().temporary_view_all_form(psm=psm)
+        return context.temporary_view_all_form(psm=psm)
Index: /waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt	(revision 166)
+++ /waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt	(revision 166)
@@ -0,0 +1,59 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="head_slot">
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="roles member/getRoles;
+               backend python:'UniversityManager' in roles or 'StudentManager' in roles;
+               frontend python:'Student' in roles or isAnon;
+               folder here/getContent;
+               items python:context.filterContents(items=context.contentValues());"
+               >
+    <h1> <span tal:content="context/title_or_id" /></h1>      
+  
+    <p>This is a temporary view of the object with id <em tal:content="here/id" /> 
+       of type <em tal:content="here/portal_type" /> 
+       which can be customized according to the customer's needs.</p>       
+  
+    <br />
+    <span  tal:condition="python:context.portal_type != 'University'"  tal:omit-tag="">
+      <p>Exemplary view of the <strong>object's data fields</strong>: </p>
+      <tal:block  tal:content="structure rendered_main|python:doc.render(proxy=here)" />
+    </span>
+    <br />      
+    <p>Exemplary view of the <strong>list of items attached to (or contained in) the object</strong>: </p>
+    <tal:block condition="python: len(items)">  
+      <table>
+        <span tal:repeat="item items">
+          <tr>
+            <td>
+              <span tal:content="item/portal_type" />:
+            </td>
+            <td>
+              <i>
+                <a href="xxx" tal:condition="backend" 
+                   tal:attributes="href item/absolute_url"
+                   tal:content="item/title_or_id"></a>
+                <span tal:condition="frontend" tal:content="item/title_or_id"/>
+              </i>
+            </td>
+          </tr>
+        </span>
+      </table>
+    </tal:block>
+    
+    <tal:block condition="python: not len(items)">
+        (No items contained here!)
+    </tal:block>
+  
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: eup_product/trunk/skins/waeup_default/university_view.py
===================================================================
--- /waeup_product/trunk/skins/waeup_default/university_view.py	(revision 165)
+++ 	(revision )
@@ -1,17 +1,0 @@
-##parameters=REQUEST=None,psm=None,groups=None
-# $Id$
-
-"""Default view for the forum. If post_id is not None, post with id = <post_id>
-will be displayed, otherwise first post will be displayed."""
-
-member = context.portal_membership.getAuthenticatedMember()
-
-if not context.portal_membership.isAnonymousUser():
-    if 'UniversityManager' in member.getRoles():
-        return context.folder_view()
-index = getattr(context,'documents',None)
-if index:
-    fp = getattr(index,'frontpage',None)
-    if fp:
-        return fp() 
-return context.university_view_all(psm=psm)
Index: /waeup_product/trunk/skins/waeup_student/book_accommodation.py
===================================================================
--- /waeup_product/trunk/skins/waeup_student/book_accommodation.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_student/book_accommodation.py	(revision 166)
@@ -4,4 +4,7 @@
 book an accomodation
 """
+import DateTime
+current = DateTime.DateTime()
+
 type_name = 'Student'
 ti = context.portal_types[type_name]
@@ -16,10 +19,11 @@
 
 res,psm,ds = lt.renderLayout(layout_id= 'accobook',
-                      schema_id= 'student',
+                      schema_id= 'student_accommodation',
                       context=context,
                       mapping=validate and REQUEST,
                       ob={},
                       layout_mode='create',
-                      create_action = 'book_accommodation',
+                      submit = "book",
+                      action = 'book_accommodation',
                       )
 if psm == 'invalid':
@@ -65,3 +69,7 @@
     #psm = "Your not admitted"
     psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict
+
+    ds.set('sc_date',current)
+    sf.setScratchCardData('accommodation',ds)
+
     return context.booked_accommodation(v=dict)
Index: /waeup_product/trunk/skins/waeup_student/booked_accommodation.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/booked_accommodation.pt	(revision 165)
+++ /waeup_product/trunk/skins/waeup_student/booked_accommodation.pt	(revision 166)
@@ -8,4 +8,10 @@
                >
     You have successfully booked bed nr <span tal:content="acco/beds_assigned" /> in <span tal:content="acco/heading" />.
+    <br />Your next steps:
+    <ul>
+      <li>Buy a Hostel Scratch card</li>
+      <li>Login with your user_id and password </li>
+      <li>Klick on the pay Hostel Fee tab</li>
+    </ul>
   </metal:block>
   <metal:block fill-slot="sub">
Index: /waeup_product/trunk/skins/waeup_student/check_admission.py
===================================================================
--- /waeup_product/trunk/skins/waeup_student/check_admission.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_student/check_admission.py	(revision 166)
@@ -5,4 +5,8 @@
 return html renderer + psm
 """
+import DateTime
+current = DateTime.DateTime()
+
+
 type_name = 'Jamb'
 ti = context.portal_types[type_name]
@@ -22,4 +26,6 @@
                       ob={},
                       layout_mode='create',
+                      action = "check_admission",
+                      submit = "check",
                       )
 if psm == 'invalid':
@@ -45,4 +51,6 @@
                                  ds = ds,
                                  )
+
+ds.set('sc_date',current)
 student.getContent().setScratchCardData('adm_check',ds)
 
Index: /waeup_product/trunk/skins/waeup_student/clearence.py
===================================================================
--- /waeup_product/trunk/skins/waeup_student/clearence.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_student/clearence.py	(revision 166)
@@ -5,4 +5,8 @@
 return html renderer + psm
 """
+import DateTime
+current = DateTime.DateTime()
+
+
 type_name = 'Jamb'
 ti = context.portal_types[type_name]
@@ -22,5 +26,8 @@
                       ob={},
                       layout_mode='create',
+                      action = "clearence",
+                      submit = "submit",
                       )
+
 if psm == 'invalid':
     return context.clearence_form(rendered = res,
@@ -52,4 +59,5 @@
     rset = REQUEST.set
     student = getattr(context,s_id)
+    ds.set('sc_date',current)
     student.getContent().setScratchCardData('clearence',ds)
     sc_pin =  ds.get('sc_pin')
Index: eup_product/trunk/skins/waeup_student/layout_accobook_create.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/layout_accobook_create.pt	(revision 165)
+++ 	(revision )
@@ -1,81 +1,0 @@
-<tal:block define="global creation python:1" />
-<metal:block define-macro="default_edit"
-             tal:define="layout options/layout;
-             ds options/datastructure;
-             creation creation|nothing;
-             metadata metadata|nothing;
-             type_name request/type_name|nothing;
-             ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
-             creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
-             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
-             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
-             first_layout options/first_layout|python:0;
-             last_layout options/last_layout|python:0;
-             is_flexible options/is_flexible;
-             cpsmcat nocall:here/translation_service;
-             "
-             >
-  <form action='' method='post' tal:attributes="action string:${options/create_action}"
-        enctype='multipart/form-data' class='workflow'>
-    <div class='group'>
-      <div class='documentFields'>
-        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
-          <tr tal:repeat="row layout/rows" valign="top">
-            <td tal:repeat="cell row"
-                tal:attributes="colspan cell/ncols">
-              <tal:block define="widget cell/widget;
-              wid widget/getWidgetId;
-              dm options/datastructure/getDataModel;
-              err python:ds.getError(wid);
-              err_mapping python:ds.getErrorMapping(wid);
-              is_required widget/is_required|nothing;
-              tooltip_id python:wid + '_help';
-              widget_css_class cell/widget_css_class|nothing;
-              widget_css_class python:test(is_flexible, 'group', widget_css_class);
-              css_class python:test(err, 'row error',
-              test(is_flexible, 'group', 'row'))"
-              >
-                <div tal:attributes="class widget_css_class;
-                id python:widget.getHtmlWidgetId()+'_widget';"
-                >
-                  <div class="label" tal:condition="widget/label_edit"
-                       tal:attributes="class python:test(is_required, 'label required','label')">
-                    <label i18n:translate="" tal:condition="widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                    <label tal:condition="not:widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                  </div>
-                  <button type="button" class="tooltipControl"
-                          tal:condition="widget/help"
-                          tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
-                  <div class="field">
-                    <div tal:replace="structure cell/widget_rendered"/>
-                  </div>
-                  <div class="tooltipArea" style="visibility: hidden;"
-                       tal:condition="widget/help"
-                       tal:attributes="id tooltip_id;
-                       onclick python:'showElement(false, \'%s\')' % tooltip_id;"
-                       >
-                    <tal:block i18n:translate="" tal:condition="widget/is_i18n"
-                               tal:content="widget/help">i18_key-help_for_this_field</tal:block>
-                    <tal:block tal:condition="not:widget/is_i18n"
-                               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>
-                </div>
-              </tal:block>
-            </td>
-          </tr>
-        </table>
-        <input type="submit" class="standalone" name="cpsdocument_edit_button" value="book" />
-      </div>        
-    </div>
-  </form>
-</metal:block>
Index: eup_product/trunk/skins/waeup_student/layout_admission_create.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/layout_admission_create.pt	(revision 165)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<tal:block define="global creation python:1" />
-<metal:block define-macro="default_edit"
-             tal:define="layout options/layout;
-             ds options/datastructure;
-             creation creation|nothing;
-             metadata metadata|nothing;
-             type_name request/type_name|nothing;
-             ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
-             creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
-             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
-             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
-             formaction string:check_admission_form;
-             first_layout options/first_layout|python:0;
-             last_layout options/last_layout|python:0;
-             is_flexible options/is_flexible;
-             cpsmcat nocall:here/translation_service;
-             "
-             >
-  <form action='check_admission' method='post'
-        enctype='multipart/form-data' class='workflow'>
-    <div class='group'>
-      <div class='documentFields'>
-        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
-          <tr tal:repeat="row layout/rows" valign="top">
-            <td tal:repeat="cell row"
-                tal:attributes="colspan cell/ncols">
-              <tal:block define="widget cell/widget;
-              wid widget/getWidgetId;
-              dm options/datastructure/getDataModel;
-              err python:ds.getError(wid);
-              err_mapping python:ds.getErrorMapping(wid);
-              is_required widget/is_required|nothing;
-              tooltip_id python:wid + '_help';
-              widget_css_class cell/widget_css_class|nothing;
-              widget_css_class python:test(is_flexible, 'group', widget_css_class);
-              css_class python:test(err, 'row error',
-              test(is_flexible, 'group', 'row'))"
-              >
-                <div tal:attributes="class widget_css_class;
-                id python:widget.getHtmlWidgetId()+'_widget';"
-                >
-                  <div class="label" tal:condition="widget/label_edit"
-                       tal:attributes="class python:test(is_required, 'label required','label')">
-                    <label i18n:translate="" tal:condition="widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                    <label tal:condition="not:widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                  </div>
-                  <button type="button" class="tooltipControl"
-                          tal:condition="widget/help"
-                          tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
-                  <div class="field">
-                    <div tal:replace="structure cell/widget_rendered"/>
-                  </div>
-                  <div class="tooltipArea" style="visibility: hidden;"
-                       tal:condition="widget/help"
-                       tal:attributes="id tooltip_id;
-                       onclick python:'showElement(false, \'%s\')' % tooltip_id;"
-                       >
-                    <tal:block i18n:translate="" tal:condition="widget/is_i18n"
-                               tal:content="widget/help">i18_key-help_for_this_field</tal:block>
-                    <tal:block tal:condition="not:widget/is_i18n"
-                               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>
-                </div>
-              </tal:block>
-            </td>
-          </tr>
-        </table>
-        <input type="submit" class="standalone" name="cpsdocument_edit_button" value="check" />
-      </div>        
-    </div>
-  </form>
-</metal:block>
-  
Index: eup_product/trunk/skins/waeup_student/layout_clearence_create.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/layout_clearence_create.pt	(revision 165)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<tal:block define="global creation python:1" />
-<metal:block define-macro="default_edit"
-             tal:define="layout options/layout;
-             ds options/datastructure;
-             creation creation|nothing;
-             metadata metadata|nothing;
-             type_name request/type_name|nothing;
-             ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
-             creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
-             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
-             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
-             formaction string:check_admission_form;
-             first_layout options/first_layout|python:0;
-             last_layout options/last_layout|python:0;
-             is_flexible options/is_flexible;
-             cpsmcat nocall:here/translation_service;
-             "
-             >
-  <form action='clearence' method='post'
-        enctype='multipart/form-data' class='workflow'>
-    <div class='group'>
-      <div class='documentFields'>
-        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
-          <tr tal:repeat="row layout/rows" valign="top">
-            <td tal:repeat="cell row"
-                tal:attributes="colspan cell/ncols">
-              <tal:block define="widget cell/widget;
-              wid widget/getWidgetId;
-              dm options/datastructure/getDataModel;
-              err python:ds.getError(wid);
-              err_mapping python:ds.getErrorMapping(wid);
-              is_required widget/is_required|nothing;
-              tooltip_id python:wid + '_help';
-              widget_css_class cell/widget_css_class|nothing;
-              widget_css_class python:test(is_flexible, 'group', widget_css_class);
-              css_class python:test(err, 'row error',
-              test(is_flexible, 'group', 'row'))"
-              >
-                <div tal:attributes="class widget_css_class;
-                id python:widget.getHtmlWidgetId()+'_widget';"
-                >
-                  <div class="label" tal:condition="widget/label_edit"
-                       tal:attributes="class python:test(is_required, 'label required','label')">
-                    <label i18n:translate="" tal:condition="widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                    <label tal:condition="not:widget/is_i18n"
-                           tal:content="widget/label_edit"
-                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
-                  </div>
-                  <button type="button" class="tooltipControl"
-                          tal:condition="widget/help"
-                          tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
-                  <div class="field">
-                    <div tal:replace="structure cell/widget_rendered"/>
-                  </div>
-                  <div class="tooltipArea" style="visibility: hidden;"
-                       tal:condition="widget/help"
-                       tal:attributes="id tooltip_id;
-                       onclick python:'showElement(false, \'%s\')' % tooltip_id;"
-                       >
-                    <tal:block i18n:translate="" tal:condition="widget/is_i18n"
-                               tal:content="widget/help">i18_key-help_for_this_field</tal:block>
-                    <tal:block tal:condition="not:widget/is_i18n"
-                               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>
-                </div>
-              </tal:block>
-            </td>
-          </tr>
-        </table>
-        <input type="submit" class="standalone" name="cpsdocument_edit_button" value="check" />
-      </div>        
-    </div>
-  </form>
-</metal:block>
-  
Index: /waeup_product/trunk/skins/waeup_student/layout_sc_create.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/layout_sc_create.pt	(revision 166)
+++ /waeup_product/trunk/skins/waeup_student/layout_sc_create.pt	(revision 166)
@@ -0,0 +1,85 @@
+<tal:block define="global creation python:1" />
+<metal:block define-macro="default_edit"
+             tal:define="layout options/layout;
+             ds options/datastructure;
+             creation creation|nothing;
+             metadata metadata|nothing;
+             type_name request/type_name|nothing;
+             ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
+             creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
+             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
+             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
+             formaction options/action;
+             submittext options/submit;
+             first_layout options/first_layout|python:0;
+             last_layout options/last_layout|python:0;
+             is_flexible options/is_flexible;
+             cpsmcat nocall:here/translation_service;
+             "
+             >
+  <form action='check_admission' tal:attributes="action formaction" method='post'
+        enctype='multipart/form-data' class='workflow'>
+    <div class='group'>
+      <div class='documentFields'>
+        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
+          <tr tal:repeat="row layout/rows" valign="top">
+            <td tal:repeat="cell row"
+                tal:attributes="colspan cell/ncols">
+              <tal:block define="widget cell/widget;
+              wid widget/getWidgetId;
+              dm options/datastructure/getDataModel;
+              err python:ds.getError(wid);
+              err_mapping python:ds.getErrorMapping(wid);
+              is_required widget/is_required|nothing;
+              tooltip_id python:wid + '_help';
+              widget_css_class cell/widget_css_class|nothing;
+              widget_css_class python:test(is_flexible, 'group', widget_css_class);
+              css_class python:test(err, 'row error',
+              test(is_flexible, 'group', 'row'))"
+              >
+                <div tal:attributes="class widget_css_class;
+                id python:widget.getHtmlWidgetId()+'_widget';"
+                >
+                  <div class="label" tal:condition="widget/label_edit"
+                       tal:attributes="class python:test(is_required, 'label required','label')">
+                    <label i18n:translate="" tal:condition="widget/is_i18n"
+                           tal:content="widget/label_edit"
+                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+                    <label tal:condition="not:widget/is_i18n"
+                           tal:content="widget/label_edit"
+                           tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+                  </div>
+                  <button type="button" class="tooltipControl"
+                          tal:condition="widget/help"
+                          tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
+                  <div class="field">
+                    <div tal:replace="structure cell/widget_rendered"/>
+                  </div>
+                  <div class="tooltipArea" style="visibility: hidden;"
+                       tal:condition="widget/help"
+                       tal:attributes="id tooltip_id;
+                       onclick python:'showElement(false, \'%s\')' % tooltip_id;"
+                       >
+                    <tal:block i18n:translate="" tal:condition="widget/is_i18n"
+                               tal:content="widget/help">i18_key-help_for_this_field</tal:block>
+                    <tal:block tal:condition="not:widget/is_i18n"
+                               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>
+                </div>
+              </tal:block>
+            </td>
+          </tr>
+        </table>
+        <input type="submit" class="standalone" name="cpsdocument_edit_button" 
+               value="check" tal:attributes="value submittext"/>
+      </div>        
+    </div>
+  </form>
+</metal:block>
+  
Index: /waeup_product/trunk/skins/waeup_student/pay_hostel_fee.py
===================================================================
--- /waeup_product/trunk/skins/waeup_student/pay_hostel_fee.py	(revision 166)
+++ /waeup_product/trunk/skins/waeup_student/pay_hostel_fee.py	(revision 166)
@@ -0,0 +1,45 @@
+##parameters=REQUEST
+# $Id$
+"""
+book an accomodation
+"""
+import DateTime
+current = DateTime.DateTime()
+
+type_name = 'Student'
+ti = context.portal_types[type_name]
+pm = context.portal_membership
+REQUEST.set('type_name',type_name)
+
+validate = REQUEST.has_key("cpsdocument_edit_button")
+
+
+lt = context.portal_layouts
+pr = context.portal_registration
+
+res,psm,ds = lt.renderLayout(layout_id= 'accopay',
+                      schema_id= 'student_hostel_fee',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      submit = "pay",
+                      action = 'pay_hostel_fee',
+                      )
+if psm == 'invalid':
+    return context.book_accommodation_form(rendered = res,
+                                 psm = "Please correct your input",
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.book_accommodation_form(rendered = res,
+                                 psm = None,
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    sf = context.getContent()
+
+    ds.set('sc_date',current)
+    sf.setScratchCardData('hostel_fee',ds)
+
+    return context.payed_hostel_fee(dict=ds)
Index: /waeup_product/trunk/skins/waeup_student/payed_hostel_fee.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/payed_hostel_fee.pt	(revision 166)
+++ /waeup_product/trunk/skins/waeup_student/payed_hostel_fee.pt	(revision 166)
@@ -0,0 +1,17 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="head_slot">
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+  <metal:block fill-slot="main"
+               tal:define="student context/getContent;
+               dict options/dict"
+               >
+    You payed <span tal:content="student/accommodation" /><br /> 
+    with Scratchcard PIN <span tal:content="dict/sc_pin" /> <br />
+    on <span  tal:content="dict/sc_date"/>.
+    
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /waeup_product/trunk/skins/waeup_student/process_waeup_login.py
===================================================================
--- /waeup_product/trunk/skins/waeup_student/process_waeup_login.py	(revision 165)
+++ /waeup_product/trunk/skins/waeup_student/process_waeup_login.py	(revision 166)
@@ -38,4 +38,9 @@
 context.notifyCPSDocumentCreation(ob=pd)
 
+pdid = 'DOCUMENTS'
+ma.invokeFactory('StudentDocuments', pdid)
+pd = getattr(ma,pdid)
+context.notifyCPSDocumentCreation(ob=pd)
+
 return response.redirect("%s/eligibility" % ma.absolute_url())
 return ma.eligibility(REQUEST=context.REQUEST)
Index: /waeup_product/trunk/skins/waeup_student/student_documents_edit_form.pt
===================================================================
--- /waeup_product/trunk/skins/waeup_student/student_documents_edit_form.pt	(revision 166)
+++ /waeup_product/trunk/skins/waeup_student/student_documents_edit_form.pt	(revision 166)
@@ -0,0 +1,69 @@
+<tal:block define="res python:here.editCPSDocument(REQUEST=request);
+                   rendered_main python: res[0];
+                   portal_status_message python: res[1];
+                   edition python:1;
+  ">
+<metal:block define-macro="edit_form">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+
+    <metal:block define-macro="widgets_javascript">
+    <!-- XXX this has to move to CPSSchemas -->
+    <style type="text/css"
+      tal:content="string:@import url(${base_url}calendar-win2k-1.css);"></style>
+    <script type="text/javascript" src="calendar.js"
+      tal:attributes="src string:${base_url}calendar.js"></script>
+    <script type="text/javascript" src="lang/calendar-en.js"
+      tal:define="local cpsmcat/getSelectedLanguage"
+      tal:attributes="src string:${base_url}lang/calendar-${local}.js"></script>
+    <script type="text/javascript" src="calendar-setup.js"
+      tal:attributes="src string:${base_url}calendar-setup.js"></script>
+
+    <script type="text/javascript">
+    <!--
+     function popup_rte(input_id, label_edit) {
+       var args, value
+       value = document.getElementById(input_id).value;
+       args='?input_id='+input_id+'&label_edit='+escape(label_edit);
+       popup = window.open('popup_rte_form'+args, input_id, 'toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=1, dependent=1, width=640, height=480')
+       if(!popup.opener)
+         popup.opener = window;
+       return false;
+   }
+   //-->
+   </script>
+   </metal:block>
+  </metal:block>
+
+  <metal:block fill-slot="header"
+    tal:define="creation creation|nothing;
+                edition edition|nothing;
+                metadata metadata|nothing">
+    <h1 tal:condition="creation" i18n:translate="">
+      Create a document of type
+      <tal:block i18n:name="type_name" i18n:translate=""
+            tal:define="type_name request/type_name;
+                        type_info python:here.portal_types[type_name]"
+            tal:content="type_info/Title">Type Title</tal:block>
+    </h1>
+    <h1 tal:condition="python: 0 and not creation">
+      <img tal:replace="structure python:here.getImgTag('/'+here.getIcon(), base_url='')">
+      <tal:block condition="edition"
+        i18n:translate="">Edit <span i18n:name="title"
+        tal:content="here/title_or_id">Page Title</span></tal:block>
+      <tal:block tal:condition="metadata"
+        i18n:translate="">heading_metadata_edit</tal:block>
+    </h1>
+  </metal:block>
+
+  <metal:block fill-slot="main">
+    <div tal:replace="structure rendered_main" />
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+
+</metal:block>
+</metal:block>
+</tal:block>
