Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/locales/en/LC_MESSAGES/waeup.kofa.po
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 9206)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 9207)
@@ -20,5 +20,5 @@
 
 msgid "Beds for Final Year Students"
-msgstr "Beds for NCE-III Students"
+msgstr "Beds for NCE-III+ Students"
 
 #. Default: "Don't forget to logout or exit your browser when you're done. If you are having trouble logging in, make sure to enable cookies in your web browser."
Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py	(revision 9207)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py	(revision 9207)
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+from waeup.kofa.testing import FunctionalTestCase
+from zope.component import getUtility
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+from waeup.fceokene.testing import FunctionalLayer
+
+class BedAllocationTests(StudentsFullSetup):
+
+    layer = FunctionalLayer
+
+    def test_getAccommodationDetails(self):
+        students_utils = getUtility(IStudentsUtils)
+        acc_details  = students_utils.getAccommodationDetails(self.student)
+        self.assertEqual(acc_details['bt'], 'regular_male_fr')
+        self.student['studycourse'].current_level = 200
+        acc_details  = students_utils.getAccommodationDetails(self.student)
+        self.assertEqual(acc_details['bt'], 'regular_male_re')
+        self.student['studycourse'].current_level = 300
+        acc_details  = students_utils.getAccommodationDetails(self.student)
+        self.assertEqual(acc_details['bt'], 'regular_male_fi')
+        self.student['studycourse'].current_level = 400
+        acc_details  = students_utils.getAccommodationDetails(self.student)
+        self.assertEqual(acc_details['bt'], 'regular_male_fi')
+        self.student['studycourse'].current_level = 500
+        acc_details  = students_utils.getAccommodationDetails(self.student)
+        self.assertEqual(acc_details['bt'], 'regular_male_fi')
+        return
Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py	(revision 9206)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py	(revision 9207)
@@ -222,4 +222,38 @@
         return None, payment
 
+    def getAccommodationDetails(self, student):
+        """Determine the accommodation data of a student.
+        """
+        d = {}
+        d['error'] = u''
+        hostels = grok.getSite()['hostels']
+        d['booking_session'] = hostels.accommodation_session
+        d['allowed_states'] = hostels.accommodation_states
+        d['startdate'] = hostels.startdate
+        d['enddate'] = hostels.enddate
+        d['expired'] = hostels.expired
+        # Determine bed type
+        studycourse = student['studycourse']
+        certificate = getattr(studycourse,'certificate',None)
+        current_level = studycourse.current_level
+        if None in (current_level, certificate):
+            return d
+        end_level = certificate.end_level
+        if current_level == 10:
+            bt = 'pr'
+        elif current_level == 100:
+            bt = 'fr'
+        elif current_level >= 300:
+            bt = 'fi'
+        else:
+            bt = 're'
+        if student.sex == 'f':
+            sex = 'female'
+        else:
+            sex = 'male'
+        special_handling = 'regular'
+        d['bt'] = u'%s_%s_%s' % (special_handling,sex,bt)
+        return d
+
     # FCEOkene prefix
     STUDENT_ID_PREFIX = u'K'
