source: WAeUP_SRP/trunk/skins/waeup_default/getReviewInfo.py @ 1187

Last change on this file since 1187 was 1187, checked in by joachim, 18 years ago

optimized version of portlet_waeup_status_display

  • Property svn:keywords set to Id
File size: 810 bytes
Line 
1## Script (Python) "getStudentReviewState"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None, with_items=None
8##title=
9##
10# $Id: getReviewInfo.py 1187 2007-01-03 18:17:30Z joachim $
11"""
12return Info about the current Student
13"""
14ptool = context.portal_proxies
15wf_vars = ['review_state']
16docid = context.getDocid()
17if docid:
18    proxies_info = ptool.getProxyInfosFromDocid(docid,
19                                                workflow_vars=wf_vars)
20    d_review = proxies_info[0]['review_state']
21if context.portal_type != "Student":
22    student_id = context.getStudentId()
23    res = context.portal_catalog(id = student_id,portal_type='Student')
24    if res:
25        s_review = res[-1].review_state
26    return "%s / %s" % (s_review,d_review)
27return "%s" % (d_review)
28
Note: See TracBrowser for help on using the repository browser.