source: WAeUP_SRP/branches/joachim-azax-branch/skins/waeup_student/student_index.py @ 16153

Last change on this file since 16153 was 1997, checked in by joachim, 17 years ago

starting

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
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"""
12return 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
20request = context.REQUEST
21#session = request.SESSION
22response = request.RESPONSE
23redirect = response.redirect
24pm = context.portal_membership
25member = pm.getAuthenticatedMember()
26
27#from Products.zdb import set_trace;set_trace()
28if 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())
42if 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
55return redirect("%s/srp_anonymous_view" % context.portal_url())
56
Note: See TracBrowser for help on using the repository browser.