[891] | 1 | ## Script (Python) "student_index" |
---|
[544] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
[2297] | 7 | ##parameters=batch=None,portal_status_message=None |
---|
[544] | 8 | ##title= |
---|
| 9 | ## |
---|
[805] | 10 | # $Id: student_index.py 2297 2007-10-01 07:26:30Z henrik $ |
---|
[544] | 11 | """ |
---|
[1785] | 12 | return the current student_index |
---|
[544] | 13 | """ |
---|
| 14 | |
---|
| 15 | request = context.REQUEST |
---|
[1822] | 16 | #session = request.SESSION |
---|
[1380] | 17 | response = request.RESPONSE |
---|
| 18 | redirect = response.redirect |
---|
[544] | 19 | pm = context.portal_membership |
---|
[999] | 20 | member = pm.getAuthenticatedMember() |
---|
[544] | 21 | |
---|
[1238] | 22 | #from Products.zdb import set_trace;set_trace() |
---|
[903] | 23 | if context.isStaff(): |
---|
[723] | 24 | if context.portal_type == 'StudentStudyCourse': |
---|
| 25 | return context.study_course_view() |
---|
| 26 | elif context.portal_type == 'StudentStudyLevel': |
---|
| 27 | return context.study_level_view() |
---|
[839] | 28 | elif context.portal_type == 'StudentClearance': |
---|
[894] | 29 | return context.clearance_view() |
---|
[1283] | 30 | elif context.portal_type == 'PaymentsFolder': |
---|
| 31 | return context.payments_view() |
---|
[839] | 32 | elif context.portal_type == 'Student': |
---|
[2297] | 33 | if portal_status_message: |
---|
| 34 | return redirect("%s/student_view?portal_status_message=%s" % (context.absolute_url(),portal_status_message)) |
---|
| 35 | else: |
---|
| 36 | return redirect("%s/student_view" % context.absolute_url()) |
---|
[1368] | 37 | elif context.portal_type == 'Payment': |
---|
[1502] | 38 | return context.payment_receipt() |
---|
[839] | 39 | return redirect("%s/waeup_document_view" % context.absolute_url()) |
---|
[603] | 40 | if context.isStudent(): |
---|
[1243] | 41 | if context.portal_type == 'PaymentsFolder': |
---|
| 42 | return context.payments_view() |
---|
[1368] | 43 | elif context.portal_type == 'Payment': |
---|
| 44 | return context.payment_receipt() |
---|
[1380] | 45 | elif context.portal_type == 'StudentStudyLevel': |
---|
[1492] | 46 | return context.study_level_view() |
---|
[1502] | 47 | elif context.portal_type == 'StudentStudyCourse': |
---|
[1785] | 48 | return context.study_course_view() |
---|
[1163] | 49 | students_url = "%s/campus/students" % (context.portal_url()) |
---|
| 50 | id = str(member) |
---|
| 51 | return redirect("%s/%s/student_view" % (students_url, id)) |
---|
[903] | 52 | |
---|
[1163] | 53 | return redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
| 54 | |
---|