Index: WAeUP_SRP/trunk/skins/waeup_accommodation/allocate_reserved_bed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/allocate_reserved_bed.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/allocate_reserved_bed.py	(revision 1566)
@@ -13,5 +13,5 @@
 acco_cat = context.portal_accommodation
 import logging
-logger = logging.getLogger('Accommodation.AllocateReservedBed')
+logger = logging.getLogger('Skins.allocate_reserved_bed')
 
 #change = REQUEST.has_key("allocate_and_change")
@@ -73,8 +73,8 @@
     if allocate or change:
         if already and not change:
-            psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
+            psm = "Student %s has already reserved bed %s" % (sid, already[0].bed)
             break
         if not bed_brain.bed_type.endswith("reserved"):
-            psm = "Not a reserved bed: %s" % bid
+            psm = "%s is not a reserved bed" % bid
             break
         if bed_brain.student and not change:
@@ -88,5 +88,5 @@
             acco_doc = getattr(student_obj, acco_id).getContent()
             if acco_doc.bed == bid:
-                psm = "Student %s has already booked (paid) bed %s" % (sid, bid)
+                psm = "Student %s has already booked (and paid) bed %s" % (sid, bid)
                 break
         if not already:
@@ -94,5 +94,5 @@
             break
         if not bed_brain.bed_type.endswith("reserved"):
-            psm = "Not a reserved bed: %s" % bid
+            psm = "%s is not a reserved bed" % bid
             break
         if not bed_brain.student:
@@ -118,5 +118,5 @@
         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))
+    logger.info('%s booked reserved bed %s for %s' % (member,bid,sid))
     psm = "Bed %s reserved for %s %s" % (bid,sid,student.name)
 elif release:
@@ -130,8 +130,8 @@
     if modify:
         acco_cat.modifyRecord(bed=bid,student='')
-        logger.info('"%s","cancelled reservation %s by","%s"' % (member,bid,sid))
+        logger.info('%s released bed %s booked by %s' % (member,bid,sid))
         psm = "%s removed from %s" % (student.name,bid)
     else:
-        psm = "%s removing failed from %s" % (student.name,bid)
+        psm = "Removing of %s from bed %s failed" % (student.name,bid)
 
 mode = 'view'
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/change_bed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/change_bed.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/change_bed.py	(revision 1566)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Accommodation.change_bed')
+logger = logging.getLogger('Skins.change_bed')
 
 request = context.REQUEST
@@ -31,18 +31,19 @@
 
 if student_id is not None:
-    logger.info('"%s", "requests bed_change for", "%s"' % (member_id,student_id))
+    logger.info('%s requests bed change for %s' % (member_id,student_id))
     info = context.getAccommodationInfo(student_id)
     res = beds(student=student_id)
     if len(res) == 0:
-        logger.info('"%s", "no bed found"' % (student_id))
-        redirect("%s/%s" % (students.absolute_url(),student_id))
+        logger.info('No bed found for %s' % (student_id))
+        return redirect("%s/%s" % (students.absolute_url(),student_id))
     allocated_bed = res[0]
     status = info['student_status']
     student = student_id
     if allocated_bed.bed_type == status:
-        logger.info('"%s", "correct bed allocated","%s"' % (student_id,status))
-        redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-    logger.info('"%s", "change bed", "%s/%s"' % (student_id,allocated_bed.bed_type,status))
+        logger.info('Status %s of %s has not changed' % (status,student_id))
+        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
+    logger.info('Bed status %s of %s has changed to %s' % (allocated_bed.bed_type,student_id,status))
     beds.modifyRecord(bed=allocated_bed.bed,student='')
+    logger.info('Bed %s released' % (allocated_bed.bed))
     code,bed = beds.searchAndReserveBed(student_id,status)
     if code > 0:
@@ -56,4 +57,5 @@
         acco_doc = info['acco_doc']
         acco_doc.edit(mapping=d)
+        logger.info('Bed %s allocated to %s' % (bed,student_id))
         return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
     student_obj = getattr(students,student_id)
