source: WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py @ 1959

Last change on this file since 1959 was 1447, checked in by joachim, 18 years ago

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.


  • Property svn:keywords set to Id
File size: 981 bytes
RevLine 
[845]1## Script (Python) "getAccoFolderInfo"
[622]2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None
8##title=
9##
[805]10# $Id: getAccoFolderInfo.py 1447 2007-02-20 13:41:26Z joachim $
[622]11"""
[1447]12return Info about the Accommodation-Folder
[622]13"""
14request = context.REQUEST
15
16wf = context.portal_workflow
17mtool = context.portal_membership
18path_info = request.get('PATH_INFO').split('/')
19
20info = {}
[635]21info['action'] = "%s" % context.absolute_url()
[622]22info['choosen_ids'] = request.get('ids',[])
23items = []
[1441]24is_editable = mtool.checkPermission('Modify portal content', context)
25is_editable = False
[622]26halls = context.portal_catalog(portal_type='AccoHall')
27for f in halls:
28    row = {}
[1441]29    row['id'] = f.id
30    row['title'] = f.Title
[1447]31    row['url'] = "%s/%s" % (context.absolute_url(),f.id)
[1441]32    #fo = f.getObject()
33    #row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
34    row['is_editable'] = is_editable
[622]35    items.append(row)
36info['items'] = items
[1439]37return info
[626]38
Note: See TracBrowser for help on using the repository browser.