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,portal_status_message=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: student_index.py 2297 2007-10-01 07:26:30Z henrik $ |
---|
11 | """ |
---|
12 | return the current student_index |
---|
13 | """ |
---|
14 | |
---|
15 | request = context.REQUEST |
---|
16 | #session = request.SESSION |
---|
17 | response = request.RESPONSE |
---|
18 | redirect = response.redirect |
---|
19 | pm = context.portal_membership |
---|
20 | member = pm.getAuthenticatedMember() |
---|
21 | |
---|
22 | #from Products.zdb import set_trace;set_trace() |
---|
23 | if context.isStaff(): |
---|
24 | if context.portal_type == 'StudentStudyCourse': |
---|
25 | return context.study_course_view() |
---|
26 | elif context.portal_type == 'StudentStudyLevel': |
---|
27 | return context.academic_report_view() |
---|
28 | elif context.portal_type == 'StudentPastoralReport': |
---|
29 | return context.pastoral_report_view() |
---|
30 | elif context.portal_type == 'StudentClearance': |
---|
31 | return context.clearance_view() |
---|
32 | elif context.portal_type == 'PaymentsFolder': |
---|
33 | return context.payments_view() |
---|
34 | elif context.portal_type == 'Student': |
---|
35 | if portal_status_message: |
---|
36 | return redirect("%s/student_view?portal_status_message=%s" % (context.absolute_url(),portal_status_message)) |
---|
37 | else: |
---|
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.academic_report_view() |
---|
49 | elif context.portal_type == 'StudentPastoralReport': |
---|
50 | return context.pastoral_report_view() |
---|
51 | elif context.portal_type == 'StudentStudyCourse': |
---|
52 | return context.study_course_view() |
---|
53 | students_url = "%s/campus/students" % (context.portal_url()) |
---|
54 | id = str(member) |
---|
55 | return redirect("%s/%s/student_view" % (students_url, id)) |
---|
56 | |
---|
57 | return redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
58 | |
---|