source: WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py @ 880

Last change on this file since 880 was 845, checked in by Henrik Bettermann, 18 years ago

script names corrected

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