Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_study_level.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_study_level.xml	(revision 1443)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_study_level.xml	(revision 1444)
@@ -1,3 +1,4 @@
 <?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="layout.xsl"?>
 <object name="student_study_level" meta_type="CPS Layout">
  <property name="layout_create_method"></property>
Index: /WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml	(revision 1443)
+++ /WAeUP_SRP/trunk/profiles/default/types/StudentStudyLevel.xml	(revision 1444)
@@ -1,3 +1,4 @@
 <?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="types.xsl"?>
 <object name="StudentStudyLevel" meta_type="CPS Flexible Type Information"
    xmlns:i18n="http://xml.zope.org/namespaces/i18n">
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py	(revision 1443)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_index.py	(revision 1444)
@@ -17,4 +17,5 @@
 pm = context.portal_membership
 
+#from Products.zdb import set_trace;set_trace()
 if context.isSectionOfficer():
     if context.portal_type == 'AccoFolder':
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py	(revision 1443)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py	(revision 1444)
@@ -15,9 +15,10 @@
 logger = logging.getLogger('Accommodation.BookReservedBed')
 
-change_bed = REQUEST.has_key("reserve_and_change")
-validate = change_bed or (REQUEST.has_key("reserve") and
+change = REQUEST.has_key("reserve_and_change")
+release = REQUEST.has_key("release")
+reserve = REQUEST.has_key("reserve")
+validate = release or change or (reserve and
            REQUEST.get("reserve").startswith('Reserve'))
 mode = 'create'
-
 d = {}
 rendered,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
@@ -66,17 +67,29 @@
     bed_brain = res[0]
     already = acco_cat(student=sid)
-    if already and not change_bed:
-        psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
-        break
-    if not bed_brain.bed_type.endswith("reserved"):
-        psm = "Not a reserved bed %s" % bid
-        break
-    if bed_brain.student and not change_bed:
-        psm = "Bed %s already reserved for %s" % (bid,bed_brain.student)
-        break
-    if student.sex and not block in doc.blocks_for_female:
-        psm = "Sex does not match %s" % bid
-        break
+    if reserve or change:
+        if already and not change:
+            psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
+            break
+        if not bed_brain.bed_type.endswith("reserved"):
+            psm = "Not a reserved bed %s" % bid
+            break
+        if bed_brain.student and not change:
+            psm = "Bed %s already reserved for %s" % (bid,bed_brain.student)
+            break
+        if student.sex and not block in doc.blocks_for_female:
+            psm = "Sex does not match %s" % bid
+            break
+    if release:
+        if not already:
+            psm = "Student %s already has no reserved beds" % (sid, already[0].bed)
+            break
+        if not bed_brain.bed_type.endswith("reserved"):
+            psm = "Not a reserved bed %s" % bid
+            break
+        if not bed_brain.student:
+            psm = "Bed %s not reserved for %s" % (bid,bed_brain.student)
+            break
     break
+        
 if psm != '':
     return context.book_reserved_bed_form(rendered = rendered,
@@ -87,19 +100,29 @@
                                  button = "Reserve Bed",
                                  )
-if change_bed:
+if change:
     for bed in already:
         acco_cat.modifyRecord(bed=bed.bed,student='')
         
-acco_cat.modifyRecord(bed = bid, student = sid)
 students = context.portal_url.getPortalObject().campus.students
 student_obj = getattr(students,sid)
 acco_id = "accommodation_%s" % context.getSessionId()
-if acco_id in student_obj.objectIds():
-    acco_doc = getattr(student_obj, acco_id).getContent()
-    acco_doc.edit(mapping={'bed': bid})
-logger.info('"%s","booked reserved bed %s for","%s"' % (member,bid,sid))
+if reserve or change:
+    acco_cat.modifyRecord(bed = bid, student = sid)
+    if acco_id in student_obj.objectIds():
+        acco_doc = getattr(student_obj, acco_id).getContent()
+        acco_doc.edit(mapping={'bed': bid})
+    logger.info('"%s","booked reserved bed %s for","%s"' % (member,bid,sid))
+    psm = "Bed reserved for %s %s" % (sid,student.name)
+elif release:
+    acco_cat.modifyRecord(bed=bid,student='')
+    if acco_id in student_obj.objectIds():
+        acco_doc = getattr(student_obj, acco_id).getContent()
+        acco_doc.edit(mapping={'bed': bid + "(removed)"})
+    logger.info('"%s","released reserved bed %s for","%s"' % (member,bid,sid))
+    psm = "Bed %s released for %s" % (sid,student.name)
+    
 mode = 'view'
 return context.book_reserved_bed_form(rendered = "",
-                                 psm = "Bed reserved for %s %s" % (sid,student.name),
+                                 psm = psm,
                                  mode = mode,
                                  formaction = "book_reserved_bed",
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed_form.pt	(revision 1443)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed_form.pt	(revision 1444)
@@ -28,4 +28,9 @@
                  value="Reserve and Change Bed"
                  />
+          <input type="submit" tal:condition="python:mode !='view'"
+                 class="standalone" 
+                 name="release"
+                 value="Release Bed"
+                 />
         </form>
       </metal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1443)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1444)
@@ -36,5 +36,5 @@
 all_booked = [st for st in res if st]
 booked_list = []
-#from Products.zdb import set_trace;set_trace()
+from Products.zdb import set_trace;set_trace()
 for bt in bed_types:
     total = len(pa(bed_type=bt,hall=context.getId()))
