1 | ## Script (Python) "student_index" |
---|
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 | ## |
---|
10 | # $Id: student_index.py 1997 2007-07-08 09:16:21Z joachim $ |
---|
11 | """ |
---|
12 | return the current student_index |
---|
13 | """ |
---|
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 |
---|
19 | |
---|
20 | request = context.REQUEST |
---|
21 | #session = request.SESSION |
---|
22 | response = request.RESPONSE |
---|
23 | redirect = response.redirect |
---|
24 | pm = context.portal_membership |
---|
25 | member = pm.getAuthenticatedMember() |
---|
26 | |
---|
27 | #from Products.zdb import set_trace;set_trace() |
---|
28 | if context.isStaff(): |
---|
29 | if context.portal_type == 'StudentStudyCourse': |
---|
30 | return context.study_course_view() |
---|
31 | elif context.portal_type == 'StudentStudyLevel': |
---|
32 | return context.study_level_view_azax() |
---|
33 | elif context.portal_type == 'StudentClearance': |
---|
34 | return context.clearance_view() |
---|
35 | elif context.portal_type == 'PaymentsFolder': |
---|
36 | return context.payments_view() |
---|
37 | elif context.portal_type == 'Student': |
---|
38 | return redirect("%s/student_view" % context.absolute_url()) |
---|
39 | elif context.portal_type == 'Payment': |
---|
40 | return context.payment_receipt() |
---|
41 | return redirect("%s/waeup_document_view" % context.absolute_url()) |
---|
42 | if context.isStudent(): |
---|
43 | if context.portal_type == 'PaymentsFolder': |
---|
44 | return context.payments_view() |
---|
45 | elif context.portal_type == 'Payment': |
---|
46 | return context.payment_receipt() |
---|
47 | elif context.portal_type == 'StudentStudyLevel': |
---|
48 | return context.study_level_view() |
---|
49 | elif context.portal_type == 'StudentStudyCourse': |
---|
50 | return context.study_course_view() |
---|
51 | students_url = "%s/campus/students" % (context.portal_url()) |
---|
52 | id = str(member) |
---|
53 | return redirect("%s/%s/student_view" % (students_url, id)) |
---|
54 | |
---|
55 | return redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
56 | |
---|