Index: WAeUP_SRP/trunk/Accommodation.py
===================================================================
--- WAeUP_SRP/trunk/Accommodation.py	(revision 403)
+++ WAeUP_SRP/trunk/Accommodation.py	(revision 404)
@@ -10,4 +10,5 @@
 from Products.CPSDocument.CPSDocument import CPSDocument 
 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 
+from Products.WAeUP_SRP.WAeUPTables import AccommodationTable
 
 class AccoFolder(CPSDocument): ###(
@@ -19,4 +20,25 @@
     security = ClassSecurityInfo()
     
+    security.declareProtected(ModifyPortalContent,"generateFreeBedsList") ###(
+    def generateFreeBedsList(self):
+        """
+        generate the free Bedslist.
+        """
+        freelist = AccommodationTable()
+        l = self.portal_catalog({'meta_type': "Accommodation"}) 
+        halls = []
+        for h in l:
+            halls.append(h.getObject())
+        for hall in halls:
+            h = hall.getContent()
+            for block in range(1,int(h.nr_of_blocks)):
+                for floor in range(1,int(h.nr_of_floors)):
+                    for room in range(1,int(h.rooms_per_floor)):
+                        for bed in 'ABCDEFGH'[:int(h.beds_per_room)]:
+                            room_nr = floor*100 + room
+                            freelist.addRecord(bed = '%s_%d_%s' % (h.getId(),room_nr,bed),
+                                               bed_type = "test")
+
+###)
 
 InitializeClass(AccoFolder)
@@ -28,5 +50,4 @@
 ###)
 
