source: WAeUP_SRP/branches/joachim-azax-branch/skins/waeup_academics/getDepartmentsInfo.py

Last change on this file was 1988, checked in by joachim, 17 years ago

merged r1979:r1987 from trunk

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1## Script (Python) "getDepartmentsInfo"
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: getDepartmentsInfo.py 1988 2007-07-05 11:14:12Z joachim $
11"""
12return Info about the Faculties
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
23member = mtool.getAuthenticatedMember()
24#path_info = request.get('PATH_INFO').split('/')
25
26info = {}
27member_id = str(member)
28roles = member.getRolesInContext(context)
29info['action'] = "%s" % context.absolute_url()
30info['choosen_ids'] = request.get('ids',[])
31items = []
32info['doc'] = context.getContent()
33# set_trace()
34# brain = context.portal_catalog(portal_type="Faculty", id = context.getId())[-1]
35# cp = brain.getPath()
36cp = request.get('PATH_INFO')
37info['container_path'] = cp
38res = context.portal_catalog(container_path=cp)
39for r in res:
40    row = {}
41    ro = r.getObject()
42    rd = ro.getContent()
43    row['id'] = r.getId
44    row['title'] = rd.LongTitle()
45    row['url'] = ro.absolute_url()
46    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
47    items.append(row)
48info['items'] = items
49return info
Note: See TracBrowser for help on using the repository browser.