source: WAeUP_SRP/base/skins/waeup_accommodation/getAccoFolderInfo.py @ 2687

Last change on this file since 2687 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
Line 
1## Script (Python) "getAccoFolderInfo"
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##
10# $Id: getAccoFolderInfo.py 1447 2007-02-20 13:41:26Z joachim $
11"""
12return Info about the Accommodation-Folder
13"""
14request = context.REQUEST
15
16wf = context.portal_workflow
17mtool = context.portal_membership
18path_info = request.get('PATH_INFO').split('/')
19
20info = {}
21info['action'] = "%s" % context.absolute_url()
22info['choosen_ids'] = request.get('ids',[])
23items = []
24is_editable = mtool.checkPermission('Modify portal content', context)
25is_editable = False
26halls = context.portal_catalog(portal_type='AccoHall')
27for f in halls:
28    row = {}
29    row['id'] = f.id
30    row['title'] = f.Title
31    row['url'] = "%s/%s" % (context.absolute_url(),f.id)
32    #fo = f.getObject()
33    #row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
34    row['is_editable'] = is_editable
35    items.append(row)
36info['items'] = items
37return info
38
Note: See TracBrowser for help on using the repository browser.