Index: WAeUP_SRP/trunk/Students.py
===================================================================
--- WAeUP_SRP/trunk/Students.py	(revision 638)
+++ WAeUP_SRP/trunk/Students.py	(revision 639)
@@ -456,4 +456,29 @@
 ###)
 
+class StudentAccommodation(CPSDocument): ###(
+    """
+    WAeUP Student container for the various student data
+    """
+    meta_type = 'StudentAccommodation'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        content = self.getContent()
+        #return "Accommodation Data for %s %s" % (content.firstname,content.lastname)
+        return "Accommodation Data for Session %s" % content.session
+
+
+InitializeClass(StudentAccommodation)
+
+def addStudentAccommodation(container, id, REQUEST=None, **kw):
+    """Add a Students personal data."""
+    ob = StudentAccommodation(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+
+###)
+
 class StudentPersonal(CPSDocument): ###(
     """
Index: WAeUP_SRP/trunk/__init__.py
===================================================================
--- WAeUP_SRP/trunk/__init__.py	(revision 638)
+++ WAeUP_SRP/trunk/__init__.py	(revision 639)
@@ -42,4 +42,5 @@
         ("StudentsFolder",
          "Student",
+         "StudentAccommodation",
          "StudentStudyCourse",
          "StudentCourseResult",
Index: WAeUP_SRP/trunk/profiles/default/types/Student.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/Student.xml	(revision 638)
+++ WAeUP_SRP/trunk/profiles/default/types/Student.xml	(revision 639)
@@ -12,4 +12,5 @@
  <property name="filter_content_types">True</property>
  <property name="allowed_content_types">
+  <element value="StudentAccommodation"/>
   <element value="StudentDocuments"/>
   <element value="StudentPersonal"/>
Index: WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 638)
+++ WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 639)
@@ -64,4 +64,7 @@
    <bound-workflow workflow_id="waeup_student_wf"/>
   </type>
+  <type type_id="StudentAccommodation">
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
+  </type>
   <type type_id="StudentApplication">
    <bound-workflow workflow_id="waeup_student_subobject_wf"/>
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py	(revision 639)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py	(revision 639)
@@ -0,0 +1,47 @@
+## Script (Python) "folder_delete"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=ids=[], REQUEST=None
+##title=
+##
+# $Id: folder_delete.py 586 2006-09-28 22:10:21Z joachim $
+"""
+FIXME: add docstring.
+"""
+
+from Products.CMFCore.utils import getToolByName
+here = context
+if context.portal_type == "University":
+    here = context.academics
+
+ti = getToolByName(here, 'portal_types').getTypeInfo(here.portal_type)
+meth_id = ti.queryMethodID('view', 'folder_contents')
+ret_url = here.absolute_url() + '/' + meth_id
+pa = context.portal_accommodation
+
+if ids:
+    halls = []
+    for id in ids:
+        # XXX has to be called from here since the workflow doesn't handle the
+        # deletion yet
+        halls.append(id)
+        ob = getattr(here, id)
+        from Products.CPSCore.EventServiceTool import getPublicEventService
+        evtool = getPublicEventService(here)
+        evtool.notifyEvent('workflow_delete', ob, {})
+        beds = pa(hall=id)
+        urls = []
+        for bed in beds:
+            urls.append(bed.bed)
+        for url in urls:
+            pa.deleteRecord(url)
+    here.manage_delObjects(ids)
+    message = 'portal_status_message=hall(s) %s with %s beds deleted' % (" ".join(halls),len(urls))
+else:
+    message = 'portal_status_message=psm_select_at_least_one_document'
+
+if REQUEST is not None:
+    return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 638)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 639)
@@ -14,5 +14,10 @@
 lt = context.portal_layouts
 pr = context.portal_registration
-
+session = current.year()
+acco_id = 'Acco_%s' % session
+info = context.getStudentInfo()
+student = info['student']
+if info['acco']:
+    return student.hostal_reservation_slip()
 res,psm,ds = lt.renderLayout(layout_id= 'student_acco_reserve',
                       schema_id= 'student_acco_reserve',
@@ -44,5 +49,5 @@
     pa = context.portal_accommodation
     code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
-    if code < 0:
+    if code < -10:
         return context.reserve_acco_form(rendered = res,
                                  psm = bed,
@@ -51,6 +56,12 @@
                                  ds = ds,
                                  )
-    else:
-        return context.reserve_acco_form(rendered = res,
+student.invokeFactory('StudentAccommodation',acco_id)
+acco = getattr(student,acco_id)
+ds['acco_res_date'] = current
+ds['bed'] = bed
+ds['session'] = session
+acco.getContent().edit(mapping=ds)
+return student.hostal_reservation_slip()
+return context.reserve_acco_form(rendered = res,
                                  psm = "successfully reserved bed %s" % bed,
                                  firstlayout = True,
@@ -59,3 +70,2 @@
                                  )
 
-
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 638)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 639)
@@ -23,11 +23,17 @@
 info['is_manager'] = context.isManager
 member_id = str(member)
-if student is None:
-    students = getattr(context,'students',None)
-    if students is None:
-        students = getattr(context.campus,'students',None)
-    student = getattr(students,member_id,None)
-    if student is None:
-        return None
+res = context.portal_catalog(portal_type='Student',id=member_id)
+if not res:
+    return None
+brain = res[0]
+student = brain.getObject()
+student_path = brain.getPath()    
+##if student is None:
+##    students = getattr(context,'students',None)
+##    if students is None:
+##        students = getattr(context.campus,'students',None)
+##    student = getattr(students,member_id,None)
+##    if student is None:
+##        return None
 info['review_state'] = wf.getInfoFor(student,'review_state','keiner')
 #info['wf_state'] = 'keiner'
@@ -42,3 +48,11 @@
 if info['per_doc'].sex:
     info['sex'] = 'female'
+res = context.portal_catalog(container_path=student_path,
+                             portal_type='StudentAccommodation')
+if res:
+    acco = res[0].getObject()
+    info['acco'] = acco
+    info['acco_doc'] = acco.getContent()
+else:
+    info['acco'] = None
 return info
