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

Last change on this file since 4078 was 2845, checked in by joachim, 17 years ago

add sort_id, additional fields in payment

  • Property svn:keywords set to Id
File size: 1.2 KB
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 2845 2007-12-03 21:14:20Z joachim $
11"""
12return Info about the Accommodation-Folder
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19request = context.REQUEST
20
21wf = context.portal_workflow
22mtool = context.portal_membership
23path_info = request.get('PATH_INFO').split('/')
24
25info = {}
26info['action'] = "%s" % context.absolute_url()
27info['choosen_ids'] = request.get('ids',[])
28items = []
29is_editable = mtool.checkPermission('Modify portal content', context)
30#is_editable = False
31#halls = context.portal_catalog(portal_type='AccoHall')
32for id,hall in context.objectItems():
33    hall_doc = hall.getContent()
34    row = {}
35    row['id'] = id
36    row['title'] = hall_doc.Title()
37    row['sort_id'] = getattr(hall_doc,'sort_id',0)
38    row['url'] = "%s/%s" % (context.absolute_url(),id)
39    #fo = f.getObject()
40    #row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
41    row['is_editable'] = is_editable
42    items.append(row)
43items.sort(cmp=lambda x,y: cmp( x['sort_id'],y['sort_id']))
44info['items'] = items
45return info
46
Note: See TracBrowser for help on using the repository browser.