Changeset 926 for WAeUP_SRP/trunk


Ignore:
Timestamp:
23 Nov 2006, 11:54:49 (18 years ago)
Author:
joachim
Message:

add special handling code to hostels
use letters for blocks

Location:
WAeUP_SRP/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Accommodation.py

    r714 r926  
    4949            hall_gen['name'] = hall.Title
    5050            count = 0
    51             reserved = [(int(r.split('/')[0]),int(r.split('/')[1])) for r in re.split(',|\.| ',h.reserved_rooms)
     51            reserved = [(r.split('/')[0],int(r.split('/')[1])) for r in re.split(',|\.| ',h.reserved_rooms)
    5252                                     if r]
    5353            sex = 'male'
    5454            if h.which_sex:
    5555                sex = 'female'
    56             for block in range(1,int(h.nr_of_blocks)+1):
     56            #for block in range(1,int(h.nr_of_blocks)+1):
     57            for block in 'ABCDEFGHIJ'[:int(h.nr_of_blocks)]:
    5758                for floor in range(1,int(h.nr_of_floors)+1):
    5859                    for room in range(1,int(h.rooms_per_floor)+1):
     
    6263                            if (block,room_nr) in reserved:
    6364                                bt = "reserved"
     65                            elif h.special_handling != "no":
     66                                bt = h.special_handling
    6467                            elif bed in h.beds_for_fresh:
    6568                                bt = 'fr'
     
    6972                                bt = 'fi'
    7073                            bt = "%(sex)s_%(bt)s" % vars()
    71                             uid = '%s_%d_%d_%s' % (hall.getId(),block,room_nr,bed)
     74                            uid = '%s_%s_%d_%s' % (hall.getId(),block,room_nr,bed)
    7275                            try:
    7376                                freelist.addRecord(bed = uid, bed_type = bt,hall = hall.getId())
  • WAeUP_SRP/trunk/Widgets.py

    r912 r926  
    189189            err = 0
    190190            try:
    191                 reserved = [(int(r.split('/')[0]),int(r.split('/')[1])) for r in re.split(',|\.| ',value)
     191                reserved = [(r.split('/')[0],int(r.split('/')[1])) for r in re.split(',|\.| ',value)
    192192                                     if r]
    193193            except ValueError,msg:
  • WAeUP_SRP/trunk/exportimport.py

    r924 r926  
    7575    pm = site.portal_membership
    7676    campus = site.portal_url.getPortalObject().campus
     77    campus.academics.manage_setLocalGroupRoles(groupid='Authenticated',
     78                                         roles=('SectionReader',))
    7779    pm.setLocalGroupRoles(campus.students,['group:ClearanceOfficers',
    7880                                           'role:Student',],'SectionReader')
    79     pm.setLocalGroupRoles(campus.academics,['role:Authenticated',
    80                                            ],'SectionReader')
     81##    pm.setLocalGroupRoles(campus.academics,['role:Authenticated',
     82##                                           ],'SectionReader')
    8183    importWAeUPTable(site.portal_accommodation, '', context,'accommodation')
    8284    importWAeUPTable(site.portal_pins, '', context,'pins')
  • WAeUP_SRP/trunk/profiles/default/layouts/acco_hall.xml

    r853 r926  
    124124  <property name="label_true">female</property>
    125125 </widget>
     126<widget name="special_handling" meta_type="Select Widget">
     127 <property name="title">Maintenance Fee Prefix</property>
     128 <property name="fields">
     129  <element value="special_handling"/>
     130 </property>
     131 <property name="is_required">False</property>
     132 <property name="label">Special Handling Code</property>
     133 <property name="label_edit">Special Handling Code</property>
     134 <property name="readonly_layout_modes"/>
     135 <property name="hidden_layout_modes"/>
     136 <property name="hidden_readonly_layout_modes"/>
     137<property name="vocabulary">acco_special_handling</property>
     138</widget>
    126139<widget name="maintenance_code" meta_type="Select Widget">
    127140 <property name="title">Maintenance Fee Prefix</property>
     
    143156  <row>
    144157   <cell name="maintenance_code"/>
     158  </row>
     159  <row>
     160   <cell name="special_handling"/>
    145161  </row>
    146162  <row>
  • WAeUP_SRP/trunk/profiles/default/schemas/acco_hall.xml

    r744 r926  
    1414  </field>
    1515 <field name="reserved_rooms" meta_type="CPS String List Field">
    16     <property name="default_expr">string:1/101,2/102</property>
     16    <property name="default_expr">string:A/101,C/102</property>
    1717  </field>
    1818  <field name="rooms_per_floor" meta_type="CPS Int Field">
    1919    <property name="default_expr">python:20</property>
    2020  </field>
    21  <field name="study_courses" meta_type="CPS String List Field"/>
     21 <field name="special_handling" meta_type="CPS String Field"/>
    2222 <field name="text" meta_type="CPS String Field">
    2323  <property name="is_searchabletext">False</property>
  • WAeUP_SRP/trunk/profiles/default/vocabularies.xml

    r874 r926  
    2323 <object name="searchable_student_states" meta_type="CPS Vocabulary"/>
    2424 <object name="get_searchable_student_states" meta_type="CPS Method Vocabulary"/>
     25 <object name="acco_special_handling" meta_type="CPS Vocabulary"/>
    2526 <object name="academics_search_mode" meta_type="CPS Vocabulary"/>
    2627 <object name="searchable_academics_states" meta_type="CPS Vocabulary"/>
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getBedTypeNames.py

    r805 r926  
    1010# $Id$
    1111
    12 return {'female_fr': 'Female New Student',
    13              'female_fi': 'Female Final Student',
    14              'female_re': 'Female Returning Student',
    15              'female_reserved': 'Female Reserved',
    16              'female_xx': 'Female Other',
    17              'male_fr': 'Male New Student',
    18              'male_fi': 'Male Final Student',
    19              'male_re': 'Male Returning Student',
    20              'male_reserved': 'Male Reserved',
    21              'male_xx': 'Male Other'
    22              }
     12type_suffixes = [('fr','New Student'),
     13                 ('fi','Final Student'),
     14                 ('re','Returning Student'),
     15                 ('reserved','Reserved'),
     16                 ]
     17special = [item for item in context.portal_vocabularies.acco_special_handling.items()
     18                            if item[0] != 'no']
     19type_suffixes.extend(special)
     20dict = {}
     21for gender in ('female','male'):
     22    for suffix,desc in type_suffixes:
     23        dict['%s_%s' % (gender,suffix)] = '%s %s' % (gender.capitalize(),desc)
     24return dict
     25##return {'female_fr': 'Female New Student',
     26##             'female_fi': 'Female Final Student',
     27##             'female_re': 'Female Returning Student',
     28##             'female_reserved': 'Female Reserved',
     29##             'female_xx': 'Female Other',
     30##             'male_fr': 'Male New Student',
     31##             'male_fi': 'Male Final Student',
     32##             'male_re': 'Male Returning Student',
     33##             'male_reserved': 'Male Reserved',
     34##             'male_xx': 'Male Other'
     35##             }
Note: See TracChangeset for help on using the changeset viewer.