Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/allocate_reserved_bed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/allocate_reserved_bed.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/allocate_reserved_bed.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/change_bed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/change_bed.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/change_bed.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/fixReservedBeds.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/fixReservedBeds.py	(revision 1558)
+++ 	(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/branches/joachim-event-branch/skins/waeup_accommodation/formatBed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/formatBed.py	(revision 1558)
+++ 	(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/branches/joachim-event-branch/skins/waeup_accommodation/getAccoHallInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/getFormattedBed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/getFormattedBed.py	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/getFormattedBed.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/hall_delete.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/hall_delete.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/hall_delete.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/reallocateBed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/reallocateBed.py	(revision 1558)
+++ 	(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/branches/joachim-event-branch/skins/waeup_accommodation/reallocate_bed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/reallocate_bed.py	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/reallocate_bed.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/release_bed.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/release_bed.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/release_bed.py	(revision 1596)
@@ -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/branches/joachim-event-branch/skins/waeup_accommodation/reserve_accommodation.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/reserve_accommodation.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/reserve_accommodation.py	(revision 1596)
@@ -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)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logged_in.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logged_in.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logged_in.py	(revision 1596)
@@ -21,5 +21,5 @@
 current = DateTime.DateTime()
 import logging
-logger = logging.getLogger('Member.Login')
+logger = logging.getLogger('Skins.logged_in')
 
 
@@ -71,10 +71,10 @@
         student_per = getattr(student,'personal',None)
         p_review_state = wftool.getInfoFor(student_per,'review_state',None)
-        logger.info('"%s", "logged in", "review_state %s"' % (member,s_review_state))
+        logger.info('%s logged in, review_state %s' % (member,s_review_state))
         app_doc = student_app.getContent()
         #from Products.zdb import set_trace;set_trace()
         if load_passport and 'passport' not in app_doc.objectIds():
             msg = context.waeup_tool.loadStudentFoto(student)
-            logger.info('"%s", "%s"' % (member,msg))
+            logger.info('%s, %s' % (member,msg))
         if s_review_state in ("student_created","admitted") and\
                              a_review_state == 'created' :
@@ -134,5 +134,5 @@
             redirect_url = "%s/student_index" % student.absolute_url()
     else:
-        logger.info('"%s", "logged in"' % (member))
+        logger.info('%s logged in' % (member))
         redirect_url = portal.absolute_url()
 #Anonymous
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logout.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logout.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_custom/logout.py	(revision 1596)
@@ -10,5 +10,5 @@
 # notify the event service that the user has logged out
 import logging
-logger = logging.getLogger('Member.Logout')
+logger = logging.getLogger('Skins.logout')
 user = context.portal_membership.getAuthenticatedMember()
 if user:
@@ -16,5 +16,5 @@
     evtool = getPublicEventService(context)
     evtool.notifyEvent('user_logout', user, {})
-    logger.info('"%s", "logged out"' % (user))
+    logger.info('%s logged out' % (user))
 
 REQUEST = context.REQUEST
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/isCourseAdviser.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/isCourseAdviser.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/isCourseAdviser.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "isClearanceOfficer"
+## Script (Python) "isCourseAdviser"
 ##bind container=container
 ##bind context=context
@@ -9,7 +9,4 @@
 ##
 # $Id: isClearanceOfficer.py 1087 2006-12-18 22:13:31Z joachim $
-
-#from Products.zdb import set_trace
-#set_trace()
 if context.isStudent():
     return False
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/waeup_edit.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/waeup_edit.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/waeup_edit.py	(revision 1596)
@@ -17,4 +17,10 @@
 from Products.CPSDocument.utils import getFormUidUrlArg
 
+import logging
+logger = logging.getLogger('Skins.waeup_edit')
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+
 # Check flexible controls
 #context.editLayouts(REQUEST=REQUEST)
@@ -25,5 +31,5 @@
 if context.portal_type == "StudentStudyCourse":
     if len(context.objectIds()) > 0:
-        psm = 'Edit of StudyCourse is only possible if there are no levels'
+        psm = 'Edit of StudentStudyCourse is only possible if there are no levels inside!'
         args = getFormUidUrlArg(REQUEST)
         args['portal_status_message'] = psm
@@ -58,4 +64,6 @@
                                                   department = c_path[-3],
                                                   )
+            logger.info('%s edited %s (%s) of %s' % (member,context.id,course,student_id))
+
     elif context.portal_type == "StudentApplication":
         entry_mode = ds.get('entry_mode')
@@ -64,4 +72,5 @@
                                               entry_mode = entry_mode,
                                              )
+        logger.info('%s edited %s of %s' % (member,context.id,student_id))
     elif context.portal_type == "StudentClearance":
         matric_no = ds.get('matric_no')
@@ -70,4 +79,5 @@
                                               matric_no = matric_no,
                                              )
+        logger.info('%s edited %s of %s' % (member,context.id,student_id))                                             
     elif context.portal_type in ("StudentPersonal",):
         name = "%(firstname)s %(middlename)s %(lastname)s" % ds
@@ -81,5 +91,5 @@
         #if ds.get('sex'):
         #    jamb_sex = 'F'
-        # originally imported data must be kept; app_doc should not be changed here  
+        # originally imported data must be kept; app_doc should not be changed here
         #app_doc.edit(mapping={'jamb_lastname': name,
         #                      'jamb_sex': jamb_sex
@@ -91,4 +101,5 @@
                                               sex = ds.get('sex'),
                                              )
+        logger.info('%s edited %s of %s' % (member,context.id,student_id))
     elif context.portal_type == "Course":
         dd = {}
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/approve_epayment.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/approve_epayment.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/approve_epayment.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "epayment_cb"
+## Script (Python) "approve_epayment"
 ##bind container=container
 ##bind context=context
@@ -10,8 +10,7 @@
 # $Id: aprove_epayment.py 1425 2007-02-15 17:52:01Z joachim $
 """
-payment callback
 """
 import logging
-logger = logging.getLogger('EPayment.Approve')
+logger = logging.getLogger('Skins.approve_epayment')
 import DateTime
 if context.portal_membership.isAnonymousUser():
@@ -42,5 +41,5 @@
 if doc.type_description.startswith('School Fee'):
     wftool.doActionFor(student,'pay_school_fee')
-logger.info('"%s", "approved epayment for","%s""' % (member,student_id))
+logger.info('%s approves epayment for %s' % (member,student_id))
 wftool.doActionFor(context,'close')
 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/epayment_cb.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/epayment_cb.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/epayment_cb.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('EPayment.CallBack')
+logger = logging.getLogger('Skins.epayment_cb')
 import DateTime
 if context.portal_membership.isAnonymousUser():
@@ -43,10 +43,10 @@
 if  resp == '00':
     wftool.doActionFor(student,'pay_school_fee')
-    logger.info('"%s", "received valid callback"' % student_id)
+    logger.info('%s received valid callback' % student_id)
 
 elif len(resp) < 3:
-    logger.info('"%s", "received no callback"' % student_id)
+    logger.info('%s received no callback' % student_id)
 else:
-    logger.info('"%s", "received unsuccessfull callback"' % student_id)
+    logger.info('%s received unsuccessfull callback' % student_id)
 wftool.doActionFor(context,'close')
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/getPaymentsFolderInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getPaymentsInfo"
+## Script (Python) "getPaymentsFolderInfo"
 ##bind container=container
 ##bind context=context
@@ -12,6 +12,7 @@
 Info for the PaymentsFolder
 """
-import logging
-logger = logging.getLogger('EPayment.Info')
+#import logging
+#logger = logging.getLogger('Skins.getPaymentsFolderInfo')
+
 import DateTime
 request = context.REQUEST
@@ -57,5 +58,5 @@
         row['confirmed'] = 'unsuccessful'
     payments.append(row)
-    
+
 
 info['payments'] = payments
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_by_sc.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_by_sc.py	(revision 1596)
@@ -14,5 +14,5 @@
 import logging
 from urllib import urlencode
-logger = logging.getLogger('EPayment.PayBySC')
+logger = logging.getLogger('Skins.pay_by_sc')
 import DateTime
 
@@ -85,7 +85,7 @@
     wftool.doActionFor(payment,'close')
     wftool.doActionFor(student,'pay_school_fee')
-    logger.info('"%s", "paid school fee by scratch card"' % student_id)
+    logger.info('%s paid school fee by scratch card' % student_id)
 else:
-    logger.info('"%s", "repeatedly paid school fee by scratch card"' % student_id)
+    logger.info('%s repeatedly paid school fee by scratch card' % student_id)
 url = "%s/payments" % (student.absolute_url())
 request.RESPONSE.redirect(url)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_online.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_online.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/pay_online.py	(revision 1596)
@@ -14,5 +14,5 @@
 from urllib import urlencode
 import logging
-logger = logging.getLogger('EPayment.PayOnline')
+logger = logging.getLogger('Skins.pay_online')
 import DateTime
 
@@ -91,5 +91,5 @@
 info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
 
-logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info)
+logger.info('%(student_id)s initiated online school fee payment' % info)
 payment_fields = (('x_SiteID','site_id'),
                   ('x_Redirect_url','callback_url'),
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/simulate_callback.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/simulate_callback.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/simulate_callback.py	(revision 1596)
@@ -5,9 +5,11 @@
 return html renderer + psm
 """
-import DateTime,logging
+import DateTime
 current = DateTime.DateTime()
 pr = context.portal_registration
