Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt	(revision 634)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt	(revision 635)
@@ -93,10 +93,10 @@
                        % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
                        />
-                <input type="submit" name="folder_delete:method" value="button_delete"
+                <input type="submit" name="hall_delete:method" value="button_delete"
                        class="destructive" i18n:attributes="value"
                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
                        (cpsmcat('description_confirm_delete'), )" 
                        />
-                <input tal:condition="python: context.portal_type not in ('Semester','Certificate')"
+                <input tal:condition="python: 0 and context.portal_type not in ('Semester','Certificate')"
                        type="submit" name="id_rename_form:method"
                        class="context" value="Change Object ID" i18n:attributes="value" 
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py	(revision 634)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py	(revision 635)
@@ -21,5 +21,5 @@
 info['is_manager'] = context.isManager()
 info['is_student'] = context.isStudent()
-info['action'] = "%s" % context.campus.absolute_url()
+info['action'] = "%s" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
 items = []
@@ -49,5 +49,5 @@
         if st:
             res = pa(student=st)
-            bt_list.append({'student': st, 'bed': res[0].bed })
+            res_list.append({'student': st, 'bed': res[0].bed })
 info['reserved'] = res_list
 
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 634)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 635)
@@ -9,9 +9,5 @@
 pr = context.portal_registration
 
-
-type_name = 'StudentApplication'
-ti = context.portal_types[type_name]
-REQUEST.set('type_name',type_name)
-
+info = context.getStudentInfo()
 validate = REQUEST.has_key("cpsdocument_create_button")
 
@@ -25,11 +21,11 @@
                       ob={},
                       layout_mode='create',
-                      formaction = "acco_reserve",
+                      formaction = "reserve_acco",
                       button = "book Bed",
                       )
 if psm == 'invalid':
     return context.acco_reserve_form(rendered = res,
-                                 psm = "Please correct your input.",
-                                 #psm = "%s, %s" % (psm,ds),
+                                 #psm = "Please correct your input.",
+                                 psm = "%s, %s" % (psm,ds),
                                  firstlayout = True,
                                  lastlayout = True,
@@ -45,10 +41,21 @@
 elif psm == 'valid':
     s_id = ds.get('s_id')
-    pin = str(ds.get('app_ac_pin'))
-    return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
-          % (context.absolute_url(),s_id,pin.split('-')[2],pin))
+    pin = str(ds.get('acco_res_ac_pin'))
+    pa = context.portal_accommodation
+    code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
+    if code < 0:
+        return context.acco_reserve_form(rendered = res,
+                                 psm = bed,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+    else:
+        return context.acco_reserve_form(rendered = res,
+                                 psm = "successfully reserved bed %s" % bed,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
 
 
-return
-
-
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 634)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 635)
@@ -39,3 +39,6 @@
 info['per'] = student.personal
 info['per_doc'] = student.personal.getContent()
+info['sex'] = 'male'
+if info['per_doc'].sex:
+    info['sex'] = 'female'
 return info
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 634)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 635)
@@ -6,5 +6,5 @@
   ds options/datastructure;
   dm ds/getDataModel;
-  formaction formaction|string:student_edit;
+  formaction options/formaction|string:student_edit;
   creation creation|nothing;
   metadata metadata|nothing;
