Last change
on this file since 1257 was
1238,
checked in by joachim, 18 years ago
|
more payments things
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1238] | 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 1238 2007-01-08 13:45:24Z joachim $ |
---|
| 11 | """ |
---|
| 12 | Info for the PaymentsFolder |
---|
| 13 | """ |
---|
| 14 | import logging |
---|
| 15 | logger = logging.getLogger('EPayment.') |
---|
| 16 | import DateTime |
---|
| 17 | request = context.REQUEST |
---|
| 18 | students = context.portal_url.getPortalObject().campus.students |
---|
| 19 | |
---|
| 20 | student_id = context.getStudentId() |
---|
| 21 | if student_id is None: |
---|
| 22 | return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
| 23 | #student = getattr(students,student_id) |
---|
| 24 | s_brain = context.students_catalog(id = student_id)[0] |
---|
| 25 | payments = [] |
---|
| 26 | for o_id in context.objectIds(): |
---|
| 27 | d = {} |
---|
| 28 | d['id'] = o_id |
---|
| 29 | res = context.portal_catalog(id=o_id) |
---|
| 30 | if res: |
---|
| 31 | title = res[0].Title |
---|
| 32 | d['title'] = title or o_id |
---|
| 33 | else: |
---|
| 34 | d['title'] = "no Title" |
---|
| 35 | payments.append(d) |
---|
| 36 | #from Products.zdb import set_trace;set_trace() |
---|
| 37 | info = {} |
---|
| 38 | is_so = info['is_so'] = context.isSectionOfficer() |
---|
| 39 | info['student_name'] = s_brain.name |
---|
| 40 | info['payments'] = payments |
---|
| 41 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.