Last change
on this file since 1308 was
1283,
checked in by joachim, 18 years ago
|
pay_by_sc ready for testing
|
-
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 1283 2007-01-12 13:14:45Z 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 = [] |
---|
[1283] | 26 | #from Products.zdb import set_trace;set_trace() |
---|
[1238] | 27 | for 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) |
---|
| 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.