source: WAeUP_SRP/base/skins/waeup_default/getDocumentInfo.py @ 3489

Last change on this file since 3489 was 3473, checked in by joachim, 17 years ago

remove Title from all StudentObjects?,
adjust templates to use getStudentObjectitles,
remove waeup_academics.getDocumentInfo (was duplicate),
do not use portal_catalog for listing faculties and departments.

File size: 929 bytes
Line 
1## Script (Python) "getDocumentInfo"
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:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $
11"""
12return Info about a document
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20request = context.REQUEST
21
22#wf = context.portal_workflow
23#path_info = request.get('PATH_INFO').split('/')
24
25# mtool = context.portal_membership
26# if mtool.isAnonymousUser():
27#     return None
28
29info = context.waeup_tool.getAccessInfo(context)
30#set_trace()
31
32student_id = info['student_id']
33if not info['is_staff'] and student_id is None:
34    return None
35
36titles = context.getStudentObjectTitles()
37info['title'] = titles.get(context.portal_type,'') or context.title_or_id
38try:
39    info['doc'] = context.getContent()
40except:
41    return None
42return info
43
Note: See TracBrowser for help on using the repository browser.