Changeset 5163


Ignore:
Timestamp:
21 Apr 2010, 04:38:00 (15 years ago)
Author:
Henrik Bettermann
Message:

some code cleaning

Location:
WAeUP_SRP/trunk/skins
Files:
2 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py

    r3061 r5163  
    2525course_cat = context.courses_catalog
    2626from Products.AdvancedQuery import Eq, Between, Le,In
    27 try:
    28     aq_portal = context.portal_catalog.evalAdvancedQuery
    29 except:
    30     aq_portal = context.portal_catalog_real.evalAdvancedQuery
    3127course_id = request.get('course_id')
    3228mtool = context.portal_membership
  • WAeUP_SRP/trunk/skins/waeup_student/create_level.py

    r3650 r5163  
    2525redirect = response.redirect
    2626logger = logging.getLogger('Skins.create_level')
    27 # mtool = context.portal_membership
    28 # member = mtool.getAuthenticatedMember()
    29 # member_id = str(member)
    30 # requested_id = context.getStudentId()
    31 # #set_trace()
    32 # create_level =  request.form.get('create_level',None)
    33 # if not create_level or not requested_id or\
    34 #    (not context.isStaff() and member_id != requested_id):
    35 #     logger.info('%s tried to access %s' % (member_id,requested_id))
    36 #     return redirect("%s/srp_anonymous_view" % context.portal_url())
    37 # student_id = context.getStudentId()
    3827info = context.waeup_tool.getAccessInfo(context)
    3928student_id = info['student_id']
     
    4130    return None
    4231
    43 #lt = context.portal_layouts
    44 #wt = context.waeup_tool
    4532student = context.students_catalog.getRecordByKey(student_id)
    4633cert_id = student.course
     
    5542
    5643if context.hasObject(current_level):
    57     #level = getattr(context,"%s" % current_level)
    5844    return response.redirect("%s/%s" % (context.absolute_url(),current_level))
    5945else:
     
    6248    context.portal_workflow.doActionFor(level,'open')
    6349    level.getContent().edit(mapping={'session': current_session})
    64     #context.portal_workflow.doActionFor(level,'close_for_edit')
    6550level_id = level.getId()
    6651session_id = context.getLevelSession(level.getContent(),student_id,level_id)
     
    7156l = []
    7257
    73 #level_nr,dummy = divmod(int(current_level),100)
    74 # fetch session courses from the certificate
    7558res = context.portal_catalog(portal_type="Certificate", id = cert_id)
    7659if res:
    7760    cert = res[0]
    7861    path = cert.getPath()
    79     #academics_level = 100 * level_nr
    8062    if int(current_level) > 0:
    8163        academics_level = 100 * (int(current_level)/100)
  • WAeUP_SRP/trunk/skins/waeup_student/deactivate_students.py

    r2729 r5163  
    2121logger = logging.getLogger('Skins.deactivate_students')
    2222from Products.AdvancedQuery import Eq, Between, Le,In
    23 #aq_portal = context.portal_catalog_real.evalAdvancedQuery
    2423aq_students = context.students_catalog.evalAdvancedQuery
    2524students_folder = context.portal_url.getPortalObject().campus.students
  • WAeUP_SRP/trunk/skins/waeup_student/getClearanceInfo.py

    r5133 r5163  
    7777#     info['penalty'] = info['penalty'] and\
    7878#                       info['clear_doc'].entry_date.greaterThan(DateTime('2006/12/30'))
    79 # course = getattr(student,'study_course',None)
    80 # if course:
    81 #     cert_id = course.getContent().study_course
    82 #     res = context.portal_catalog(portal_type = "Certificate", id = cert_id)
    83 #     ci = {}
    84 #     if len(res) > 0:
    85 #         info['course'] = course
    86 #         brain = res[0]
    87 #         ci['study_course'] = brain.getId
    88 #         ci['title'] = brain.Title
    89 #         pl = brain.getPath().split('/')
    90 #         ci['faculty'] = pl[-4]
    91 #         ci['department'] = pl[-3]
    92 #         info['course_doc'] = ci
    93 #     else:
    94 #         info['course'] = None
    9579return info
  • WAeUP_SRP/trunk/skins/waeup_student/getIdCardInfo.py

    r4030 r5163  
    5858    info['personal'] = personal_doc
    5959
    60 #cert_id = sbrain.course
    61 #res = context.portal_catalog(portal_type = "Certificate", id = cert_id)
    62 #if res:
    63 #    brain = res[0]
    64 #    info['sc_title'] = brain.Title
    6560
    6661info['passport_url'] = context.portal_url() + '/viewimage/' + student_id + '/passport_' + student_id + '.jpg'
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py

    r4557 r5163  
    5252info['student'] = student_record
    5353cert_id = student_record.course
    54 # logger.info("before search")
    55 # starttime = DateTime.DateTime().timeTime()
    56 # res = context.portal_catalog_real.evalAdvancedQuery(Eq('id', cert_id)) # &
    57 #                                                    Eq('portal_type', "Certificate"))
    58 # logger.info("searchtime %f" % (DateTime.DateTime().timeTime() - starttime))
    59 # if True:
    60 #     #info['cert_id'] = cert_id
    61 #     # brain = res[0]
    62 #     # ci['title'] = brain.Title
    63 #     # pl = brain.getPath().split('/')
    64 #     # ci['faculty'] = pl[-4]
    65 #     # ci['department'] = pl[-3]
    66 #     ci['study_course'] = student_record.course
    67 #     ci['faculty'] = student_record.faculty
    68 #     ci['department'] = student_record.department
    69 #     info['course_doc'] = ci
    70 # else:
    71 #     info['cert_id'] = 'N/A'
    72 #     ci['study_course'] = 'N/A'
    73 #     ci['title'] = 'N/A'
    74 #     ci['faculty'] = 'N/A'
    75 #     ci['department'] = 'N/A'
    76 #     info['course_doc'] = ci
    7754ci = {}
    7855ci['study_course'] = student_record.course
     
    10683review_state = wftool.getInfoFor(context,'review_state',None)
    10784student_review_state = student_record.review_state
    108 #if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent():
    109 #    wftool.doActionFor(context,'close_for_edit')
    11085
    11186has_paid = student_review_state == 'school_fee_paid'
  • WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py

    r5144 r5163  
    88# $Id$
    99"""
    10 process the Application Form
    11 return html renderer + psm
    1210"""
    1311request = context.REQUEST
Note: See TracChangeset for help on using the changeset viewer.