1 | ## Script (Python) "cpsdocument_edit" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=student=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $ |
---|
11 | """ |
---|
12 | return Info about the current Student |
---|
13 | """ |
---|
14 | request = context.REQUEST |
---|
15 | |
---|
16 | wf = context.portal_workflow |
---|
17 | mtool = context.portal_membership |
---|
18 | member = mtool.getAuthenticatedMember() |
---|
19 | path_info = request.get('PATH_INFO').split('/') |
---|
20 | |
---|
21 | info = {} |
---|
22 | member_id = str(member) |
---|
23 | ##if member_id not in path_info: |
---|
24 | ## return None |
---|
25 | if student is None: |
---|
26 | students = getattr(context,'students',None) |
---|
27 | if students is None: |
---|
28 | students = getattr(context.campus,'students',None) |
---|
29 | student = getattr(students,member_id,None) |
---|
30 | if student is None: |
---|
31 | return None |
---|
32 | info['review_state'] = wf.getInfoFor(student,'review_state','keiner') |
---|
33 | #info['wf_state'] = 'keiner' |
---|
34 | info['student'] = student |
---|
35 | info['student_doc'] = student.getContent() |
---|
36 | info['app'] = student.application |
---|
37 | info['app_doc'] = student.application.getContent() |
---|
38 | info['per'] = student.personal |
---|
39 | info['per_doc'] = student.personal.getContent() |
---|
40 | return info |
---|