Changeset 1447 for WAeUP_SRP


Ignore:
Timestamp:
20 Feb 2007, 13:41:26 (18 years ago)
Author:
joachim
Message:

new function fixReservedBeds:
walks through all reserved beds
if the bed is allocated to a student:

if the student has an accommodation object:

if not the same as the reserved bed:

deallocate bed.


Location:
WAeUP_SRP/trunk/skins/waeup_accommodation
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/acco_folder_view.pt

    r1441 r1447  
    4848                     />
    4949            </td>
    50             <td><a href="view" tal:attributes="href string:/${row/url}">
     50            <td><a href="view" tal:attributes="href row/url">
    5151              <strong tal:content="row/title" /></a> </td>
    5252            <td tal:content="row/id"> </td>
  • WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py

    r1446 r1447  
    118118    if acco_id in student_obj.objectIds():
    119119        acco_doc = getattr(student_obj, acco_id).getContent()
    120         acco_doc.edit(mapping={'bed':bid + " (reservation cancelled by %s!)" % member})
     120        if acco_doc.bed == bid:
     121            acco_doc.edit(mapping={'bed':bid + " (reservation cancelled by %s!)" % member})
    121122    logger.info('"%s","cancelled reservation %s by","%s"' % (member,bid,sid))
    122123    psm = "%s removed from %s" % (student.name,bid)
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py

    r1441 r1447  
    1010# $Id$
    1111"""
    12 return Info about the Faculties
     12return Info about the Accommodation-Folder
    1313"""
    1414request = context.REQUEST
     
    2929    row['id'] = f.id
    3030    row['title'] = f.Title
    31     row['url'] = f.relative_path
     31    row['url'] = "%s/%s" % (context.absolute_url(),f.id)
    3232    #fo = f.getObject()
    3333    #row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallBeds.py

    r1393 r1447  
    1 ##parameters=key=None 
     1##parameters=key=None,doc=None
    22# $Id$
    33"""
     
    55
    66"""
    7 doc = context.getContent()
     7if doc is None:
     8    doc = context.getContent()
    89if key is None:
    910    return [(l,l) for l in 'ABCDEFGH'[:doc.beds_per_room]]
  • WAeUP_SRP/trunk/skins/waeup_accommodation/reservedRoomsVoc.py

    r1446 r1447  
    1 ##parameters=key=None
     1##parameters=key=None,doc=None
    22# $Id$
    33"""
     
    55
    66"""
    7 doc = context.getContent()
    8 voc = [("_".join((r.split('/')[0],r.split('/')[1])),r)
    9                       for r in doc.reserved_rooms.replace(' ','').split(',') if r]
     7if doc is None:
     8    doc = context.getContent()
     9voc = [("_".join((r.split('/')[0].strip(),r.split('/')[1].strip())),r)
     10                      for r in doc.reserved_rooms.split(',') if r]
    1011#from Products.zdb import set_trace;set_trace()
    1112if not key:
Note: See TracChangeset for help on using the changeset viewer.