- Timestamp:
- 16 Feb 2007, 12:39:56 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py
r1338 r1427 13 13 """ 14 14 import logging 15 logger = logging.getLogger('EPayment. ')15 logger = logging.getLogger('EPayment.Info') 16 16 import DateTime 17 17 request = context.REQUEST … … 23 23 #student = getattr(students,student_id) 24 24 s_brain = context.students_catalog(id = student_id)[0] 25 25 26 payments = [] 26 27 #from Products.zdb import set_trace;set_trace() 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) 28 37 29 info = {} 38 30 is_so = info['is_so'] = context.isSectionOfficer() 31 32 res = context.portal_catalog(portal_type='Student',id = student_id) 33 if res: 34 info['review_state'] = res[0].review_state 35 39 36 info['student_name'] = s_brain.name 37 payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id) 38 sos = context.portal_catalog(container_path=payments_path) 39 info['is_so'] = is_so 40 41 for so in sos: 42 43 row = {} 44 row['id'] = so.getId 45 row['title'] = so.Title 46 url = row['url'] = "%s/%s" % (payments_path,so.getId) 47 so_object = context.restrictedTraverse(url,default=None).getContent() 48 row['type'] = so.portal_type 49 review_state = row['review_state'] = so.review_state 50 if so_object.type_description.startswith('School Fee'): 51 row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated' 52 else: 53 row['is_approvable'] = is_so and (review_state == "opened") 54 if (review_state == "closed") and so_object.resp_code in ('SC','00','AP',): 55 row['confirmed'] = 'active' 56 else: 57 row['confirmed'] = '' 58 payments.append(row) 59 60 40 61 info['payments'] = payments 41 62 return info
Note: See TracChangeset for help on using the changeset viewer.