@@ -62,7 +64,7 @@
         acco_doc = getattr(student_obj, acco_id).getContent()
         if acco_doc.bed == bed:
-            acco_doc.edit(mapping={'bed':"-- cancelled by %s --" % member})
-    logger.info('"%s", "new bed allocation failed","%s"' % (student_id,code))
-    logger.info('"%s","cancelled booking of bed %s by %s"' % (member,bed,sid))
+            acco_doc.edit(mapping={'bed':"-- cancelled by officer due to failed bed change request --"})
+    logger.info('New bed allocation for %s failed, code = %s' % (student_id,code))
+    logger.info('%s cancelled booking of bed %s by %s' % (member,bed,student_id))
     redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
 
@@ -95,6 +97,6 @@
         d['acco_maint_fee'] = acco_info.get('maintenance_fee')
         acco_doc.edit(mapping=d)
-        list.append("Student %s new bed %s assigned code = %s" % (student,
-                                                              bed,
+        list.append("New bed %s allocated to %s, code = %s" % (bed,
+                                                              student,
                                                               code))
 return "\r".join(list)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/fixReservedBeds.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/fixReservedBeds.py	(revision 1565)
+++ 	(revision )
@@ -1,45 +1,0 @@
-##parameters=REQUEST
-# $Id$
-"""
-process the the accommodation reservation
-"""
-import DateTime
-current = DateTime.DateTime()
-request = context.REQUEST
-pr = context.portal_registration
-wftool = context.portal_workflow
-lt = context.portal_layouts
-mtool = context.portal_membership
-member = mtool.getAuthenticatedMember()
-acco_cat = context.portal_accommodation
-import logging
-logger = logging.getLogger('Accommodation.FixReservedBed')
-students = context.portal_url.getPortalObject().campus.students
-hostels = context.portal_url.getPortalObject().campus.accommodation.objectItems()
-acco_id = "accommodation_%s" % context.getSessionId()
-logger.info('"%s","start"' % (member))
-#from Products.zdb import set_trace;set_trace()
-for h_id,h in hostels:
-    h_doc = h.getContent()
-    reserved = context.reservedRoomsVoc(doc=h_doc)
-    for hr,hrv in reserved:
-        for k,v in context.getAccoHallBeds(doc=h_doc):
-            bid = "%s_%s_%s" % (h_id,hr,k)
-            res = acco_cat(bed = bid)
-            if not res:
-                continue
-            bed = res[0]
-            if not bed.student:
-                continue
-            student_obj = getattr(students,bed.student)
-            if acco_id in student_obj.objectIds():
-                acco_doc = getattr(student_obj, acco_id).getContent()
-                if acco_doc.bed != bid:
-                    acco_cat.modifyRecord(bed=bid,student = '')
-                    logger.info('"%s","removed allocation of %s for","%s"' % (member,bid,bed.student))
-logger.info('"%s","finished"' % (member))
-return request.RESPONSE.redirect("%s" % context.absolute_url())
-
-                
-    
-
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py	(revision 1565)
+++ 	(revision )
@@ -1,27 +1,0 @@
-## Script (Python) "students_indext"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=bed=None,mode=None,datastructure=None
-##title=
-# $Id$
-"""
-format the bed for readability
-"""
-
-if datastructure is not None:
-    bed = datastructure.get('bed')
-if not bed:
-    return ''
-if len(bed.split('_')) != 4:
-    return bed
-hall,block,room,letter = bed.split('_')
-info = context.waeup_tool.getAccommodationInfo(bed)
-if info:
-    hall_title = info['hall_title']
-else:
-    hall_title = ""
-return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
-
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1566)
@@ -59,5 +59,5 @@
     d['student'] = st
     d['student_url'] ='%s/%s' % (students_url,st)
-    bed = context.formatBed(sbrain.bed).split('/')
+    bed = context.getFormattedBed(sbrain.bed).split('/')
     d['bed'] = " / ".join(bed[1:])
     erg = context.students_catalog(id = st)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/getFormattedBed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/getFormattedBed.py	(revision 1566)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/getFormattedBed.py	(revision 1566)
@@ -0,0 +1,27 @@
+## Script (Python) "getFormattedBed"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=bed=None,mode=None,datastructure=None
+##title=
+# $Id: getFormattedBed.py 1453 2007-02-20 22:24:30Z henrik $
+"""
+format the bed for readability
+"""
+
+if datastructure is not None:
+    bed = datastructure.get('bed')
+if not bed:
+    return ''
+if len(bed.split('_')) != 4:
+    return bed
+hall,block,room,letter = bed.split('_')
+info = context.waeup_tool.getAccommodationInfo(bed)
+if info:
+    hall_title = info['hall_title']
+else:
+    hall_title = ""
+return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
+
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/hall_delete.py	(revision 1566)
@@ -1,3 +1,3 @@
-## Script (Python) "folder_delete"
+## Script (Python) "hall_delete"
 ##bind container=container
 ##bind context=context
@@ -12,4 +12,8 @@
 FIXME: add docstring.
 """
+
+import logging
+logger = logging.getLogger('Skins.hall_delete')
+member_id = str(context.portal_membership.getAuthenticatedMember())
 
 from Products.CMFCore.utils import getToolByName
@@ -41,4 +45,5 @@
     here.manage_delObjects(ids)
     message = 'portal_status_message=hall(s) %s with %s beds deleted' % (" ".join(halls),len(urls))
+    logger.info('%s deletes hall(s) %s with %s beds' % (member_id," ".join(halls),len(urls)))
 else:
     message = 'portal_status_message=psm_select_at_least_one_document'
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reallocateBed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reallocateBed.py	(revision 1565)
+++ 	(revision )
@@ -1,107 +1,0 @@
-## Script (Python) "change_bed"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id: reallocateBed.py 1206 2007-01-05 18:24:56Z joachim $
-"""
-reallocate beds
-"""
-import logging
-logger = logging.getLogger('Student.Accommodation.reallocate_bed')
-
-request = context.REQUEST
-redirect = request.RESPONSE.redirect
-mtool = context.portal_membership
-wf = context.portal_workflow
-member = mtool.getAuthenticatedMember()
-member_id = str(member)
-path_info = request.get('PATH_INFO').split('/')
-
-if mtool.isAnonymousUser():
-    return None
-students = context.portal_url.getPortalObject().campus.students
-beds = context.portal_accommodation
-studs = context.students_catalog
-student_id = context.getStudentId()
-
-if student_id is not None:
-    logger.info('"%s", "requests bed_change for", "%s"' % (member_id,student_id))
-    info = context.getAccommodationInfo(student_id)
-    res = beds(student=student_id)
-    if len(res) == 0:
-        logger.info('"%s", "no bed found"' % (student_id))
-        redirect("%s/%s" % (students.absolute_url(),student_id))
-    allocated_bed = res[0]
-    status = info['student_status']
-    student = student_id
-    bedtype = context.getBedStatusFromHall(allocated_bed.bed)
-    if not bedtype.endswith("reserved"):
-        logger.info('"%s", "allocated bed is NOT reserved","%s"' % (student_id,bedtype))
-        redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-    logger.info('"%s", "reallocate reserved bed", "%s/%s"' % (student_id,bedtype,status))
-    beds.modifyRecord(bed=allocated_bed.bed,
-                      student='',
-                      bed_type=bedtype)
-    code,bed = beds.searchAndReserveBed(student_id,status)
-    if code > 0:
-        #from Products.zdb import set_trace; set_trace()
-        d = {}
-        d['bed'] = bed
-        d['student_status'] = status
-        acco_info = context.waeup_tool.getAccommodationInfo(bed)
-        d['acco_maint_code'] = acco_info.get('maintenance_code')
-        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
-        acco_doc = info['acco_doc']
-        acco_doc.edit(mapping=d)
-        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-    logger.info('"%s", "new bed allocation failed","%s"' % (student_id,code))
-    redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-
-info = {}
-#records = [r for r in beds() if  r.student]
-records = beds.uniqueValuesFor('bed')
-list = []
-to_modify = []
-for b in records:
-    r = beds(bed=b)[0]
-    bedtype = context.getBedStatusFromHall(r.bed)
-    if not bedtype.endswith("reserved"):
-        #logger.info('"%s", "allocated bed is NOT reserved","%s"' % (student_id,bedtype))
-        #list.append("Student %s bed_type %s ok" % (r.student,bedtype))
-        continue
-    if not r.student:
-        beds.modifyRecord(bed=b,
-                      bed_type=bedtype)
-        list.append("empty bed %s set to %s" % (r.bed,bedtype))
-        continue
-    info = context.getAccommodationInfo(r.student)
-    sbt = info.get('student_status',None)
-    if sbt is None:
-        continue
-    list.append("Student %s bed_type %s != %s" % (r.student,
-                                                  r.bed_type,
-                                                  bedtype))
-    to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc'],bedtype))
-for former_bed, student, status,acco_doc,bedtype in to_modify:
-    beds.modifyRecord(bed=former_bed,
-                      student='',
-                      bed_type=bedtype)
-    code,bed = beds.searchAndReserveBed(student,status)
-    if code > 0:
-        #from Products.zdb import set_trace; set_trace()
-        d = {}
-        d['bed'] = bed
-        d['student_status'] = status
-        acco_info = context.waeup_tool.getAccommodationInfo(bed)
-        d['acco_maint_code'] = acco_info.get('maintenance_code')
-        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
-        acco_doc.edit(mapping=d)
-        list.append("Student %s new bed %s assigned code = %s" % (student,
-                                                              bed,
-                                                              code))
-return "\r".join(list)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reallocate_bed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reallocate_bed.py	(revision 1566)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/reallocate_bed.py	(revision 1566)
@@ -0,0 +1,107 @@
+## Script (Python) "reallocate_bed"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: reallocateBed.py 1206 2007-01-05 18:24:56Z joachim $
+"""
+reallocate beds
+"""
+import logging
+logger = logging.getLogger('Skins.reallocate_bed')
+
+request = context.REQUEST
+redirect = request.RESPONSE.redirect
+mtool = context.portal_membership
+wf = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+path_info = request.get('PATH_INFO').split('/')
+
+if mtool.isAnonymousUser():
+    return None
+students = context.portal_url.getPortalObject().campus.students
+beds = context.portal_accommodation
+studs = context.students_catalog
+student_id = context.getStudentId()
+
+if student_id is not None:
+    logger.info('%s requests bed_change for %s' % (member_id,student_id))
+    info = context.getAccommodationInfo(student_id)
+    res = beds(student=student_id)
+    if len(res) == 0:
+        logger.info('No bed found for %s' % (student_id))
+        redirect("%s/%s" % (students.absolute_url(),student_id))
+    allocated_bed = res[0]
+    status = info['student_status']
+    student = student_id
+    bedtype = context.getBedStatusFromHall(allocated_bed.bed)
+    if not bedtype.endswith("reserved"):
+        logger.info('%s is NOT a reserved bed' % (bedtype))
+        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
+    logger.info('%s reallocate reserved bed %s/%s' % (student_id,bedtype,status))
+    beds.modifyRecord(bed=allocated_bed.bed,
+                      student='',
+                      bed_type=bedtype)
+    code,bed = beds.searchAndReserveBed(student_id,status)
+    if code > 0:
+        #from Products.zdb import set_trace; set_trace()
+        d = {}
+        d['bed'] = bed
+        d['student_status'] = status
+        acco_info = context.waeup_tool.getAccommodationInfo(bed)
+        d['acco_maint_code'] = acco_info.get('maintenance_code')
+        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
+        acco_doc = info['acco_doc']
+        acco_doc.edit(mapping=d)
+        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
+    logger.info('%s new bed allocation failed, code = %s' % (student_id,code))
+    return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
+
+info = {}
+#records = [r for r in beds() if  r.student]
+records = beds.uniqueValuesFor('bed')
+list = []
+to_modify = []
+for b in records:
+    r = beds(bed=b)[0]
+    bedtype = context.getBedStatusFromHall(r.bed)
+    if not bedtype.endswith("reserved"):
+        #logger.info('"%s", "allocated bed is NOT reserved","%s"' % (student_id,bedtype))
+        #list.append("Student %s bed_type %s ok" % (r.student,bedtype))
+        continue
+    if not r.student:
+        beds.modifyRecord(bed=b,
+                      bed_type=bedtype)
+        list.append("Empty bed %s set to %s" % (r.bed,bedtype))
+        continue
+    info = context.getAccommodationInfo(r.student)
+    sbt = info.get('student_status',None)
+    if sbt is None:
+        continue
+    list.append("Student %s bed_type %s != %s" % (r.student,
+                                                  r.bed_type,
+                                                  bedtype))
+    to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc'],bedtype))
+for former_bed, student, status,acco_doc,bedtype in to_modify:
+    beds.modifyRecord(bed=former_bed,
+                      student='',
+                      bed_type=bedtype)
+    code,bed = beds.searchAndReserveBed(student,status)
+    if code > 0:
+        #from Products.zdb import set_trace; set_trace()
+        d = {}
+        d['bed'] = bed
+        d['student_status'] = status
+        acco_info = context.waeup_tool.getAccommodationInfo(bed)
+        d['acco_maint_code'] = acco_info.get('maintenance_code')
+        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
+        acco_doc.edit(mapping=d)
+        list.append("Student %s got bed %s, code = %s" % (student,
+                                                              bed,
+                                                              code))
+return "\r".join(list)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/release_bed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/release_bed.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/release_bed.py	(revision 1566)
@@ -1,3 +1,3 @@
-## Script (Python) "change_bed"
+## Script (Python) "release_bed"
 ##bind container=container
 ##bind context=context
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Accommodation.release_bed')
+logger = logging.getLogger('Skins.release_bed')
 
 request = context.REQUEST
@@ -36,8 +36,8 @@
 #set_trace()
 if student_id is not None:
-    logger.info('"%s", "requests bed_release for", "%s"' % (member_id,student_id))
+    logger.info('%s requests bed_release for %s' % (member_id,student_id))
     res = acco_cat(student=student_id)
     if len(res) == 0:
-        logger.info('"%s", "no bed found"' % (student_id))
+        logger.info('no bed of %s found' % (student_id))
         redirect("%s/%s" % (students.absolute_url(),student_id))
     allocated_bed = res[0]
@@ -45,5 +45,5 @@
     acco_doc = context.getContent()
     acco_doc.edit(mapping={'bed':"-- cancelled by section officer --"})
-    logger.info('"%s", "released bed of", "%s"' % (member_id,student_id))
+    logger.info('%s released bed of %s' % (member_id,student_id))
     redirect("%s" % (context.absolute_url()))
 
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py	(revision 1565)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py	(revision 1566)
@@ -12,5 +12,5 @@
 
 import logging
-logger = logging.getLogger('Student.Accommodation.Reserve')
+logger = logging.getLogger('Skins.reserve_accommodation')
 
 #if info is None:
@@ -19,5 +19,5 @@
 if info is None:
     member_id = str(context.portal_membership.getAuthenticatedMember())
-    logger.info('"%s","tried to reserve accommodation"' % (member_id))
+    logger.info('%s tried to reserve accommodation' % (member_id))
     return context.REQUEST.RESPONSE.redirect("%s/srp_invalid_access" % context.portal_url())
 
@@ -55,5 +55,5 @@
 if psm == 'invalid' or info['error'] is not None:
     member_id = str(context.portal_membership.getAuthenticatedMember())
-    logger.info('"%s", %s' % (member_id,info['error'] ))
+    logger.info('%s, %s' % (member_id,info['error'] ))
     if psm == 'invalid':
         psm = "Please correct your input."
@@ -94,5 +94,5 @@
                                      )
         else:
-            bed = already[0].bed 
+            bed = already[0].bed
         student.invokeFactory('StudentAccommodation',acco_id)
         acco = getattr(student,acco_id)