-
 class Accommodation(CPSDocument): ###(
     """
@@ -37,5 +58,5 @@
     security = ClassSecurityInfo()
     
-    security.declareProtected(View,"Title")
+    security.declareProtected(View,"Title") ###(
     def Title(self):
         """compose title"""
@@ -45,5 +66,10 @@
             return self.title
         return heading
-    
+
+###)
+
+        
+                            
+                
 InitializeClass(Accommodation)
 
Index: WAeUP_SRP/trunk/WAeUPStudentWidgets.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPStudentWidgets.py	(revision 403)
+++ 	(revision )
@@ -1,156 +1,0 @@
-from Globals import InitializeClass
-from Products.CPSSchemas.Widget import CPSWidgetType
-from Products.CPSSchemas.BasicWidgets import CPSStringWidget, CPSEmailWidget
-from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
-from Products.CPSSchemas.WidgetTypesTool import WidgetTypeRegistry
-from AccessControl import getSecurityManager
-
-from re import compile
-
-from zLOG import LOG, DEBUG
-
-class MyProjectWeekDateTimeWidget(CPSDateTimeWidget):
-    """ """
-    meta_type = "MyProject Week Date Time Widget"
-    
-    def validate(self, datastructure, **kw):
-        """Validate datastructure and update datamodel."""
-        
-        valid = CPSDateTimeWidget.validate(self, datastructure, **kw)
-        if not valid:
-            return 0
-        else:
-            widget_id = self.getWidgetId()
-            value = datastructure[widget_id]
-            err = 0
-            if value.dow() in (6, 0):
-                err = 'Cette date ne correspond pas à un jour de semaine'
-
-            if err:
-                datastructure.setError(widget_id, err)
-
-            return not err
-
-InitializeClass(MyProjectWeekDateTimeWidget)
-
-class MyProjectWeekDateTimeWidgetType(CPSWidgetType):
-    """MyProject Week DateTime widget type."""
-    meta_type = "MyProject Week Date Time Widget Type"
-    cls = MyProjectWeekDateTimeWidget
-
-InitializeClass(MyProjectWeekDateTimeWidgetType)
-
-class MyProjectRestrictedStringWidget(CPSStringWidget):
-    """ """
-    meta_type = "MyProject Restricted String Widget"
-    
-    def validate(self, datastructure, **kw):
-        """Validate datastructure and update datamodel."""
-        
-        valid = CPSStringWidget.validate(self, datastructure, **kw)
-        if not valid:
-            return 0
-        else:
-            widget_id = self.getWidgetId()
-            value = datastructure[widget_id]
-            err = 0
-            if not (len(value) == 5 and value.isupper() and value.isalpha()):
-                err = 'Cette chaîne ne correspond pas au format imposé'
-
-            if err:
-                datastructure.setError(widget_id, err)
-            else:
-                datamodel = datastructure.getDataModel()
-                datamodel[self.fields[0]] = value
-            
-            return not err
-
-InitializeClass(MyProjectRestrictedStringWidget)
-
-class MyProjectRestrictedStringWidgetType(CPSWidgetType):
-    """MyProject Restricted String widget type."""
-    meta_type = "MyProject Restricted String Widget Type"
-    cls = MyProjectRestrictedStringWidget
-
-InitializeClass(MyProjectRestrictedStringWidgetType)
-
-
-class MyProjectRestrictedEmailWidget(CPSEmailWidget):
-    """ """
-    meta_type = "MyProject Restricted Email Widget"
-
-    email_myproject_pat = compile(r"^([-\w_+])+\.([-\w_+])+@myproject\.fr$")
-
-    def validate(self, datastructure, **kw):
-        """Validate datastructure and update datamodel."""
-        
-        valid = CPSEmailWidget.validate(self, datastructure, **kw)
-        if not valid:
-            return 0
-        else:
-            widget_id = self.getWidgetId()
-            err, v = self._extractValue(datastructure[widget_id])
-            LOG('MyProject: MyProjectWidgets.py', DEBUG, "Valeur de v : %s" % v)
-            if not err and kw.get('layout_mode') != 'search' and \
-              v and not self.email_myproject_pat.match(v):
-                err = 'cpsschemas_err_email'
-
-            if err:
-                datastructure.setError(widget_id, err)
-            else:
-                datamodel = datastructure.getDataModel()
-                datamodel[self.fields[0]] = v
-            
-            return not err
-
-    def render(self, mode, datastructure, **kw):
-        """Render in mode from datastructure."""
-        return CPSStringWidget.render(self, mode, datastructure, **kw)
-
-InitializeClass(MyProjectRestrictedEmailWidget)
-
-class MyProjectRestrictedEmailWidgetType(CPSWidgetType):
-    """MyProject Restricted String widget type."""
-    meta_type = "MyProject Restricted Email Widget Type"
-    cls = MyProjectRestrictedEmailWidget
-
-InitializeClass(MyProjectRestrictedEmailWidgetType)
-
-class MyProjectVisitTitleWidget(CPSStringWidget):
-    """ """
-    meta_type = "MyProject Visit Title Widget"
-    
-    def validate(self, datastructure, **kw):
-        """Validate datastructure and update datamodel."""
-        
-        widget_id = self.getWidgetId()
-        err = 0
-        curr_date = DateTime()
-        date = "%d.%d.%d" % (curr_date.day(), curr_date.month(), curr_date.year())
-        user = getSecurityManager().getUser()
-        value = 'Demande de visite du %s par %s' % (date, 
-             self.portal_directories.members.getEntry(user.getId()).get('fullname'))
-        datamodel = datastructure.getDataModel()
-        datamodel[self.fields[0]] = value
-            
-        return not err
-
-    def render(self, mode, datastructure, **kw):
-        return ''
-
-InitializeClass(MyProjectVisitTitleWidget)
-
-class MyProjectVisitTitleWidgetType(CPSWidgetType):
-    """MyProject Visit Title widget type."""
-    meta_type = "MyProject Visit Title Widget Type"
-    cls = MyProjectVisitTitleWidget
-
-InitializeClass(MyProjectVisitTitleWidgetType)
-
-#####################################################################################
-
-WidgetTypeRegistry.register(MyProjectWeekDateTimeWidgetType)
-WidgetTypeRegistry.register(MyProjectRestrictedStringWidgetType)
-WidgetTypeRegistry.register(MyProjectRestrictedEmailWidgetType)
-WidgetTypeRegistry.register(MyProjectVisitTitleWidgetType)
-
Index: WAeUP_SRP/trunk/WAeUPTables.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTables.py	(revision 403)
+++ WAeUP_SRP/trunk/WAeUPTables.py	(revision 404)
@@ -61,10 +61,10 @@
         self.catalog_object(dict2ob(record_data), uid)
 
-class AccomodationTable(WAeUPTable):
+class AccommodationTable(WAeUPTable):
     
-    meta_type = 'WAeUP Accomodation Tool'
+    meta_type = 'WAeUP Accommodation Tool'
     
     def __init__(self):
-        WAeUPTable.__init__(self, 'portal_accomodation')
+        WAeUPTable.__init__(self, 'portal_accommodation')
 
     def addRecord(self, **data):
@@ -75,3 +75,3 @@
 
 
-InitializeClass(AccomodationTable)
+InitializeClass(AccommodationTable)
Index: WAeUP_SRP/trunk/exportimport.py
===================================================================
--- WAeUP_SRP/trunk/exportimport.py	(revision 403)
+++ WAeUP_SRP/trunk/exportimport.py	(revision 404)
@@ -56,5 +56,5 @@
     pm.setLocalGroupRoles(site,['role:Authenticated',],'SectionReader')
 
-    importObjects(site.portal_accomodation, '', context)
+    importObjects(site.portal_accommodation, '', context)
     
 ##    if hasattr(site,'campus'):
@@ -77,5 +77,5 @@
     _LOGGER_ID = 'waeup_table'
 
-    name = 'accomodation'
+    name = 'accommodation'
 
 # This the XMLAdapter itself. It encodes the im- / export logic that is specific
Index: WAeUP_SRP/trunk/profiles/default/accommodation.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/accommodation.xml	(revision 404)
+++ WAeUP_SRP/trunk/profiles/default/accommodation.xml	(revision 404)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<object name="portal_catalog" meta_type="CMF Catalog">
+ <column value="bed"/>
+ <column value="student"/>
+ <index name="bed" meta_type="FieldIndex">
+  <indexed_attr value="bed"/>
+ </index>
+ <index name="bed_type" meta_type="FieldIndex">
+  <indexed_attr value="bed_type"/>
+ </index>
+ <index name="student" meta_type="FieldIndex">
+  <indexed_attr value="student"/>
+ </index>
+</object>
Index: WAeUP_SRP/trunk/profiles/default/accomodation.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/accomodation.xml	(revision 403)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<?xml version="1.0"?>
-<object name="portal_catalog" meta_type="CMF Catalog">
- <column value="bed"/>
- <column value="student"/>
- <index name="bed" meta_type="FieldIndex">
-  <indexed_attr value="bed"/>
- </index>
- <index name="student" meta_type="FieldIndex">
-  <indexed_attr value="student"/>
- </index>
-</object>
Index: WAeUP_SRP/trunk/profiles/default/layouts/accommodation.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/accommodation.xml	(revision 403)
+++ WAeUP_SRP/trunk/profiles/default/layouts/accommodation.xml	(revision 404)
@@ -7,21 +7,4 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
- <widget name="beds_assigned" meta_type="Int Widget">
-  <property name="fields">
-   <element value="beds_assigned"/>
-  </property>
-  <property name="is_required">True</property>
-  <property name="label">Nr. of Assigned Beds</property>
-  <property name="label_edit">Nr. of Assigned Beds</property>
-  <property name="help">Number of beds already assigned to students</property>
- </widget>
- <widget name="beds_assigned_list" meta_type="Ordered List Widget">
-  <property name="fields">
-   <element value="beds_assigned_list"/>
-  </property>
-  <property name="label">Assigned Beds</property>
-  <property name="label_edit">Assigned Beds</property>
-  <property name="help">List of beds already assigned to students</property>
- </widget>
  <widget name="beds_for_final" meta_type="MultiSelect Widget">
   <property name="fields">
@@ -101,4 +84,17 @@
   <property name="vocabulary">range5</property>
  </widget>
+ <widget name="reserved_rooms" meta_type="String Widget">
+  <property name="title">Reserved Rooms</property>
+  <property name="fields">
+   <element value="reserved_rooms"/>
+  </property>
+  <property name="label">Reserved Rooms</property>
+  <property name="label_edit">Reserved Rooms</property>
+  <property
+     name="help">Enter the reserved room_nrs separeted by space.</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
  <widget name="rooms_per_floor" meta_type="Select Widget">
   <property name="fields">
@@ -162,4 +158,7 @@
    <cell name="beds_for_final"/>
   </row>
+  <row>
+   <cell name="reserved_rooms"/>
+  </row>
  </table>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/schemas/accommodation.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/accommodation.xml	(revision 403)
+++ WAeUP_SRP/trunk/profiles/default/schemas/accommodation.xml	(revision 404)
@@ -1,6 +1,4 @@
 <?xml version="1.0"?>
 <object name="accommodation" meta_type="CPS Schema">
- <field name="beds_assigned" meta_type="CPS Int Field"/>
- <field name="beds_assigned_list" meta_type="CPS String List Field"/>
  <field name="beds_for_final" meta_type="CPS String List Field"/>
  <field name="beds_for_fresh" meta_type="CPS String List Field"/>
@@ -12,4 +10,5 @@
  <field name="nr_of_blocks" meta_type="CPS Int Field"/>
  <field name="nr_of_floors" meta_type="CPS Int Field"/>
+ <field name="reserved_rooms" meta_type="CPS String List Field"/>
  <field name="rooms_per_floor" meta_type="CPS Int Field"/>
  <field name="study_courses" meta_type="CPS String List Field"/>
Index: WAeUP_SRP/trunk/profiles/default/toolset.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/toolset.xml	(revision 403)
+++ WAeUP_SRP/trunk/profiles/default/toolset.xml	(revision 404)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <tool-setup>
- <required tool_id="portal_accomodation"
-           class="Products.WAeUP_SRP.WAeUPTables.AccomodationTable"/>
+ <required tool_id="portal_accommodation"
+           class="Products.WAeUP_SRP.WAeUPTables.AccommodationTable"/>
 </tool-setup>
Index: WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml	(revision 403)
+++ WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml	(revision 404)
@@ -8,5 +8,5 @@
  <property name="product">WAeUP_SRP</property>
  <property name="factory">addAccoFolder</property>
- <property name="immediate_view">folder_view</property>
+ <property name="immediate_view">academics_contents</property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -22,7 +22,5 @@
   <element value="common"/>
  </property>
- <property name="layouts">
-  <element value="common"/>
- </property>
+ <property name="layouts"/>
  <property name="layout_clusters">
   <element value="metadata:metadata"/>
@@ -33,29 +31,28 @@
  <alias from="(Default)" to="temporary_view_all"/>
  <alias from="view" to="temporary_view_all"/>
- <action title="Standard View" action_id="view" category="object"
-    condition_expr="" url_expr="string:${object_url}/temporary_view_all"
-    visible="True">
+ <action title="View" action_id="view" category="object" condition_expr=""
+    url_expr="string:${object_url}/academics_contents" visible="True">
   <permission value="View"/>
  </action>
- <action title="Add Accommodation Hall" action_id="add_accommodation"
+ <action title="Add Accommodation Hall" action_id="new_entry"
     category="object" condition_expr=""
-    url_expr="string:${object_url}/add_accommodation" visible="True">
-  <permission value="University Manage"/>
+    url_expr="string:${object_url}/content_create?type_name=Accommodation"
+    visible="True">
+  <permission value="Modify portal content"/>
  </action>
  <action title="action_metadata" action_id="metadata" category="object"
-    condition_expr="python:member and 'Manager' in member.getRoles()"
-    url_expr="string:${object_url}/cpsdocument_metadata" visible="True">
-  <permission value="University Manage"/>
+    condition_expr="" url_expr="string:${object_url}/cpsdocument_metadata"
+    visible="True">
+  <permission value="Modify portal content"/>
  </action>
  <action title="action_edit" action_id="edit" category="object"
-    condition_expr="python:member and 'Manager' in member.getRoles()"
-    url_expr="string:${object_url}/cpsdocument_edit_form" visible="True">
+    condition_expr="" url_expr="string:${object_url}/cpsdocument_edit_form"
+    visible="True">
   <permission value="Modify portal content"/>
-  <permission value="University Manage"/>
  </action>
  <action title="Delegate" action_id="localroles" category="object"
     condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
     visible="False">
-  <permission value="University Manage"/>
+  <permission value="Modify portal content"/>
  </action>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/types/Accommodation.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/Accommodation.xml	(revision 403)
+++ WAeUP_SRP/trunk/profiles/default/types/Accommodation.xml	(revision 404)
@@ -8,5 +8,5 @@
  <property name="product">WAeUP_SRP</property>
  <property name="factory">addAccommodation</property>
- <property name="immediate_view">cpsdocument_view</property>
+ <property name="immediate_view">academics_contents</property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -30,20 +30,18 @@
  <property name="storage_methods"/>
  <property name="cps_is_portlet">False</property>
- <alias from="(Default)" to="temporary_view_all"/>
- <alias from="view" to="temporary_view_all"/>
- <action title="Standard View" action_id="view" category="object"
-    condition_expr="" url_expr="string:${object_url}/temporary_view_all"
-    visible="True">
+ <alias from="(Default)" to="academics_contents"/>
+ <alias from="view" to="academics_contents"/>
+ <action title="View" action_id="view" category="object" condition_expr=""
+    url_expr="string:${object_url}/academics_contents" visible="True">
   <permission value="View"/>
  </action>
  <action title="action_edit" action_id="edit" category="object"
-    condition_expr="" url_expr="string:${object_url}/waeup_edit_form"
+    condition_expr="" url_expr="string:${object_url}/cpsdocument_edit_form"
     visible="True">
-  <permission value="University Manage"/>
-  <permission value="Student Manage"/>
+  <permission value="Modify portal content"/>
  </action>
  <action title="action_metadata" action_id="metadata" category="object"
-    condition_expr="python:member and 'Manager' in member.getRoles()"
-    url_expr="string:${object_url}/cpsdocument_metadata" visible="True">
+    condition_expr="" url_expr="string:${object_url}/cpsdocument_metadata"
+    visible="True">
   <permission value="Modify portal content"/>
  </action>
@@ -51,5 +49,5 @@
     condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
     visible="False">
-  <permission value="University Manage"/>
+  <permission value="Modify portal content"/>
  </action>
 </object>
Index: WAeUP_SRP/trunk/skins/waeup_student/add_course_ticket.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/add_course_ticket.py	(revision 403)
+++ WAeUP_SRP/trunk/skins/waeup_student/add_course_ticket.py	(revision 404)
@@ -2,5 +2,5 @@
 # $Id$
 """
