Last change
on this file since 811 was
805,
checked in by joachim, 18 years ago
|
propset Id
|
-
Property svn:keywords set to
Id
|
File size:
913 bytes
|
Line | |
---|
1 | ## Script (Python) "cpsdocument_edit" |
---|
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: getCertificateInfo.py 805 2006-11-09 09:38:29Z joachim $ |
---|
11 | """ |
---|
12 | return Info about a Certificate |
---|
13 | """ |
---|
14 | request = context.REQUEST |
---|
15 | |
---|
16 | wf = context.portal_workflow |
---|
17 | path_info = request.get('PATH_INFO').split('/') |
---|
18 | |
---|
19 | info = {} |
---|
20 | info['is_manager'] = context.isManager() |
---|
21 | info['is_student'] = context.isStudent() |
---|
22 | info['action'] = "%s" % context.campus.absolute_url() |
---|
23 | info['choosen_ids'] = request.get('ids',[]) |
---|
24 | info['doc'] = context.getContent() |
---|
25 | items = [] |
---|
26 | levels = context.objectValues() |
---|
27 | for l in levels: |
---|
28 | row = {} |
---|
29 | ld = l.getContent() |
---|
30 | row['id'] = l.getId() |
---|
31 | if hasattr(ld,'Title'): |
---|
32 | row['title'] = ld.Title() |
---|
33 | else: |
---|
34 | row['title'] = getattr(ld,'title','no title') |
---|
35 | row['url'] = l.absolute_url() |
---|
36 | items.append(row) |
---|
37 | info['items'] = items |
---|
38 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.