source: WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py @ 1388

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

payed -> paid
action added
action icon added

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1## Script (Python) "getPaymentsInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: getPaymentsFolderInfo.py 1338 2007-01-21 13:52:05Z henrik $
11"""
12Info for the PaymentsFolder
13"""
14import logging
15logger = logging.getLogger('EPayment.')
16import DateTime
17request = context.REQUEST
18students = context.portal_url.getPortalObject().campus.students
19
20student_id = context.getStudentId()
21if student_id is None:
22    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
23#student = getattr(students,student_id)
24s_brain = context.students_catalog(id = student_id)[0]
25payments = []
26#from Products.zdb import set_trace;set_trace()
27for o_id in context.objectIds():
28    d = {}
29    d['id'] = o_id
30    res = context.portal_catalog(id=o_id)
31    if res:
32        title = res[0].Title
33        d['title'] = title or o_id
34    else:
35        d['title'] = "no Title"
36    payments.append(d)
37info = {}
38is_so = info['is_so'] = context.isSectionOfficer()
39info['student_name'] = s_brain.name
40info['payments'] = payments
41return info
Note: See TracBrowser for help on using the repository browser.