-logger = logging.getLogger('EPayment.Simulate')
 validate = REQUEST.has_key("cpsdocument_edit_button")
+
+import logging
+logger = logging.getLogger('Skins.simulate_callback')
 
 args = {}
@@ -18,4 +20,8 @@
 args['x_ApprAmt'] = REQUEST.get('x_amt')
 
+
+student_id = context.getStudentId()
+logger.info('%s received simulated callback' % student_id)
+
 from urllib import urlencode
 #url = "%s/epayment_cb/?%s" % (context.absolute_url(),urlencode(args))
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/disable_pins.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/disable_pins.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/disable_pins.py	(revision 1596)
@@ -15,5 +15,5 @@
 current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
 import logging
-logger = logging.getLogger('Pin.Disable')
+logger = logging.getLogger('Skins.disable_pins')
 
 request = REQUEST
@@ -39,4 +39,4 @@
             }
     pincat.modifyRecord(**dict)
-    logger.info('"%s","disabled pin","%s"' % (member,uid))
+    logger.info('%s disabled pin %s' % (member,uid))
 return request.RESPONSE.redirect("%s/campus/pins/search_pins" % context.portal_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/enable_pins.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/enable_pins.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_pins/enable_pins.py	(revision 1596)
@@ -15,5 +15,5 @@
 current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
 import logging
-logger = logging.getLogger('Pin.Enable')
+logger = logging.getLogger('Skins.enable_pins')
 
 request = REQUEST
@@ -42,4 +42,4 @@
             }
     pincat.modifyRecord(**dict)
