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

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