Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt	(revision 1268)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt	(revision 1269)
@@ -1,4 +1,3 @@
-<metal:html tal:define="info context/getAccoHallInfo;"
-            >
+<metal:html tal:define="info context/getAccoHallInfo">
   <metal:body use-macro="here/waeup_content_master/macros/master">
     <metal:block fill-slot="header">
@@ -32,8 +31,15 @@
       </table>
       <br />
-      <table tal:condition="info/reserved"
+      <div>
+        <a href="download" 
+           tal:attributes="href string:hall_allocation_list">
+          <strong>Download bedlist as csv </strong></a>
+      </div>
+      <br />
+      <table tal:condition="python:info['reserved']"
              tal:define="reserved info/reserved">
         <tr>
-          <th width="200px">Student</th>
+          <th width="50px">Student-Id</th>
+          <th width="150px">Name</th>
           <th>Bed</th>
         </tr>
@@ -43,4 +49,5 @@
                tal:content="bt/student"></a>
           </td>
+          <td tal:content="bt/name" />
           <td tal:content="bt/bed" />
         </tr>
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1268)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py	(revision 1269)
@@ -10,7 +10,14 @@
 # $Id$
 """
-return Info about the Faculties
+return Info about a Accommodation Hall
 """
+
+def cmp_bed(a,b):
+    if a['bed'] > b['bed']:
+        return 1
+    return -1
+
 request = context.REQUEST
+#from Products.zdb import set_trace;set_trace()
 
 wf = context.portal_workflow
@@ -30,4 +37,6 @@
 for bt in bed_types:
     total = len(pa(bed_type=bt,hall=context.getId()))
+    if total <= 1:
+        continue
     free = len(pa.searchResults({'bed_type': bt,
                                  'student':reserved,
@@ -39,14 +48,22 @@
 info['bed_types'] = bt_list
 res_list = []
-students_rpath = context.portal_catalog(meta_type = "StudentsFolder")[-1].relative_path
-students_url = "%s/%s" % (context.portal_url(),students_rpath)
-if reserved > 1:
+students_url = "%s/campus/students" % (context.portal_url())
+if reserved:
     for st in reserved:
         if st:
             res = pa(hall=context.getId(),student=st)
-            if res:
-                res_list.append({'student': st,
-                                 'student_url': '%s/%s' % (students_url,st),
-                                 'bed': context.formatBed(res[0].bed) })
+            if not res:
+                continue
+            d = {}
+            d['student'] = st
+            d['student_url'] ='%s/%s' % (students_url,st)
+            bed = context.formatBed(res[0].bed).split('/')
+            d['bed'] = " / ".join(bed[1:])
+            erg = context.students_catalog(id = st)
+            if erg:
+                sd = context.getFormattedStudentEntry(erg[0])
+                d.update(sd)
+            res_list.append(d)
+res_list.sort(cmp_bed)
 info['reserved'] = res_list
 
Index: /WAeUP_SRP/trunk/skins/waeup_accommodation/hall_allocation_list.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_accommodation/hall_allocation_list.py	(revision 1269)
+++ /WAeUP_SRP/trunk/skins/waeup_accommodation/hall_allocation_list.py	(revision 1269)
@@ -0,0 +1,54 @@
+## Script (Python) "hall_allocation_list"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id$
+"""
+export hall_allocation_list
+"""
+request = context.REQUEST
+setheader = request.RESPONSE.setHeader
+pa = context.portal_accommodation
+scat = context.students_catalog
+st_schema = context.students_catalog.schema()
+#fields = list(st_schema) + ["bed",]
+fields = ("id",
+          "name",
+          "bed",
+          "matric_no",
+          "jamb_reg_no",
+          "sex",
+          "email",
+          "phone",
+          "faculty",
+          "department",
+          "course",
+          "level",
+          )
+res_list = []
+lines = []
+lines.append(','.join(fields))
+format = "'" + '"%(' + ')s","%('.join(fields) + ')s"' +"'"
+reserved = pa(hall=context.getId())
+for bed in reserved:
+    if bed.student == '':
+        continue
+    erg = scat(id=bed.student)
+    if not erg:
+        continue
+    d = context.getFormattedStudentEntry(erg[0])
+    d['bed'] = bed.bed
+    lines.append(format % d)
+#setheader('Content-type', 'text/x-cvs')
+#setheader('Content-type','application/vnd.ms-excel')
+setheader('Content-type','text/semicolon-seperated-values')
+setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
+setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
+setheader('Cache-Control', 'post-check=0,pre-check=0')
+setheader('Pragma', 'no-cache') # HTTP/1.0
+return '\n'.join(lines)
Index: /WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py	(revision 1269)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py	(revision 1269)
@@ -0,0 +1,23 @@
+## Script (Python) "getFormattedStudentEntry"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=brain
+##title=
+##
+# $Id$
+"""
+return a formatted StudentCatalog Entry
+"""
+#from Products.zdb import set_trace;set_trace()
+fields = context.students_catalog.schema()
+d = {}
+for f in fields:
+    d[f] = getattr(brain,f,'--')
+    if f == "sex":
+        d[f] = 'M' 
+        if d[f]:
+            d[f] = 'F' 
+return d            
