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

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

starting

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