Changeset 404 for WAeUP_SRP/trunk
- Timestamp:
- 22 Aug 2006, 21:45:50 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 deleted
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Accommodation.py
r200 r404 10 10 from Products.CPSDocument.CPSDocument import CPSDocument 11 11 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 12 from Products.WAeUP_SRP.WAeUPTables import AccommodationTable 12 13 13 14 class AccoFolder(CPSDocument): ###( … … 19 20 security = ClassSecurityInfo() 20 21 22 security.declareProtected(ModifyPortalContent,"generateFreeBedsList") ###( 23 def generateFreeBedsList(self): 24 """ 25 generate the free Bedslist. 26 """ 27 freelist = AccommodationTable() 28 l = self.portal_catalog({'meta_type': "Accommodation"}) 29 halls = [] 30 for h in l: 31 halls.append(h.getObject()) 32 for hall in halls: 33 h = hall.getContent() 34 for block in range(1,int(h.nr_of_blocks)): 35 for floor in range(1,int(h.nr_of_floors)): 36 for room in range(1,int(h.rooms_per_floor)): 37 for bed in 'ABCDEFGH'[:int(h.beds_per_room)]: 38 room_nr = floor*100 + room 39 freelist.addRecord(bed = '%s_%d_%s' % (h.getId(),room_nr,bed), 40 bed_type = "test") 41 42 ###) 21 43 22 44 InitializeClass(AccoFolder) … … 28 50 ###) 29 51 30 31 52 class Accommodation(CPSDocument): ###( 32 53 """ … … 37 58 security = ClassSecurityInfo() 38 59 39 security.declareProtected(View,"Title") 60 security.declareProtected(View,"Title") ###( 40 61 def Title(self): 41 62 """compose title""" … … 45 66 return self.title 46 67 return heading 47 68 69 ###) 70 71 72 73 48 74 InitializeClass(Accommodation) 49 75 -
WAeUP_SRP/trunk/WAeUPTables.py
r363 r404 61 61 self.catalog_object(dict2ob(record_data), uid) 62 62 63 class Accom odationTable(WAeUPTable):63 class AccommodationTable(WAeUPTable): 64 64 65 meta_type = 'WAeUP Accom odation Tool'65 meta_type = 'WAeUP Accommodation Tool' 66 66 67 67 def __init__(self): 68 WAeUPTable.__init__(self, 'portal_accom odation')68 WAeUPTable.__init__(self, 'portal_accommodation') 69 69 70 70 def addRecord(self, **data): … … 75 75 76 76 77 InitializeClass(Accom odationTable)77 InitializeClass(AccommodationTable) -
WAeUP_SRP/trunk/exportimport.py
r363 r404 56 56 pm.setLocalGroupRoles(site,['role:Authenticated',],'SectionReader') 57 57 58 importObjects(site.portal_accom odation, '', context)58 importObjects(site.portal_accommodation, '', context) 59 59 60 60 ## if hasattr(site,'campus'): … … 77 77 _LOGGER_ID = 'waeup_table' 78 78 79 name = 'accom odation'79 name = 'accommodation' 80 80 81 81 # This the XMLAdapter itself. It encodes the im- / export logic that is specific -
WAeUP_SRP/trunk/profiles/default/accommodation.xml
r397 r404 6 6 <indexed_attr value="bed"/> 7 7 </index> 8 <index name="bed_type" meta_type="FieldIndex"> 9 <indexed_attr value="bed_type"/> 10 </index> 8 11 <index name="student" meta_type="FieldIndex"> 9 12 <indexed_attr value="student"/> -
WAeUP_SRP/trunk/profiles/default/layouts/accommodation.xml
r218 r404 7 7 <property name="flexible_widgets"/> 8 8 <property name="validate_values_expr"></property> 9 <widget name="beds_assigned" meta_type="Int Widget">10 <property name="fields">11 <element value="beds_assigned"/>12 </property>13 <property name="is_required">True</property>14 <property name="label">Nr. of Assigned Beds</property>15 <property name="label_edit">Nr. of Assigned Beds</property>16 <property name="help">Number of beds already assigned to students</property>17 </widget>18 <widget name="beds_assigned_list" meta_type="Ordered List Widget">19 <property name="fields">20 <element value="beds_assigned_list"/>21 </property>22 <property name="label">Assigned Beds</property>23 <property name="label_edit">Assigned Beds</property>24 <property name="help">List of beds already assigned to students</property>25 </widget>26 9 <widget name="beds_for_final" meta_type="MultiSelect Widget"> 27 10 <property name="fields"> … … 101 84 <property name="vocabulary">range5</property> 102 85 </widget> 86 <widget name="reserved_rooms" meta_type="String Widget"> 87 <property name="title">Reserved Rooms</property> 88 <property name="fields"> 89 <element value="reserved_rooms"/> 90 </property> 91 <property name="label">Reserved Rooms</property> 92 <property name="label_edit">Reserved Rooms</property> 93 <property 94 name="help">Enter the reserved room_nrs separeted by space.</property> 95 <property name="readonly_layout_modes"/> 96 <property name="hidden_layout_modes"/> 97 <property name="hidden_readonly_layout_modes"/> 98 </widget> 103 99 <widget name="rooms_per_floor" meta_type="Select Widget"> 104 100 <property name="fields"> … … 162 158 <cell name="beds_for_final"/> 163 159 </row> 160 <row> 161 <cell name="reserved_rooms"/> 162 </row> 164 163 </table> 165 164 </object> -
WAeUP_SRP/trunk/profiles/default/schemas/accommodation.xml
r205 r404 1 1 <?xml version="1.0"?> 2 2 <object name="accommodation" meta_type="CPS Schema"> 3 <field name="beds_assigned" meta_type="CPS Int Field"/>4 <field name="beds_assigned_list" meta_type="CPS String List Field"/>5 3 <field name="beds_for_final" meta_type="CPS String List Field"/> 6 4 <field name="beds_for_fresh" meta_type="CPS String List Field"/> … … 12 10 <field name="nr_of_blocks" meta_type="CPS Int Field"/> 13 11 <field name="nr_of_floors" meta_type="CPS Int Field"/> 12 <field name="reserved_rooms" meta_type="CPS String List Field"/> 14 13 <field name="rooms_per_floor" meta_type="CPS Int Field"/> 15 14 <field name="study_courses" meta_type="CPS String List Field"/> -
WAeUP_SRP/trunk/profiles/default/toolset.xml
r363 r404 1 1 <?xml version="1.0"?> 2 2 <tool-setup> 3 <required tool_id="portal_accom odation"4 class="Products.WAeUP_SRP.WAeUPTables.Accom odationTable"/>3 <required tool_id="portal_accommodation" 4 class="Products.WAeUP_SRP.WAeUPTables.AccommodationTable"/> 5 5 </tool-setup> -
WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml
r332 r404 8 8 <property name="product">WAeUP_SRP</property> 9 9 <property name="factory">addAccoFolder</property> 10 <property name="immediate_view"> folder_view</property>10 <property name="immediate_view">academics_contents</property> 11 11 <property name="global_allow">True</property> 12 12 <property name="filter_content_types">True</property> … … 22 22 <element value="common"/> 23 23 </property> 24 <property name="layouts"> 25 <element value="common"/> 26 </property> 24 <property name="layouts"/> 27 25 <property name="layout_clusters"> 28 26 <element value="metadata:metadata"/> … … 33 31 <alias from="(Default)" to="temporary_view_all"/> 34 32 <alias from="view" to="temporary_view_all"/> 35 <action title="Standard View" action_id="view" category="object" 36 condition_expr="" url_expr="string:${object_url}/temporary_view_all" 37 visible="True"> 33 <action title="View" action_id="view" category="object" condition_expr="" 34 url_expr="string:${object_url}/academics_contents" visible="True"> 38 35 <permission value="View"/> 39 36 </action> 40 <action title="Add Accommodation Hall" action_id=" add_accommodation"37 <action title="Add Accommodation Hall" action_id="new_entry" 41 38 category="object" condition_expr="" 42 url_expr="string:${object_url}/add_accommodation" visible="True"> 43 <permission value="University Manage"/> 39 url_expr="string:${object_url}/content_create?type_name=Accommodation" 40 visible="True"> 41 <permission value="Modify portal content"/> 44 42 </action> 45 43 <action title="action_metadata" action_id="metadata" category="object" 46 condition_expr=" python:member and 'Manager' in member.getRoles()"47 url_expr="string:${object_url}/cpsdocument_metadata"visible="True">48 <permission value=" University Manage"/>44 condition_expr="" url_expr="string:${object_url}/cpsdocument_metadata" 45 visible="True"> 46 <permission value="Modify portal content"/> 49 47 </action> 50 48 <action title="action_edit" action_id="edit" category="object" 51 condition_expr=" python:member and 'Manager' in member.getRoles()"52 url_expr="string:${object_url}/cpsdocument_edit_form"visible="True">49 condition_expr="" url_expr="string:${object_url}/cpsdocument_edit_form" 50 visible="True"> 53 51 <permission value="Modify portal content"/> 54 <permission value="University Manage"/>55 52 </action> 56 53 <action title="Delegate" action_id="localroles" category="object" 57 54 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 58 55 visible="False"> 59 <permission value=" University Manage"/>56 <permission value="Modify portal content"/> 60 57 </action> 61 58 </object> -
WAeUP_SRP/trunk/profiles/default/types/Accommodation.xml
r319 r404 8 8 <property name="product">WAeUP_SRP</property> 9 9 <property name="factory">addAccommodation</property> 10 <property name="immediate_view"> cpsdocument_view</property>10 <property name="immediate_view">academics_contents</property> 11 11 <property name="global_allow">True</property> 12 12 <property name="filter_content_types">True</property> … … 30 30 <property name="storage_methods"/> 31 31 <property name="cps_is_portlet">False</property> 32 <alias from="(Default)" to="temporary_view_all"/> 33 <alias from="view" to="temporary_view_all"/> 34 <action title="Standard View" action_id="view" category="object" 35 condition_expr="" url_expr="string:${object_url}/temporary_view_all" 36 visible="True"> 32 <alias from="(Default)" to="academics_contents"/> 33 <alias from="view" to="academics_contents"/> 34 <action title="View" action_id="view" category="object" condition_expr="" 35 url_expr="string:${object_url}/academics_contents" visible="True"> 37 36 <permission value="View"/> 38 37 </action> 39 38 <action title="action_edit" action_id="edit" category="object" 40 condition_expr="" url_expr="string:${object_url}/ waeup_edit_form"39 condition_expr="" url_expr="string:${object_url}/cpsdocument_edit_form" 41 40 visible="True"> 42 <permission value="University Manage"/> 43 <permission value="Student Manage"/> 41 <permission value="Modify portal content"/> 44 42 </action> 45 43 <action title="action_metadata" action_id="metadata" category="object" 46 condition_expr=" python:member and 'Manager' in member.getRoles()"47 url_expr="string:${object_url}/cpsdocument_metadata"visible="True">44 condition_expr="" url_expr="string:${object_url}/cpsdocument_metadata" 45 visible="True"> 48 46 <permission value="Modify portal content"/> 49 47 </action> … … 51 49 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 52 50 visible="False"> 53 <permission value=" University Manage"/>51 <permission value="Modify portal content"/> 54 52 </action> 55 53 </object> -
WAeUP_SRP/trunk/skins/waeup_student/add_course_ticket.py
r164 r404 2 2 # $Id$ 3 3 """ 4 book an accomodation 4 add a course_ticket 5 5 """ 6 6 type_name = 'CourseTicket' -
WAeUP_SRP/trunk/skins/waeup_student/book_accommodation.py
r166 r404 2 2 # $Id$ 3 3 """ 4 book an acco modation4 book an accoMmodation 5 5 """ 6 6 import DateTime -
WAeUP_SRP/trunk/skins/waeup_student/pay_hostel_fee.py
r166 r404 2 2 # $Id$ 3 3 """ 4 book an accom odation4 book an accommodation 5 5 """ 6 6 import DateTime -
WAeUP_SRP/trunk/tests/test_tables.py
r363 r404 26 26 def test_install(self): 27 27 # Make sure the table got installed properly 28 patool = self.portal.portal_accom odation29 self.failUnlessEqual(patool.meta_type, 'WAeUP Accom odation Tool')28 patool = self.portal.portal_accommodation 29 self.failUnlessEqual(patool.meta_type, 'WAeUP Accommodation Tool') 30 30 self.failUnlessEqual(patool.schema(), ['bed', 'student']) 31 31 self.failUnlessEqual(patool.indexes(), ['bed', 'student']) 32 32 33 33 def test_add_change_delete(self): 34 patool = self.portal.portal_accom odation34 patool = self.portal.portal_accommodation 35 35 36 36 # Add
Note: See TracChangeset for help on using the changeset viewer.