Ignore:
Timestamp:
7 Dec 2006, 18:18:28 (18 years ago)
Author:
joachim
Message:

student_search fixed for ClearanceOfficers?
getStudentInfo checks for access to not owned Student-Ids and logs them.
search Pins shows all used PIN's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py

    r1002 r1006  
    1212list Students for ClearanceOfficers
    1313"""
     14
    1415request = REQUEST
    1516wftool = context.portal_workflow
     
    4748
    4849if what == 'student':
    49     items_2 = context.portal_pins(student = term)
    5050    items_1 = context.portal_pins(student = term.upper())
     51    items_2 = context.portal_pins(student = term.lower())
    5152    items = items_1 + items_2
    5253elif what == 'pin':
     
    5556    items = []
    5657l = []
     58students_url = "%s/%s" % (context.portal_url(),'students')
     59pins = []
    5760for i in items:
    5861    item = {}
     
    6164    item['serial'] = i.serial
    6265    item['pin'] = i.pin
     66    if i.pin in pins:
     67        continue
     68    pins.append(i.pins)
    6369    if len(sno)==10:
    64     #if bd.prefix == "APP":
    6570        #res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication')
    6671        res = context.students_catalog(jamb_reg_no=sno.upper())
    6772        if len(res) > 0:
    68             item['student_url'] = "%s/%s" % (context.portal_url(),res[0].id)
     73            item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id)
    6974            item['student_id'] = res[0].id
    7075        else:
    7176            item['student_url'] = None
    7277            item['student_id'] = ''
     78    elif sno:
     79        item['student_url'] = '%s/campus/students/%s' % (students_url,item['student'])
     80        item['student_id'] = student
    7381    else:
    74         item['student_url'] = '%s/%s' % (students_url,item['student'])
    75         item['student_id'] = student
     82        item['student_url'] = ''
     83        item['student_id'] = "not used"
    7684    l.append(item)
    7785   
Note: See TracChangeset for help on using the changeset viewer.