[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 |
---|
| 7 | ##parameters=batch=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
[805] | 10 | # $Id: student_index.py 1997 2007-07-08 09:16:21Z joachim $ |
---|
[544] | 11 | """ |
---|
[1785] | 12 | return the current student_index |
---|
[544] | 13 | """ |
---|
[1845] | 14 | # from Products.AdvancedQuery import Eq, Between, Le,In |
---|
| 15 | # try: |
---|
| 16 | # aq_portal = context.portal_catalog.evalAdvancedQuery |
---|
| 17 | # except: |
---|
| 18 | # aq_portal = context.portal_catalog_real.evalAdvancedQuery |
---|
[544] | 19 | |
---|
| 20 | request = context.REQUEST |
---|
[1822] | 21 | #session = request.SESSION |
---|
[1380] | 22 | response = request.RESPONSE |
---|
| 23 | redirect = response.redirect |
---|
[544] | 24 | pm = context.portal_membership |
---|
[999] | 25 | member = pm.getAuthenticatedMember() |
---|
[544] | 26 | |
---|
[1238] | 27 | #from Products.zdb import set_trace;set_trace() |
---|
[903] | 28 | if context.isStaff(): |
---|
[723] | 29 | if context.portal_type == 'StudentStudyCourse': |
---|
| 30 | return context.study_course_view() |
---|
| 31 | elif context.portal_type == 'StudentStudyLevel': |
---|
[1997] | 32 | return context.study_level_view_azax() |
---|
[839] | 33 | elif context.portal_type == 'StudentClearance': |
---|
[894] | 34 | return context.clearance_view() |
---|
[1283] | 35 | elif context.portal_type == 'PaymentsFolder': |
---|
| 36 | return context.payments_view() |
---|
[839] | 37 | elif context.portal_type == 'Student': |
---|
[999] | 38 | return redirect("%s/student_view" % context.absolute_url()) |
---|
[1368] | 39 | elif context.portal_type == 'Payment': |
---|
[1502] | 40 | return context.payment_receipt() |
---|
[839] | 41 | return redirect("%s/waeup_document_view" % context.absolute_url()) |
---|
[603] | 42 | if context.isStudent(): |
---|
[1243] | 43 | if context.portal_type == 'PaymentsFolder': |
---|
| 44 | return context.payments_view() |
---|
[1368] | 45 | elif context.portal_type == 'Payment': |
---|
| 46 | return context.payment_receipt() |
---|
[1380] | 47 | elif context.portal_type == 'StudentStudyLevel': |
---|
[1492] | 48 | return context.study_level_view() |
---|
[1502] | 49 | elif context.portal_type == 'StudentStudyCourse': |
---|
[1785] | 50 | return context.study_course_view() |
---|
[1163] | 51 | students_url = "%s/campus/students" % (context.portal_url()) |
---|
| 52 | id = str(member) |
---|
| 53 | return redirect("%s/%s/student_view" % (students_url, id)) |
---|
[903] | 54 | |
---|
[1163] | 55 | return redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
| 56 | |
---|