-    logger.info('"%s","enabled pin","%s"' % (member,pid))
+    logger.info('%s enabled pin %s' % (member,uid))
 return request.RESPONSE.redirect("%s/campus/pins/search_pins" % context.portal_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_course_result.py	(revision 1596)
@@ -12,4 +12,8 @@
 add a StudentCourseResult object
 """
+
+import logging
+logger = logging.getLogger('Skins.add_course_result')
+
 from urllib import urlencode
 try:
@@ -23,4 +27,9 @@
 aq_portal = context.portal_catalog.evalAdvancedQuery
 course_id = request.get('course_id')
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+
+
 d = context.getCourseInfo(course_id)
 args = {}
@@ -28,11 +37,14 @@
 while True:
     if d['title'] == 'unknown':
-        err = "No such course"
+        err = "No such course!"
+        logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id))
         break
     if context.hasObject(course_id):
-        err = "Course already exists"
+        err = "Course already exists!"
+        logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id))
         break
     if context.hasObject("%s_co" % course_id):
-        err = "Course already exists as carryover course"
+        err = "Course already exists as carryover course!"
+        logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id))
         break
     break
@@ -40,7 +52,10 @@
 if err:
     args['course_id'] = course_id
-    args['error'] = err
+    #args['error'] = err
+    args['portal_status_message'] = err
     url = "%s?%s" % (context.absolute_url(),urlencode(args))
     return request.RESPONSE.redirect(url)
+
+   
 cr_id = context.invokeFactory('StudentCourseResult',course_id)
 #set_trace()
@@ -50,4 +65,7 @@
 context.portal_workflow.doActionFor(cr,'close')
 args['course_id'] = course_id
+
+logger.info('%s added StudentCourseResult object %s' % (member,course_id))   
+
 from urllib import urlencode
 url = "%s?%s" % (context.absolute_url(),urlencode(args))
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_student.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_student.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/add_student.py	(revision 1596)
@@ -13,5 +13,5 @@
 acco_cat = context.portal_accommodation
 import logging
-logger = logging.getLogger('Student.Add')
+logger = logging.getLogger('Skins.add_student')
 
 validate = REQUEST.has_key("cpsdocument_edit_button") and\
@@ -67,5 +67,5 @@
 student_rec = context.getFormattedStudentEntry(context.students_catalog(id = sid)[0])
 psm = "Student record with Id %s and Password %s has been created." % (sid,password)
-logger.info('"%s","created student","%s"' % (member,sid))
+logger.info('%s created student %s' % (member,sid))
 return context.add_student_form(rendered = rendered,
                                  #psm = "%s, %s" % (psm,ds),
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/application_edit.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/application_edit.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/application_edit.py	(revision 1596)
@@ -16,5 +16,5 @@
 current = DateTime.DateTime()
 import logging
-logger = logging.getLogger('Student.Application.Edit')
+logger = logging.getLogger('Skins.application_edit')
 
 # Until ajax posts directly to its own script...
@@ -30,5 +30,5 @@
 
 if info is None:
-    logger.info('"anonymous access","%s"' % REQUEST.get('URL0'))
+    logger.info('Anonymous user tried to access %s"' % REQUEST.get('URL0'))
     return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
 
@@ -56,5 +56,5 @@
     elif cpsdocument_edit_and_view_button:
         if 1: ## app_doc.passport is not None:
-            logger.info('"%s", "proceeded to start clearance"' % (info['id']))
+            logger.info('%s proceeded to start clearance' % (info['id']))
             action = "/start_clearance"
             base_url = student.absolute_url()
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py	(revision 1596)
@@ -14,5 +14,5 @@
 current = DateTime.DateTime()
 #pr = context.portal_registration
-logger = logging.getLogger('Student.change_password')
+logger = logging.getLogger('Skins.change_password')
 validate = request.has_key("change_password")
 students_dir = context.portal_directories.students
@@ -24,5 +24,5 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access %s' % (member_id,requested_id))
     return None
 elif context.isStaff():
@@ -74,4 +74,5 @@
 args['__ac_name'] = student_id
 args['__ac_password'] = password
+logger.info('%s changed password from %s to %s' % (member_id,old_password,password))
 from urllib import urlencode
 url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py	(revision 1596)
@@ -16,5 +16,5 @@
 current = DateTime.DateTime()
 import logging
-logger = logging.getLogger('Student.Clearance.Edit')
+logger = logging.getLogger('Skins.clearance_edit')
 request = REQUEST
 
@@ -70,5 +70,5 @@
     if cpsdocument_edit_button or result_edit_button:
         psm = "Content changed!"
-        logger.info('"%s","edited clearance of","%s"' % (member_id,student_id ))
+        logger.info('%s edited clearance of %s' % (member_id,student_id ))
         if clear_doc.clr_ac_pin == "":
             res = context.portal_pins(student=member_id)
@@ -92,8 +92,8 @@
                     missing = True
             if missing:
-                logger.info('"%s","requested clearance with documents missing"' % (student_id))
+                logger.info('%s requested clearance with documents missing' % (student_id))
                 psm = "You have not uploaded all necessary documents to request clearance!"
             else:
-                logger.info('"%s","requested clearance"' % (student_id))
+                logger.info('%s requested clearance' % (student_id))
                 info['clear_doc'].edit(mapping = {'request_date': current,})
                 wftool.doActionFor(info['clear'],'close')
@@ -103,10 +103,10 @@
                     action = "/clearance_view"
         elif acknowledge and info['review_state'] != "clearance_pin_entered":
-            logger.info('"%s","repeatedly requested clearance"' % (student_id))
+            logger.info('%s repeatedly requested clearance' % (student_id))
             psm = "You have already requested clearance!"
         else:
             psm = "You must tick the acknowledgement check box before submission!"
     elif clear_and_validate_button and info['review_state'] == "clearance_requested":
-        logger.info('"%s","cleared","%s"' % (member_id,student_id ))
+        logger.info('%s cleared %s' % (member_id,student_id ))
         #from Products.zdb import set_trace
         #set_trace()
@@ -117,9 +117,12 @@
         psm = "This student is already cleared!"
     elif reject_clearance_button:
-        logger.info('"%s","rejected clearance for","%s"' % (member_id,student_id ))
+        logger.info('%s rejected clearance for %s' % (member_id,student_id ))
         wftool.doActionFor(info['clear'],'open')
         wftool.doActionFor(info['student'],'reject_clearance')
         action = "/contact_student_form"
         psm = "Student's clearance request has been rejected! Please fill and submit the form below!"
+        subject = "Clearance request rejected"
+        args['subject'] = subject
+        args['continue'] = 'external_clearance_edit_form'
 else:
     psm = "Please correct your errors!"
@@ -128,4 +131,4 @@
 args['portal_status_message'] = psm
 url = clear.absolute_url() + action + '?' + urlencode(args)
-REQUEST.RESPONSE.redirect(url)
+return REQUEST.RESPONSE.redirect(url)
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_slip.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_slip.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_slip.pt	(revision 1596)
@@ -1,5 +1,5 @@
-<metal:html tal:define="info context/getClearanceInfo">
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
+<metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main"
+                 tal:define="info context/getClearanceInfo">
       <span tal:condition="not: info">
         <span tal:content="here/illegal_view" />
@@ -66,4 +66,3 @@
       </span>
     </metal:main>
-  </metal:body>
-</metal:html>
+</metal:body>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/contact_student_form.pt	(revision 1596)
@@ -1,6 +1,9 @@
+<metal:block define-macro="contact_student_form">
 <metal:body use-macro="here/main_template/macros/master">
     <metal:main fill-slot="main"
                 tal:define="member python:context.portal_membership.getAuthenticatedMember();
                         info context/getStudentBaseInfo;
+                        subject python:context.REQUEST.get('subject');
+                        continue python:context.REQUEST.get('continue')
                         ">
       <span tal:condition="not: info">
@@ -8,5 +11,5 @@
       </span>                        
     
-      <span tal:condition="info">
+      <span tal:condition="python: info and subject">
       <h3>Contact Student</h3>
       <br />
@@ -23,5 +26,7 @@
       <input type="hidden" name="student_email" type="text" id="student_email"
              tal:attributes="value info/student/email"/>                   
-
+      <input type="hidden" name="probtype" type="text" id="probtype"
+             tal:attributes="value subject"/>     
+             
       <table width="100%" border="0" cellspacing="5" cellpadding="0">
         <tr>
@@ -42,11 +47,9 @@
         </tr>
         <tr>
-          <td>
-             <strong>Type of Rejection: </strong>
+          <td valign="top">
+             <strong>Reason of Notification: </strong>
           </td>
-          <td>
-              <select name="probtype" class="boxgreen" id="probtype">
-                <option>Clearance request rejected</option>
-              </select>        
+          <td valign="bottom">
+             <span tal:content="subject" />
           </td>
         </tr>        
@@ -67,5 +70,6 @@
       </span>
       <form action="." method="post" class="group">
-            <input type="submit" name="external_clearance_edit_form:method"
+            <input type="submit" name="."
+                       tal:attributes="name string:${continue}:method"
                        class="context" value="Continue" />
       </form>      
@@ -73,2 +77,3 @@
     </metal:main>
 </metal:body>
+</metal:block>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_registration_slip.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_registration_slip.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_registration_slip.pt	(revision 1596)
@@ -1,12 +1,13 @@
-<metal:html tal:define="info context/getStudyLevelInfo;
+<metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main"
+                tal:define="info context/getStudyLevelInfo;
                   is_so context/isSectionOfficer;
                   is_ca info/is_ca;
                   show_check_boxes info/show_check_boxes;
-		  is_student info/is_student;
-		  status_info info/status_info;
-		  review_state info/review_state;
-		  view_only info/view_only">
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
+                  validated python:context.getStudentReviewState() in ('courses_validated',);
+		              is_student info/is_student;
+            		  status_info info/status_info;
+            		  review_state info/review_state;
+            		  view_only info/view_only">
       <span tal:condition="not: info">
         <span tal:content="here/illegal_view" />
@@ -14,29 +15,24 @@
       <span tal:condition="info">
       <h3>Course Registration Slip</h3>
+      
       <br />
-      <table width="" cellpadding="2" cellspacing="0">
+      
+      <div tal:condition="validated">
+        - validated by Course Adviser -
+      </div>
+      <div tal:condition="not: validated">
+        - not yet validated by Course Adviser -
+      </div>
+      
+      <br />
+      <span tal:omit-tag=""
+            tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
+            layout_mode='view_info', 
+            layout_id='student_application_fe')" 
+            />           
+
+      <table  cellpadding="2" cellspacing="0">
           <tr>
-            <td valign="top"><span class="dlabel">Name</span>:
-            </td>
-            <td> 
-              <span tal:content="info/student/name" />
-            </td>      
-          </tr>
-          <tr>
-            <td valign="top"><span class="dlabel">Student Id</span>:
-            </td>
-            <td> 
-              <span tal:content="info/student/id" />
-            </td>      
-          </tr>
-          <tr>
-            <td valign="top"><span class="dlabel">Matriculation No</span>:
-            </td>
-            <td> 
-              <span tal:content="info/student/matric_no" />
-            </td>      
-          </tr>
-          <tr>
-            <td valign="top"><span class="dlabel">Faculty Id</span>:
+            <td valign="top" width="180px"><span class="dlabel">Faculty Id</span>:
             </td>
             <td> 
@@ -111,5 +107,4 @@
        </span>              
     </metal:main>
-  </metal:body>
-</metal:html>
+</metal:body>
   
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_result_delete.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/course_result_delete.py	(revision 1558)
+++ 	(revision )
@@ -1,33 +1,0 @@
-## 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$
-"""
-FIXME: add docstring.
-"""
-
-from Products.CMFCore.utils import getToolByName
-here = context
-
-ret_url = here.absolute_url()
-
-message = ''
-if ids:
-    real_ids = []
-    for id in ids:
-        if context.hasObject(id):
-            real_ids.append(id)
-    if real_ids:
-        context.manage_delObjects(real_ids)
-        message = 'portal_status_message=psm_item(s)_deleted'
-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/branches/joachim-event-branch/skins/waeup_student/create_level.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/create_level.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/create_level.py	(revision 1596)
@@ -21,5 +21,5 @@
 response = request.RESPONSE
 redirect = response.redirect
-logger = logging.getLogger('Student.create_level')
+logger = logging.getLogger('Skins.create_level')
 mtool = context.portal_membership
 member = mtool.getAuthenticatedMember()
@@ -30,8 +30,13 @@
 cert_id = student.course
 current_level = student.level
-in_progress =  session.get('in_progress','finished')
-if in_progress == 'finished':
+in_progress =  request.get('in_progress','not started')
+
+if context.hasObject(current_level):
+    response.redirect("%s/%s" % (context.absolute_url(),current_level))
+    return
+
+if in_progress in ('not started','started'):
     session.set('in_progress','started')
-    view = context.in_progress_view(refresh=3,page='%s/study_level_view' % current_level)
+    view = context.in_progress_view(refresh=3,page='create_level?in_progress=started')
     response.setHeader('Content-type','text/html; charset=ISO-8859-15')
     response.setHeader('Content-length','%d' % (len(view)))
@@ -39,12 +44,8 @@
     response.write(view)
     response.write('')
-elif in_progress == 'started':
-    return
+    if in_progress == 'started':
+        return
+    
 
-if context.hasObject(current_level):
-    return
-    level = getattr(context,current_level)
-    return response.redirect("%s" % level.absolute_url())
-    
 context.invokeFactory('StudentStudyLevel',"%s" % current_level)
 level = getattr(context,"%s" % current_level)
@@ -63,5 +64,5 @@
         c_res = aq_courses(query)
         if not c_res:
-            logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode))
+            logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
             continue
         course_cat_entry = c_res[0]
@@ -73,9 +74,9 @@
                 score = int(co.Score)
             except:
-                logger.info('"%s"," course %s invalid score %s"' % (student.id,
+                logger.info('%s, course %s has invalid score %s"' % (student.id,
                                                                     co.CosCode,
                                                                     co.Score))
                 continue
-            if int(c_res[0].passmark) <= score:  
+            if int(c_res[0].passmark) <= score:
                 continue
             carry_over = True
@@ -105,4 +106,3 @@
         d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
         course_result.getContent().edit(mapping=d)
-session.set('in_progress','finished')
 return
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py	(revision 1596)
@@ -0,0 +1,39 @@
+## Script (Python) "delete_course_result"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=ids=[], REQUEST=None
+##title=
+##
+# $Id: delete_course_result.py 1557 2007-03-15 16:00:27Z joachim $
+"""
+FIXME: add docstring.
+"""
+
+from Products.CMFCore.utils import getToolByName
+here = context
+
+import logging
+logger = logging.getLogger('Skins.delete_course_result')
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+
+ret_url = here.absolute_url()
+
+message = ''
+if ids:
+    real_ids = []
+    for id in ids:
+        if context.hasObject(id):
+            real_ids.append(id)
+    if real_ids:
+        context.manage_delObjects(real_ids)
+        logger.info('%s deleted StudentCourseResult object %s' % (member,id))
+        message = 'portal_status_message=psm_item(s)_deleted'
+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/branches/joachim-event-branch/skins/waeup_student/external_contact_student_form.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_contact_student_form.pt	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_contact_student_form.pt	(revision 1596)
@@ -0,0 +1,1 @@
+<metal:block use-macro="here/contact_student_form/macros/contact_student_form" />
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/external_study_level_view.pt	(revision 1596)
@@ -0,0 +1,199 @@
+<metal:html>
+  <metal:body use-macro="here/waeup_content_master/macros/master">
+    <metal:block fill-slot="header" 
+                 tal:define="global info context/getStudyLevelInfo;
+                 global is_so context/isSectionOfficer;
+                 global is_ca info/is_ca;
+                 global show_check_boxes info/show_check_boxes;
+		             global is_student info/is_student;
+		             global status_info info/status_info;
+		             global review_state info/review_state;
+		             global view_only info/view_only">
+              <div style="text-align: right"
+             tal:condition="python:review_state == 'courses_validated'">
+        <a href="" target="slip" tal:attributes="href string:course_registration_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Course Registration Slip
+        </a>
+        
+        </div>
+
+      <h3> 
+        <span tal:condition="python: is_so or is_ca">
+          <span tal:content="info/student/name" />:
+        </span>
+        Course Registration Form for <span tal:content="here/title_or_id" />
+      </h3>
+
+    </metal:block>
+    <metal:main fill-slot="main" tal:condition="python:1">
+      <form action="." method="post" class="group">
+        <span tal:condition="info/carry_overs" tal:omit-tag="">
+        <h4>Carryover Courses</h4>
+        <br />
+        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">
+          <tr tal:repeat="row info/carry_overs"
+              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td align="left" valign="middle" style="width: 5px;"
+                tal:condition="show_check_boxes">
+              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                     tal:define="id row/id"
+                     tal:attributes="value id;
+                     id python:'cb_' + id;
+                     checked python:id in info['choosen_ids'];" 
+                     />
+            </td>
+            <td width="78%" tal:content="row/title"></td>
+            <td align="center" width="10%" tal:content="row/code"></td>
+            <td align="center" width="2%">S<span tal:content="row/semester" /></td>
+            <td align="center" width="2%" tal:content="row/credits"></td>
+            <td align="center" width="8%" tal:content="row/grade|string:"></td>
+          </tr>
+        </table>
+        </span> 
+        <br />
+        <h4>Session Courses</h4>
+        <br />
+      <div class="" tal:condition="not: info/normal">
+        Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty!
+      </div>
+        <table class="contentListing" width="100%" id="folder_content"
+               tal:condition="info/normal">      
+          <tr tal:repeat="row info/normal"
+              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td align="left" valign="middle" style="width: 5px;"
+	              tal:condition="show_check_boxes">
+              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                     tal:define="id row/id"
+                     tal:attributes="value id;
+                     id python:'cb_' + id;
+                     checked python:id in info['choosen_ids'];" 
+                     />
+            </td>
+            <td width="78%" tal:content="row/title"></td>
+            <td align="center" width="10%" tal:content="row/code"></td>
+            <td align="center" width="2%">S<span tal:content="row/semester" /></td>
+            <td align="center" width="2%" tal:content="row/credits"></td>
+            <td align="center" width="8%" tal:content="row/coe|nothing"></td>
+          </tr>
+          <tr>
+            <td tal:condition="show_check_boxes" colspan="1"></td>
+            <td colspan="1"></td>
+            <th colspan="2">Total Credits:</th>
+            <td align="center" width="2%" tal:content="info/credits_total"></td>
+          </tr>
+        </table>
+
+        
+      
+        
+        <table tal:condition="python: is_student and review_state == 'school_fee_paid'" width="100%" cellspacing="0" cellpadding="2"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+                <input type="submit" name="delete_course_result:method" value="Delete selected"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       ('Do you really want to delete selected courses?', )" 
+                       />
+                <input type="submit" name="refresh_level:method"
+                       class="context" value="Update" 
+                       />
+                <br /><br />
+                <input tal:condition="info/normal" 
+                       type="submit" name="register_courses:method"
+                       class="context" value="Submit" />
+            </td>
+          </tr>
+        </table>
+        <table tal:condition="python:is_so" width="100%" cellspacing="0" cellpadding="2"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+                <input type="button" value="Select all" class="context"
+                       onclick="someJavaScriptFunctionThatWillBeReplaced"
+                       i18n:attributes="value"
+                       tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
+                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
+                       />
+                <input type="submit" name="delete_course_result:method" value="Delete selected"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       ('Do you really want to delete the courses selected?', )" 
+                       />
+                <input 
+                       type="submit" name="refresh_level:method"
+                       class="context" value="Update" 
+                       />
+                <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
+                       class="context" value="Submit" />  
+                <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
+                       class="context" value="Validate" />
+                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
+                       class="context" value="Reject" />
+
+            </td>
+          </tr>
+        </table>
+        <table tal:condition="python:is_ca" width="100%" cellspacing="0" cellpadding="2"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+                <input tal:condition="python: review_state == 'school_fee_paid'"
+                       type="button" value="Select all" class="context"
+                       onclick="someJavaScriptFunctionThatWillBeReplaced"
+                       i18n:attributes="value"
+                       tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
+                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
+                       />
+                <input tal:condition="python: review_state == 'school_fee_paid'"
+                       type="submit" name="delete_course_result:method" value="Delete selected"
+                       class="destructive" i18n:attributes="value"
+                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                       ('Do you really want to delete the courses selected?', )" 
+                       />
+                <input tal:condition="python: review_state == 'school_fee_paid'"
+                       type="submit" name="refresh_level:method"
+                       class="context" value="Update" 
+                       />
+                <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
+                       class="context" value="Submit" />  
+                <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
+                       class="context" value="Validate" />
+                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
+                       class="context" value="Reject" />
+
+                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
+                       tal:attributes="value string:external_study_level_view"/>                         
+                <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
+                       tal:attributes="value string:external_contact_student_form"/>    
+                                           
+
+            </td>
+          </tr>
+        </table>
+
+      </form>
+      <br />
+        <form action="add_course_result" method="post" class="group"
+            tal:condition="show_check_boxes">
+        <table>
+          <tr>
+            <th>Course Id</th>
+            <td><input type="text" name="course_id" 
+                       tal:attributes="value request/course_id|nothing"/></td>
+            <td colspan="2">
+              <input type="submit" name="add"
+                     class="context" value="Add Course" 
+                     />
+            </td>                
+        </table>
+        </form>         
+    </metal:main>
+  </metal:body>
+</metal:html>
+  
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getAccommodationInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getAccommodationInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getAccommodationInfo.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Accommodation.Info')
+logger = logging.getLogger('Skins.getAccommodationInfo')
 import DateTime
 
@@ -29,5 +29,5 @@
     requested_id = context.getStudentId()
     if requested_id and not context.isStaff() and member_id != requested_id:
-        logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+        logger.info('%s tried to access %s' % (member_id,requested_id))
         return None
     elif context.isStaff():
@@ -37,5 +37,5 @@
 res = context.students_catalog(id=student_id)
 if len(res) != 1:
-    logger.info('"%s","not found in students_catalog"')
+    logger.info('%s not found in students_catalog' % student_id)
     return None
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getApplicationInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getApplicationInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getApplicationInfo.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Application.Info')
+logger = logging.getLogger('Skins.getApplicationInfo')
 
 request = context.REQUEST
@@ -28,6 +28,7 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "accessed application object of", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access application object of %s' % (member_id,requested_id))
     student_id = requested_id
+    return None
 elif context.isStaff():
     student_id = requested_id
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getClearanceInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getClearanceInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getClearanceInfo.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Clearance.Info')
+logger = logging.getLogger('Skins.getClearanceInfo')
 from DateTime import DateTime
 
@@ -30,5 +30,5 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access %s' % (member_id,requested_id))
     return None
 elif context.isStaff():
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getLogData.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getLogData.py	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getLogData.py	(revision 1596)
@@ -0,0 +1,37 @@
+## Script (Python) "getLogData"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+"""
+return logfile entries
+"""
+
+wtool = context.waeup_tool
+
+# Default values...
+filename = "event.log"
+numlines = 30
+
+# Validate posted vars...
+request = container.REQUEST
+if 'filename' in request.keys():
+    if request['filename'] in ['event.log','Z2.log']:
+        filename = request['filename']
+
+if 'numlines' in request.keys():
+    try:
+        reqlines = int(request['numlines'])
+        if reqlines > 0 and reqlines < 1000:
+            numlines = reqlines
+    except:
+        pass
+
+return { 'filename' : filename,
+         'numlines' : numlines,
+         'lines' : wtool.getLogfileLines(filename, numlines)
+       }
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getMemberInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getMemberInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getMemberInfo.py	(revision 1596)
@@ -28,6 +28,7 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "accessed personal object of", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
     student_id = requested_id
+    return None
 elif context.isStaff():
     student_id = requested_id
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getNewStudentStatistics.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getNewStudentStatistics.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getNewStudentStatistics.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Statistics')
+logger = logging.getLogger('Skins.getNewStudentStatistics')
 
 try:
@@ -21,5 +21,5 @@
 except:
     evalAdvancedQuery = None
-logger.info('"%s","invoked new statistics"' % context.portal_membership.getAuthenticatedMember())
+logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
 l = []
 if not context.isStaff():
@@ -108,5 +108,5 @@
     if total:
         dep['cleared_and_validated_percent'] = "%.0f" % round(cav*100/total)
-        
+
     ora = len([s for s in fac_ids if s in or_ids])
     dep['objection_raised'] = ora
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getPersonalInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getPersonalInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getPersonalInfo.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Personal.Info')
+logger = logging.getLogger('Skins.getPersonalInfo')
 
 request = context.REQUEST
@@ -28,6 +28,7 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "accessed personal object of", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
     student_id = requested_id
+    return None
 elif context.isStaff():
     student_id = requested_id
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRegStatistics.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRegStatistics.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRegStatistics.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Statistics')
+logger = logging.getLogger('Skins.getRegStatistics')
 
 try:
@@ -21,5 +21,5 @@
 except:
     evalAdvancedQuery = None
-logger.info('"%s","invoked reg statistics"' % context.portal_membership.getAuthenticatedMember())
+logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
 l = []
 if not context.isStaff():
@@ -81,5 +81,5 @@
     if total:
         dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
-        
+
     cval = len([s for s in fac_ids if s in cval_ids])
     dep['courses_validated'] = cval
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRetStudentStatistics.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRetStudentStatistics.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getRetStudentStatistics.py	(revision 1596)
@@ -21,5 +21,5 @@
 except:
     evalAdvancedQuery = None
-logger.info('%s invoked returning statistics' % context.portal_membership.getAuthenticatedMember())
+logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
 l = []
 if not context.isStaff():
@@ -59,5 +59,5 @@
     sum_ret += ret
     sum_sfp += sfp
-       
+
     l.append(dep)
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSchoolFeePrefix.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSchoolFeePrefix.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSchoolFeePrefix.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getMaintenancePrefix"
+## Script (Python) "getSchoolFeePrefix"
 ##bind container=container
 ##bind context=context
@@ -16,6 +16,6 @@
     return None
 
-import logging    
-logger = logging.getLogger('EPayment.getSchoolFeePrefix')    
+import logging
+logger = logging.getLogger('Skins.getSchoolFeePrefix')
 
 student_id = context.getStudentId()
@@ -24,5 +24,5 @@
                                      id = sbrain.course)
 if not res:
-    logger.info('"%s","certificate not found", "%s"' % (student_id,course))
+    logger.info('%s, certificate %s not found' % (student_id,course))
     prefix = "--"
 else:
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py	(revision 1596)
@@ -27,6 +27,6 @@
 if requested_id and not context.isStaff() and member_id != requested_id:
     import logging
-    logger = logging.getLogger('Student.SessionResults.Info')
-    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    logger = logging.getLogger('Skins.getSessionResults')
+    logger.info('%s tried to access %s' % (member_id,requested_id))
     return None
 elif context.isStaff():
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentBaseInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentBaseInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentBaseInfo.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Base.Info')
+logger = logging.getLogger('Skins.getStudentBaseInfo')
 from DateTime import DateTime
 
@@ -29,5 +29,5 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access %s' % (member_id,requested_id))
     return None
 elif context.isStaff():
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentFolderInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentFolderInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentFolderInfo.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getStudentInfo"
+## Script (Python) "getStudentFolderInfo"
 ##bind container=container
 ##bind context=context
@@ -21,5 +21,5 @@
 
 import logging
-logger = logging.getLogger('Student.Info')
+logger = logging.getLogger('Skins.getStudentFolderInfo')
 
 
@@ -38,5 +38,5 @@
         break
     if member_id != requested_id:
-        logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+        logger.info('%s tried to access %s' % (member_id,requested_id))
         student_id = member_id
         mtool.assertViewable(context)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudentInfo.py	(revision 1596)
@@ -21,5 +21,5 @@
 
 import logging
-logger = logging.getLogger('Student.Info')
+logger = logging.getLogger('Skins.getStudentInfo')
 
 
@@ -42,5 +42,5 @@
             break
         if member_id != requested_id:
-            logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+            logger.info('%s tried to access %s' % (member_id,requested_id))
             student_id = member_id
             mtool.assertViewable(context)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyCourseInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyCourseInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyCourseInfo.py	(revision 1596)
@@ -52,11 +52,11 @@
 levels = context.objectIds()
 review_state = wftool.getInfoFor(context,'review_state',None)
-if review_state != 'content_addable':
+student_review_state = context.getStudentReviewState()
+if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent():
     wftool.doActionFor(context,'close_for_edit')
-student_review_state = context.getStudentReviewState()
 may_register = (student_review_state in ('school_fee_paid',)) and\
                current_level not in levels and\
                (sbrain.verdict in ('A','B') or sbrain.jamb_reg_no.startswith('6'))
-               
+
 levels.sort()
 info['create_level'] = None
@@ -72,8 +72,8 @@
 info['items'] = items
 
-try: 
+try:
     info['verdict'] = context.portal_vocabularies.verdicts.get(info['doc'].current_verdict).upper()
 except:
-    info['verdict'] = course.current_verdict 
+    info['verdict'] = course.current_verdict
 
 return info
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py	(revision 1596)
@@ -61,5 +61,5 @@
 info['review_state'] = review_state = context.getStudentReviewState()
 info['view_only'] =  review_state != "school_fee_paid"
-info['show_check_boxes'] =  (is_ca and review_state in ('courses_registered',)) or\
+info['show_check_boxes'] =  (is_ca and review_state in ('school_fee_paid',)) or\
                             (is_student and context.getStudentReviewState() == "school_fee_paid") or\
                             (is_so)
@@ -108,3 +108,9 @@
 normal.sort(cmp_semester)
 info['normal'] = normal
+
+students_object = context.portal_url.getPortalObject().campus.students
+student = getattr(students_object, student_id)
+info['app'] = student.application
+info['app_doc'] = student.application.getContent()
+
 return info
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getTransferInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getTransferInfo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getTransferInfo.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getClearanceInfo"
+## Script (Python) "getTransferInfo"
 ##bind container=container
 ##bind context=context
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Transfer.Info')
+logger = logging.getLogger('Skins.getTransferInfo')
 from DateTime import DateTime
 
@@ -29,5 +29,5 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access %s' % (member_id,requested_id))
     return None
 elif context.isStaff():
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_application_view_info.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_application_view_info.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_application_view_info.pt	(revision 1596)
@@ -5,5 +5,5 @@
               dm options/datastructure/getDataModel;
               widgets python:context.getRenderedWidgets(layout);
-              fields python:('jamb_reg_no','app_email','app_mobile')"
+              info context/getStudentBaseInfo;"
               >
   
@@ -20,5 +20,5 @@
           </td>
           <td> 
-            <span tal:content="python:context.getStudentBaseInfo()['student']['name']" />
+            <span tal:content="info/student/name" />
           </td>      
         </tr>
@@ -27,5 +27,5 @@
           </td>
           <td> 
-            <span tal:content="python:context.getStudentBaseInfo()['student']['sex']" />
+            <span tal:content="info/student/sex" />
           </td>      
         </tr>          
@@ -34,26 +34,42 @@
           </td>
           <td> 
-            <span tal:content="python:context.getStudentBaseInfo()['id']" />
+            <span tal:content="info/id" />
           </td>      
         </tr>
-
-        <tr tal:repeat="field fields">
-          <tal:block tal:define="cell python: widgets[field]">
-            <tal:block define="widget cell/widget">
-              <div tal:attributes="class cell/widget_css_class|string:label;
-              id python:widget.getHtmlWidgetId()+'_widget';"
-              >
-                <td >
-                  <span class="dlabel"
-                        tal:condition="widget/label"
-                        tal:content="widget/label">label</span>:
-                </td>
-                <td> 
-                  <span tal:replace="structure cell/widget_rendered" />
-                </td>
-              </div>
-            </tal:block>
-          </tal:block>
-        </tr>
+        <tr valign="top">
+          <td><span class="dlabel">Matriculation No</span>:
+          </td>
+          <td> 
+            <span tal:content="info/student/matric_no" />
+          </td>      
+        </tr>        
+        <tr valign="top">
+          <td><span class="dlabel">JAMB Registration No</span>:
+          </td>
+          <td> 
+            <span tal:content="info/student/jamb_reg_no" />
+          </td>      
+        </tr>   
+        <tr valign="top">
+          <td><span class="dlabel">Email</span>:
+          </td>
+          <td> 
+            <span tal:content="info/student/email" />
+          </td>      
+        </tr>         
+        <tr valign="top">
+          <td><span class="dlabel">Phone</span>:
+          </td>
+          <td> 
+            <span tal:content="info/student/phone" />
+          </td>      
+        </tr>         
+        <tr valign="top">
+          <td><span class="dlabel">Level</span>:
+          </td>
+          <td> 
+            <span tal:content="info/student/level" />
+          </td>      
+        </tr>           
       </table>
         
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/mail2student.py	(revision 1596)
@@ -37,5 +37,5 @@
      co_name,
      co_email,
-     student_email,  
+     student_email,
      co_email,
      'henrik@waeup.org',
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/personal_edit.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/personal_edit.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/personal_edit.py	(revision 1596)
@@ -16,10 +16,10 @@
 current = DateTime.DateTime()
 import logging
-logger = logging.getLogger('Student.Personal.Edit')
+logger = logging.getLogger('Skins.personal_edit')
 
 info = context.getPersonalInfo()
 
 if info is None:
-    logger.info('"anonymous access","%s"' % REQUEST.get('URL0'))
+    logger.info('Anonymous user tried to access %s' % REQUEST.get('URL0'))
     return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
 
@@ -53,5 +53,5 @@
                                               sex = ds.get('sex'),
                                              )
-        logger.info('"%s", "edited personal data"' % (info['id']))
+        logger.info('%s edited personal data' % (info['id']))
         #action = ""
         #base_url = student.absolute_url()
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/raise_objection.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/raise_objection.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/raise_objection.py	(revision 1596)
@@ -14,10 +14,10 @@
 import DateTime
 import logging
-logger = logging.getLogger('Student.Objection')
+logger = logging.getLogger('Skins.raise_objection')
 
 wf = context.portal_workflow
 info = context.getApplicationInfo()
 if not info:
-    logger.info('"%s", "tried to access", "%s"' % (context.portal_membership.getAuthenticatedMember(),context.getStudentId()))
+    logger.info('%s tried to access %s' % (context.portal_membership.getAuthenticatedMember(),context.getStudentId()))
     return context.admission_form()
 current = DateTime.DateTime()
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/refresh_level.py	(revision 1596)
@@ -16,4 +16,7 @@
 aq_courses = context.courses_catalog.evalAdvancedQuery
 
+import logging
+logger = logging.getLogger('Skins.refresh_level')
+
 current = DateTime.DateTime()
 request = context.REQUEST
@@ -21,5 +24,5 @@
 response = request.RESPONSE
 redirect = response.redirect
-logger = logging.getLogger('Student.create_level')
+logger = logging.getLogger('Skins.refresh_level')
 mtool = context.portal_membership
 member = mtool.getAuthenticatedMember()
@@ -51,5 +54,5 @@
         c_res = aq_courses(query)
         if not c_res:
-            logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode))
+            logger.info('%s, course %s not found in courses_catalog' % (student.id,co.CosCode))
             continue
         course_cat_entry = c_res[0]
@@ -60,9 +63,9 @@
                 score = int(co.Score)
             except:
-                logger.info('"%s"," course %s invalid score %s"' % (student.id,
+                logger.info('%s, course %s has invalid score %s' % (student.id,
                                                                     co.CosCode,
                                                                     co.Score))
                 continue
-            if int(c_res[0].passmark) <= score:  
+            if int(c_res[0].passmark) <= score:
                 continue
             carry_over = True
@@ -96,4 +99,5 @@
             course_result.getContent().edit(mapping=d)
 session.set('in_progress','finished')
+logger.info('%s updated course list' % member)
 return
 return response.redirect("%s" % level.absolute_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/register_courses.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getStudyCourseInfo"
+## Script (Python) "register_courses"
 ##bind container=container
 ##bind context=context
@@ -12,4 +12,5 @@
 close the Students StudyLevel
 """
+from Products.CMFCore.WorkflowCore import WorkflowException
 try:
     from Products.zdb import set_trace
@@ -23,11 +24,20 @@
 member_id = str(member)
 import logging
-logger = logging.getLogger('Student.register_courses')
+logger = logging.getLogger('Skins.register_courses')
 
 wftool = context.portal_workflow
-wftool.doActionFor(context,'close')
 students_folder = context.portal_url.getPortalObject().campus.students
-student = getattr(students_folder,context.getStudentId())
-wftool.doActionFor(student,'register_courses')
-logger.info('"%s","courses registered"' % student.getId())
+student_id = context.getStudentId()
+student = getattr(students_folder,student_id)
+try:
+    wftool.doActionFor(context,'close')
+except WorkflowException,E:
+    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
+    return request.RESPONSE.redirect("%s" % context.absolute_url())
+try:
+    wftool.doActionFor(student,'register_courses')
+except WorkflowException,E:
+    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
+    return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s registered course list for %s' % (member_id,student_id))
 return request.RESPONSE.redirect("%s" % context.absolute_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/reject_courses.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getStudyCourseInfo"
+## Script (Python) "reject_courses"
 ##bind container=container
 ##bind context=context
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=student=None
+##parameters=REQUEST, student=None, action_after_reject=None, action_after_validate=None
 ##title=
 ##
@@ -17,5 +17,5 @@
     def set_trace():
         pass
-
+from urllib import urlencode
 request = context.REQUEST
 mtool = context.portal_membership
@@ -23,5 +23,5 @@
 member_id = str(member)
 import logging
-logger = logging.getLogger('Student.reject_courses')
+logger = logging.getLogger('Skins.reject_courses')
 
 wftool = context.portal_workflow
@@ -31,4 +31,15 @@
 student = getattr(students_folder,context.getStudentId())
 wftool.doActionFor(student,'reject_courses')
-logger.info('"%s","rejects course list for","%s"' % (member,student.getId()))
-return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s rejected course list of %s' % (member,student.getId()))
+
+args = {}
+
+psm = "Student's course list has been rejected! Please fill and submit the form below!"
+subject = "Course list rejected"
+args['subject'] = subject
+args['continue'] = action_after_validate
+args['portal_status_message'] = psm
+url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
+return REQUEST.RESPONSE.redirect(url)
+
+#return request.RESPONSE.redirect("%s" % context.absolute_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/request_transfer.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/request_transfer.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/request_transfer.py	(revision 1596)
@@ -14,5 +14,5 @@
 import logging
 from urllib import urlencode
-logger = logging.getLogger('Student.Transfer.Request')
+logger = logging.getLogger('Skins_request_transfer')
 import DateTime
 lt = context.portal_layouts
@@ -28,6 +28,7 @@
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
-    logger.info('"%s", "accessed application object of", "%s"' % (member_id,requested_id))
+    logger.info('%s tried to access object of %s' % (member_id,requested_id))
     student_id = requested_id
+    return None
 elif context.isStaff():
     student_id = requested_id
@@ -50,5 +51,5 @@
 
 if paid:
-    logger.info('"%s", "opened (paid) request transfer form of", "%s"' % (member_id,student_id))
+    logger.info('%s opened (paid) request transfer form of %s' % (member_id,student_id))
     return context.request_transfer_form(rendered = None,
                                  psm = None,
@@ -91,4 +92,6 @@
     payments = getattr(student,'payments')
 #from Products.zdb import set_trace; set_trace()
+
+logger.info('%s paid transfer form for %s' % (member_id,student_id))
 info = {}
 order_id = ds.get('pin_n')
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students.py	(revision 1596)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Search.Timer')
+logger = logging.getLogger('Skins.search_students')
 from DateTime import DateTime
 #
@@ -82,4 +82,5 @@
                  In('localUsersWithRoles', ("user:%s" % member,))
         res = evalAdvancedQuery(query)
+        logger.info('ClearanceOfficer %s initiated student_search' % member)
         faculties = []
         if res:
@@ -107,4 +108,5 @@
                  In('localUsersWithRoles', ("user:%s" % member,))
         res = evalAdvancedQuery(query)
+        logger.info('CourseAdviser %s initiated student_search' % member)
         certificate_level = []
         if res:
@@ -168,4 +170,5 @@
         students_folder = context.portal_url.getPortalObject().campus.students
         if hasattr(students_folder,term.strip()):
+            logger.info('%s searches for student with id %s' % (member,term))
             request.RESPONSE.redirect("%s/%s" % (students_folder.absolute_url(),term))
         return context.search_students_form(rendered = rend,
@@ -176,7 +179,9 @@
     elif what == "department":
         res = context.students_catalog(department=term.strip())
+        logger.info('%s searches for student in department %s' % (member,term))
         search_set = [r.id for r in res]
     elif what == "matric_no":
         res = context.students_catalog(matric_no=term.strip())
+        logger.info('%s searches for student with matric_no %s' % (member,term))
         search_set = [r.id for r in res]
     elif what == "jamb_reg_no":
@@ -184,8 +189,10 @@
         st_u = "%s" % term.strip().upper()
         res = aq_students(In('jamb_reg_no',(st_l,st_u)))
+        logger.info('%s searches for student with jamb_reg_no %s' % (member,term))
         search_set = [r.id for r in res]
     elif what == "name":
         pt = ('StudentPersonal')
         query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
+        logger.info('%s searches for student with name %s' % (member,term))
         res = evalAdvancedQuery(query)
         if res:
@@ -201,4 +208,7 @@
     query = Eq('review_state',state)
     review_res = evalAdvancedQuery(query)
+
+    logger.info('%s searches for students in review_state %s' % (member,state))
+
     if with_timer:
         end = DateTime().timeTime()
@@ -288,4 +298,5 @@
                              allowed = allowed,
                              co_view = co_view,
+                             ca_view = ca_view
                              )
 return context.search_students_form(rendered = rend,
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students_form.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students_form.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/search_students_form.pt	(revision 1596)
@@ -1,10 +1,3 @@
 <metal:body use-macro="here/main_template/macros/master">
-    <metal:block fill-slot="header"
-                 tal:define="creation creation|nothing;
-                 edition edition|nothing;
-                 metadata metadata|nothing"
-                 >
-    </metal:block>
-    
     <metal:main fill-slot="main"
             tal:define="rendered options/rendered;
@@ -12,5 +5,5 @@
             students options/students;
             info options/info|nothing;
-            is_so context/isSectionOfficer;            
+            is_so context/isSectionOfficer;
             allowed options/allowed|nothing"
             >
@@ -30,4 +23,6 @@
       &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
       <span tal:condition="is_so">
+         <nobr><a href="view_logs">View Log Files</a>
+         &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
          <nobr><a href="add_student">Add Student Record</a>        
          &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
@@ -35,4 +30,6 @@
       </span>
       </strong>
+    
+              
         <h3> Search Student Section</h3><br />
           You are logged in as member <span tal:replace="info/member|nothing" /> 
@@ -43,8 +40,4 @@
           <span tal:condition="info/departments|nothing" tal:omit-tag="">
             and <span tal:repeat="department info/departments|nothing" tal:content="department"/></span>.
-          <span tal:condition="info/certificate_level|nothing" tal:omit-tag="">
-            who is CourseAdviser for 
-            <span tal:repeat="cl info/certificate_level" tal:content="cl" />
-          </span>
           <br /><br />
         <span tal:replace="structure rendered" />
@@ -96,5 +89,10 @@
                          onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"
                          >[view and change state]</a></td>
-                    <td tal:condition="options/co_view|nothing"><span tal:replace="student/review_state|nothing" /></td>   
+                    <td tal:condition="options/ca_view|nothing">
+                      <a href="id" 
+                         tal:attributes="href string:${context/portal_url}/campus/students/${student/id}/study_course/study_course/${student/level}/external_study_level_view"
+                         target="edit"
+                         onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"
+                         >[view and validate course list]</a></td>
                   </tr>
                 </span>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/set_access_data.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/set_access_data.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/set_access_data.py	(revision 1596)
@@ -8,9 +8,9 @@
 current = DateTime.DateTime()
 pr = context.portal_registration
-logger = logging.getLogger('Student.SetAccessData')
+logger = logging.getLogger('Skins.set_access_data')
 validate = REQUEST.has_key("cpsdocument_edit_button")
 
 if matric_no is None:
-    logger.info('"No matric_no in request"')
+    logger.info('No matric_no in request')
     return REQUEST.RESPONSE.redirect("%s" % context.portal_url())
 lt = context.portal_layouts
@@ -21,5 +21,5 @@
     sid = st_res[0].id
 else:
-    logger.info('"%s","Studentobject does not exist"' % matric_no)
+    logger.info('Student object with matric_no does not exist' % matric_no)
 res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
                       schema_id= 'student_returning',
@@ -53,8 +53,8 @@
         #psm = "You are already registered please log in with your UserId %s" % sid
         psm = ""
-        logger.info('"%s","repeatedly tried to set password"' % sid)
+        logger.info('%s repeatedly tried to set password' % sid)
     except:
         psm = "The system encountered an error. Please try again."
-        logger.info('"%s","set_access error","%s"' % (sid,password))
+        logger.info('%s, makeStudentMember error, password = %s' % (sid,password))
 if psm != '':
     return context.set_access_data_form(rendered = res,
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/start_clearance.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/start_clearance.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/start_clearance.py	(revision 1596)
@@ -8,5 +8,5 @@
 pr = context.portal_registration
 import logging
-logger = logging.getLogger('Student.Clearance.Start')
+logger = logging.getLogger('Skins.start_clearance')
 
 #type_name = 'Student'
@@ -23,5 +23,5 @@
 if info is None:
     member_id = str(context.portal_membership.getAuthenticatedMember())
-    logger.info('"%s","tried to start clearance for", "%s"' % (member_id,request.get('PATH_INFO').split('/')[-2]))
+    logger.info('%s tried to start clearance for %s' % (member_id,request.get('PATH_INFO').split('/')[-2]))
     return redirect("%s/srp_invalid_access" % context.portal_url())
 app_doc = info['app_doc']
@@ -55,13 +55,13 @@
     psm = "You have already entered a clearance pin!"
     error = True
-    logger.info('"%s", "tried to start clearance though already started"' % (info['id']))
+    logger.info('%s tried to start clearance though already started' % (info['id']))
 elif psm == 'invalid':
     psm = "Please correct your input!"
     error = True
-    logger.info('"%s","entered wrong clearance pin"' % (info['id']))
+    logger.info('%s entered wrong clearance pin' % (info['id']))
 elif app_doc.passport is None:
     #psm = "You must upload your passport picture before you can start the registration process!"
     #error = True
-    logger.info('"%s", "started clearance without passport picture"' % (info['id']))
+    logger.info('%s started clearance without passport picture' % (info['id']))
 if error:
     return context.clearance_pin_form(rendered = res,
@@ -74,5 +74,5 @@
 session.set("clicked","clicked")
 pin = str(ds.get('clr_ac_pin'))
-logger.info('"%s", "started clearance with pin", "%s"' % (info['id'],pin))
+logger.info('%s started clearance with pin %s' % (info['id'],pin))
 wf.doActionFor(info['student'],'enter_clearance_pin')
 wf.doActionFor(info['clear'],'open')
@@ -89,5 +89,5 @@
 
 if info['penalty']:
-    logger.info('"%s","started late clearance"' % (info['id']))
+    logger.info('%s started late clearance' % (info['id']))
 
 return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_ret_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_ret_view.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_ret_view.pt	(revision 1596)
@@ -59,6 +59,6 @@
         <br />
         <table>
-        <tr><td>RET:</td> <td>Returning students who only logged in</td></tr>
-        <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr>
+        <tr><td>RET:</td> <td>Returning students who have logged in</td></tr>
+        <tr><td>SFP:</td> <td>Returning students who already paid their school fee</td></tr>
         </table>        
       </span>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_view.pt	(revision 1558)
+++ 	(revision )
@@ -1,66 +1,0 @@
-                      
-  <metal:body use-macro="here/main_template/macros/master">
-
-
-    <metal:main fill-slot="main">
-
-  <metal:block tal:define="departments context/getStudentStatistics;
-                        mtool here/portal_membership;
-                        member mtool/getAuthenticatedMember;">       
-
-      <span tal:condition="not: departments">
-        <span tal:content="here/illegal_view" />
-      </span>
-      <span tal:condition="departments">
-  
-      <a href="search_students"><strong>Search Students</strong></a>
-      <h3>Student Statistics</h3>
-      <br />      
-      <span tal:condition="not:isAnon">
-        <table>
-          <tr class="odd ajaxtd">
-            <th >Faculty</th>
-            <th align="right">Total</th>
-            <th align="right">OR</th>
-            <th align="right">CPE</th>
-            <th align="right">CR</th>
-            <th align="right">VC</th>
-          </tr>
-          <tr tal:repeat="d departments"
-              tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')">
-              <td width="80px"> <span tal:content="d/id" /> </td>
-              <td width="80px" align="right">
-                <span tal:content="d/students" />
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/objection_raised" />
-                (<span tal:content="d/objection_raised_percent" />%)
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/clearance_pin_entered" />
-                (<span tal:content="d/clearance_pin_entered_percent" />%)
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/clearance_requested" />
-                (<span tal:content="d/clearance_requested_percent" />%)
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/cleared_and_validated" />
-                (<span tal:content="d/cleared_and_validated_percent" />%)
-              </td>
-          </tr>
-        </table>
-        <br />
-        <table>
-        <tr><td>OR:</td> <td>Objection raised</td></tr>
-        <tr><td>CPE:</td> <td>Clearance PIN entered</td></tr>
-        <tr><td>CR: </td> <td>Clearance requested</td></tr>
-        <tr><td>VC: </td> <td>Validated and cleared</td></tr>
-        </table>
-      </span>
-      </span>
-</metal:block>      
-    </metal:main>
-
-  </metal:body>
-      
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/students_index.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/students_index.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/students_index.py	(revision 1596)
@@ -25,7 +25,7 @@
 if "ClearanceOfficers" in member.getGroups() or\
    "CourseAdvisers" in member.getGroups():
-    return redirect("%s/search_students" % context.portal_url())
+    return redirect("%s/campus/students/search_students" % context.portal_url())
 if context.isSectionOfficer():
-    return redirect("%s/search_students" % context.portal_url())
+    return redirect("%s/campus/students/search_students" % context.portal_url())
 if context.isStudent():
     id = str(member)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_level_view.pt	(revision 1596)
@@ -6,8 +6,8 @@
                  global is_ca info/is_ca;
                  global show_check_boxes info/show_check_boxes;
-		 global is_student info/is_student;
-		 global status_info info/status_info;
-		 global review_state info/review_state;
-		 global view_only info/view_only">
+		             global is_student info/is_student;
+		             global status_info info/status_info;
+		             global review_state info/review_state;
+		             global view_only info/view_only">
       <a href=""
          tal:attributes="href string:${here/academicsParent}">
@@ -101,5 +101,5 @@
             <td align="left" valign="top" rowspan="3"></td>
             <td align="left" valign="top">
-                <input type="submit" name="course_result_delete:method" value="Delete selected"
+                <input type="submit" name="delete_course_result:method" value="Delete selected"
                        class="destructive" i18n:attributes="value"
                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
@@ -127,8 +127,8 @@
                        % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
                        />
-                <input type="submit" name="course_result_delete:method" value="Delete selected"
+                <input type="submit" name="delete_course_result:method" value="Delete selected"
                        class="destructive" i18n:attributes="value"
                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
-                       ('really delete checked courses', )" 
+                       ('Do you really want to delete the courses selected?', )" 
                        />
                 <input 
@@ -159,5 +159,5 @@
                        />
                 <input tal:condition="python: review_state == 'school_fee_paid'"
-                       type="submit" name="course_result_delete:method" value="Delete selected"
+                       type="submit" name="delete_course_result:method" value="Delete selected"
                        class="destructive" i18n:attributes="value"
                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
@@ -174,4 +174,10 @@
                 <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
                        class="context" value="Reject" />
+                       
+                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
+                       tal:attributes="value string:/study_level_view"/>                         
+                <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
+                       tal:attributes="value string:/contact_student_form"/>    
+                                             
 
             </td>
@@ -188,6 +194,4 @@
             <td><input type="text" name="course_id" 
                        tal:attributes="value request/course_id|nothing"/></td>
-            <td tal:condition="request/error|nothing" 
-                tal:content="request/error" />
             <td colspan="2">
               <input type="submit" name="add"
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/validate_courses.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "getStudyCourseInfo"
+## Script (Python) "validate_courses"
 ##bind container=container
 ##bind context=context
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=student=None
+##parameters=student=None, action_after_reject=None, action_after_validate=None
 ##title=
 ##
@@ -23,5 +23,5 @@
 member_id = str(member)
 import logging
-logger = logging.getLogger('Student.validate_courses')
+logger = logging.getLogger('Skins.validate_courses')
 
 wftool = context.portal_workflow
@@ -29,4 +29,9 @@
 student = getattr(students_folder,context.getStudentId())
 wftool.doActionFor(student,'validate_courses')
-logger.info('"%s","validated courses for","%s"' % (member,student.getId()))
-return request.RESPONSE.redirect("%s" % context.absolute_url())
+logger.info('%s validated course list of %s' % (member,student.getId()))
+
+psm = 'portal_status_message=Course list validated!'
+url = context.absolute_url() + '/' + action_after_validate +  '?' + psm
+return request.RESPONSE.redirect(url)
+
+
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/view_logs.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/view_logs.pt	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/view_logs.pt	(revision 1596)
@@ -0,0 +1,56 @@
+<metal:body use-macro="here/main_template/macros/master">
+  <metal:main fill-slot="main">
+  <metal:block tal:define="data context/getLogData;
+			mtool here/portal_membership;
+                        member mtool/getAuthenticatedMember;">       
+
+      <h3>Current Log Entries (<span tal:replace="data/filename"/>)</h3>
+      <br />      
+
+      <span tal:condition="not:isAnon">
+
+        <form method="post" action="view_logs">
+          Show last <input type="text" name="numlines" value="20"
+		           tal:attributes="value data/numlines" />
+	  lines of
+	  <select name="filename">
+	    <option 
+	       tal:attributes="selected python: data['filename']=='event.log'"
+	       value="event.log">Event Log</option>
+            <option 
+	       tal:attributes="selected python: data['filename']=='Z2.log'"
+               value="Z2.log">Access Log</option>
+          </select>
+          <input type="submit" value="Refresh" />
+        </form>
+
+	<hr />
+
+        <table>
+          <tr class="even ajaxtd" tal:repeat="line data/lines">
+	    <td><span tal:replace="line" /></td>
+          </tr>
+        </table>
+
+	<hr />
+
+        <form method="post" action="view_logs">
+          Show last <input type="text" name="numlines" value="20"
+		           tal:attributes="value data/numlines" />
+	  lines of
+	  <select name="filename">
+	    <option 
+	       tal:attributes="selected python: data['filename']=='event.log'"
+	       value="event.log">Event Log</option>
+            <option 
+	       tal:attributes="selected python: data['filename']=='Z2.log'"
+               value="Z2.log">Access Log</option>
+          </select>
+          <input type="submit" value="Refresh" />
+        </form>
+
+      </span> <!-- condition: not:isAnon -->
+  </metal:block>      
+  </metal:main>
+</metal:body>
+      
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/createReturningStudent.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/createReturningStudent.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/createReturningStudent.py	(revision 1596)
@@ -17,5 +17,5 @@
 students_folder = context.portal_url.getPortalObject().campus.students
 import logging
-logger = logging.getLogger('createReturningStudent')
+logger = logging.getLogger('Skins.createReturningStudent')
 
 if not matric_no:
@@ -30,5 +30,5 @@
     student_brain = res[0]
     sid,jamb_reg_no = context.waeup_tool.createOne(students_folder,student_brain,'?')
-    logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
+    logger.info('%s creates student %s %s' % (member,sid,matric_no))
     return "Student MatricNo %s, StudentId %s (JAMBRegNo %s) created" % (matric_no,sid,jamb_reg_no)
 
@@ -36,5 +36,5 @@
 count = 1
 total = 0
-logger.info('"%s","Create Students start"' % (member))
+logger.info('%s started createReturningStudent"' % (member))
 letters = ('ABCDEFGHKLMNPQRSTUVWXYZ')
 lc = 0
@@ -42,14 +42,13 @@
     res = context.students_catalog(matric_no = matric_no)
     if len(res) == 1:
-        #logger.info('"Student already exists","%s"' % (matric_no))
         continue
     elif len(res) > 1:
-        logger.info('"Student with multiple entries","%s","%s" ' % (matric_no,len(res)))
+        logger.info('Student %s with multiple entries (%s)' % (matric_no,len(res)))
+        # fix at the beginning
         ids = [r.id for r in res if not r.id.startswith('A')]
-        #from Products.zdb import set_trace;set_trace()
         for id in ids:
             context.students_catalog.deleteRecord(id)
         students_folder.manage_delObjects(ids)
-        logger.info('"deleted students","%s" ' % " ".join(ids))
+        logger.info('Student objects deleted: %s' % " ".join(ids))
         continue
     student = context.returning_import(matric_no=matric_no)[0]
@@ -59,9 +58,9 @@
         lc = 0
     context.waeup_tool.createOne(students_folder,student,letter)
-    logger.info('"Student created","%s"' % (matric_no))
+    logger.info('Student created: %s' % (matric_no))
     count += 1
     if count > 10:
-        logger.info('"%s","Committed Students","%s", "%s" ' % (member,count,total))
+        logger.info('%s committed students %s, %s' % (member,count,total))
         total += count
         count = 1
-logger.info('"%s","Create Students finish","%s"' % (member,total))
+logger.info('createReturningStudent finished (%s)' % (total))
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/deleteStudentByMatricNo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/deleteStudentByMatricNo.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/deleteStudentByMatricNo.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "search_pins"
+## Script (Python) "deleteStudentByMatricNo"
 ##bind container=container
 ##bind context=context
@@ -12,5 +12,5 @@
 """
 import logging
-logger = logging.getLogger('DeleteStudentByMatricNo')
+logger = logging.getLogger('Skins.deleteStudentByMatricNo')
 
 request = REQUEST
@@ -26,7 +26,7 @@
 if str(member) not in ('admin','joachim') or matric_no is None:
     return
-    
-    
-# remove from students_catalog    
+
+
+# remove from students_catalog
 
 res = st_cat(matric_no=matric_no)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixLevelForNewStudents.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixLevelForNewStudents.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixLevelForNewStudents.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "search_pins"
+## Script (Python) "fixLevelForNewStudents"
 ##bind container=container
 ##bind context=context
@@ -23,5 +23,5 @@
 setheader = request.RESPONSE.setHeader
 import logging
-logger = logging.getLogger('fixLevelForNewStudents')
+logger = logging.getLogger('Skins.fixLevelForNewStudents')
 
 def rwrite(s):
@@ -53,5 +53,5 @@
 count_full = 0
 commit_count = 0
-logger.info("started for %s students" % len(res))
+logger.info("Started for %s students" % len(res))
 to_change = {}
 for sbrain in res:
@@ -92,5 +92,5 @@
     if commit_count > 1000:
         context.waeup_tool.doCommit()
-        logger.info("committing %s transactions total %s" % (commit_count,count))
+        logger.info("Committing %s transactions, total %s" % (commit_count,count))
         commit_count = 0
     rwrite("%s: %s %s %s <br />" % (count,sbrain.id,entry_mode,level))
@@ -98,3 +98,3 @@
     students_cat.modifyRecord(**to_change[entry])
 rwrite("finished")
-logger.info("finished  %s students" % count)
+logger.info("Finished  %s students" % count)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixReservedBeds.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixReservedBeds.py	(revision 1596)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixReservedBeds.py	(revision 1596)
@@ -0,0 +1,45 @@
+##parameters=REQUEST
+# $Id: fixReservedBeds.py 1447 2007-02-20 13:41:26Z joachim $
+"""
+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('Skins.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 starts fixReservedBeds' % (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 finishes fixReservedBeds' % (member))
+return request.RESPONSE.redirect("%s" % context.absolute_url())
+
+
+
+
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/reindexCoursesCatalog.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/reindexCoursesCatalog.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/reindexCoursesCatalog.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "search_pins"
+## Script (Python) "reindexCourseCatalog"
 ##bind container=container
 ##bind context=context
@@ -23,5 +23,5 @@
 setheader = request.RESPONSE.setHeader
 import logging
-logger = logging.getLogger('reindexCourseCatalog')
+logger = logging.getLogger('Skins.reindexCourseCatalog')
 
 def rwrite(s):
@@ -51,5 +51,5 @@
 count_full = 0
 commit_count = 0
-logger.info("reindexing of courses_catalog started for %s courses" % len(courses))
+logger.info("Reindexing of courses_catalog started for %s courses" % len(courses))
 for course_brain in courses:
     course_doc = course_brain.getObject().getContent()
@@ -72,7 +72,7 @@
     if commit_count > 1000:
         context.waeup_tool.doCommit()
-        logger.info("committing %s transactions total %s" % (commit_count,count))
+        logger.info("Committing %s transactions, total %s" % (commit_count,count))
         rwrite("%s: committed %s <br />" % (count,commit_count))
         commit_count = 0
 rwrite("finished")
-logger.info("finished  reindexing %s courses" % count)
+logger.info("Reindexing finished (%s courses)" % count)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/removeResults2.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/removeResults2.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/removeResults2.py	(revision 1596)
@@ -1,3 +1,3 @@
-## Script (Python) "search_pins"
+## Script (Python) "removeResults2"
 ##bind container=container
 ##bind context=context
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('removeResults2')
+logger = logging.getLogger('Skins.removeResults2')
 
 request = REQUEST
@@ -43,8 +43,8 @@
         to_del.append(r.key)
         rwrite(r.matric_no + " " + r.Level +"  " + r.CosCode + "<br />")
-logger.info('"%s", "start to delete %s results"' % (member,len(to_del)))
+logger.info('%s starts to delete %s results' % (member,len(to_del)))
 for uid in to_del:
     rcat.deleteRecord(uid)
-logger.info('"%s", "finished with deletion of %s results"' % (member,len(to_del)))
+logger.info('%s finished deletion of %s results' % (member,len(to_del)))
 rwrite("Done")
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/unpay.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/unpay.py	(revision 1558)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/unpay.py	(revision 1596)
@@ -13,6 +13,9 @@
 """
 import logging
-logger = logging.getLogger('EPayment.Unpay')
+logger = logging.getLogger('Skins.unpay')
 import DateTime
+
+pm = context.portal_membership
+member = pm.getAuthenticatedMember()
 
 request = context.REQUEST
@@ -27,5 +30,5 @@
 #wftool.doActionFor(student,'return')
 wftool.doActionFor(student,'clear_and_validate')
-logger.info('"%s", "reset to state returning"' % student_id)
+logger.info('%s resets %s to state returning' % (member,student_id))
 
 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
