Ignore:
Timestamp:
21 Jul 2007, 18:53:04 (17 years ago)
Author:
Henrik Bettermann
Message:

first draft of id_card_demo for Unilorin

add /id_card_demo to URL of a student to check

File:
1 edited

Legend:

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

    r1871 r2043  
    9696        info['course'] = None
    9797#
    98 acco = getattr(student,'accommodation_2006',None)
    99 info['acco'] = acco
    100 if acco is not None:
    101     info['acco_doc'] = acco.getContent()
    102     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     98
     99#clear = getattr(student,'clearance',None)
     100#info['clear'] = clear
     101#if clear is not None:
     102#    info['clear_doc'] = clear.getContent()
     103#    info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None)
    103104#
    104 clear = getattr(student,'clearance',None)
    105 info['clear'] = clear
    106 if clear is not None:
    107     info['clear_doc'] = clear.getContent()
    108     info['clear_review_state'] = wf.getInfoFor(clear,'review_state',None)
    109 #
    110 pume = getattr(student,'pume',None)
    111 info['pume'] = pume
    112 if pume is not None:
    113     info['pume_doc'] = pume.getContent()
    114     info['pume_review_state'] = wf.getInfoFor(pume,'review_state',None)
    115 else:
    116     info['pume'] = None
     105#pume = getattr(student,'pume',None)
     106#info['pume'] = pume
     107#if pume is not None:
     108#    info['pume_doc'] = pume.getContent()
     109#    info['pume_review_state'] = wf.getInfoFor(pume,'review_state',None)
     110#else:
     111#    info['pume'] = None
    117112
    118113if not with_items:
    119114    return info
    120115
    121 items = []
    122 s_edit_links = {'StudentApplication': 'application_edit_form',
    123               'StudentAccommodation': 'reserve_accommodation',
    124               'StudentClearance': 'clearance_edit_form',
    125               'StudentPersonal': 'personal_edit_form',
    126               }
    127 s_view_links = {'StudentApplication': 'application_view',
    128               'StudentAccommodation': 'accommodation_view',
    129               'StudentClearance': 'clearance_view',
    130               'StudentPersonal': 'personal_view',
    131               'StudentStudyCourse': 'study_course_view',
    132               'StudentPume': 'pume_view',
    133               }
    134 sos = context.portal_catalog(container_path=student_path)
    135 for so in sos:
    136     row = {}
    137     soo = so.getObject()
    138     sod = soo.getContent()
    139     row['id'] = soo.getId()
    140     row['title'] = sod.Title()
    141     row['url'] = soo.absolute_url()
    142     row['type'] = so.portal_type
    143     row['is_editable'] = mtool.checkPermission('Modify portal content', soo)
    144     sv_link = s_view_links.get(so.portal_type,None) or "waeup_document_view"
    145     row['s_view_link'] = "%s/%s" % (soo.absolute_url(),sv_link)
    146     se_link = s_edit_links.get(so.portal_type,None)
    147     row['s_edit_link'] = None
    148     if se_link:
    149         row['s_edit_link'] = "%s/%s" % (soo.absolute_url(),se_link)
    150     row['review_state'] = so.review_state
    151     if info['review_state'] in ('returning',
    152                                 'school_fee_paid',
    153                                 'courses_registered',
    154                                 'courses_validated',):
    155           row['display'] = so.review_state in ('opened',
    156                                                'bed_reserved',
    157                                                'maintenance_fee_paid',) or so.portal_type == 'StudentStudyCourse'
    158     else:
    159           row['display'] = so.review_state in ('opened',
    160                                                'closed',
    161                                                'bed_reserved',
    162                                                'maintenance_fee_paid',) and\
    163                            so.portal_type not in ('StudentPume',) or\
    164                            so.portal_type == 'StudentStudyCourse'
    165 
    166     items.append(row)
    167 info['items'] = items
    168116request.set('student_id',student_id)
    169117request.set('student_url',info['url'])
Note: See TracChangeset for help on using the changeset viewer.