-book an accomodation
+add a course_ticket
 """
 type_name = 'CourseTicket'
Index: WAeUP_SRP/trunk/skins/waeup_student/book_accommodation.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/book_accommodation.py	(revision 403)
+++ WAeUP_SRP/trunk/skins/waeup_student/book_accommodation.py	(revision 404)
@@ -2,5 +2,5 @@
 # $Id$
 """
-book an accomodation
+book an accoMmodation
 """
 import DateTime
Index: WAeUP_SRP/trunk/skins/waeup_student/pay_hostel_fee.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/pay_hostel_fee.py	(revision 403)
+++ WAeUP_SRP/trunk/skins/waeup_student/pay_hostel_fee.py	(revision 404)
@@ -2,5 +2,5 @@
 # $Id$
 """
-book an accomodation
+book an accommodation
 """
 import DateTime
Index: WAeUP_SRP/trunk/tests/test_tables.py
===================================================================
--- WAeUP_SRP/trunk/tests/test_tables.py	(revision 403)
+++ WAeUP_SRP/trunk/tests/test_tables.py	(revision 404)
@@ -26,11 +26,11 @@
     def test_install(self):
         # Make sure the table got installed properly
-        patool = self.portal.portal_accomodation
-        self.failUnlessEqual(patool.meta_type, 'WAeUP Accomodation Tool')
+        patool = self.portal.portal_accommodation
+        self.failUnlessEqual(patool.meta_type, 'WAeUP Accommodation Tool')
         self.failUnlessEqual(patool.schema(), ['bed', 'student'])
         self.failUnlessEqual(patool.indexes(), ['bed', 'student'])
         
     def test_add_change_delete(self):
-        patool = self.portal.portal_accomodation
+        patool = self.portal.portal_accommodation
         
         # Add
