Changeset 663


Ignore:
Timestamp:
12 Oct 2006, 10:21:56 (18 years ago)
Author:
joachim
Message:

fixed searchStudents

Location:
WAeUP_SRP/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/default/types/Course.xml

    r578 r663  
    1414 <property name="allow_discussion">False</property>
    1515 <property name="cps_is_searchable">True</property>
    16  <property name="cps_proxy_type">document</property>
     16 <property name="cps_proxy_type">folderishdocument</property>
    1717 <property name="cps_display_as_document_in_listing">True</property>
    1818 <property name="schemas">
  • WAeUP_SRP/trunk/profiles/default/types/StudentClearance.xml

    r659 r663  
    1414 <property name="allow_discussion">False</property>
    1515 <property name="cps_is_searchable">False</property>
    16  <property name="cps_proxy_type">document</property>
     16 <property name="cps_proxy_type">folderishdocument</property>
    1717 <property name="cps_display_as_document_in_listing">True</property>
    1818 <property name="schemas">
  • WAeUP_SRP/trunk/profiles/default/types/StudentPersonal.xml

    r659 r663  
    1414 <property name="allow_discussion">False</property>
    1515 <property name="cps_is_searchable">False</property>
    16  <property name="cps_proxy_type">document</property>
     16 <property name="cps_proxy_type">folderishdocument</property>
    1717 <property name="cps_display_as_document_in_listing">True</property>
    1818 <property name="schemas">
  • WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py

    r622 r663  
    2929items = []
    3030default = {'search_mode': 'name',
    31         'review_state': 'created',
     31        'review_state': 'all',
    3232        'search_string': ''
    3333        }
     
    7373onlyreview = with_review and not term
    7474if onlyreview:
    75     res = catalog(portal_type=portal_type_query,
     75    res = catalog(portal_type='Student',
    7676                  review_state=state)
    7777elif what == "student_id":
     
    9393        pt = portal_type_query
    9494        st = "%s*" % term.strip()
    95     if with_review:
    96         try:
    97             res = catalog(portal_type=pt,SearchableText=st,
    98                           review_state=state)
    99         except:
    100             return context.students_manager_view(rendered = rend,
    101                                  psm = 'Search string "%s" not allowed.' % term,
    102                                  #psm = "%s, %s" % (psm,ds),
    103                                  students = items,
    104                                  is_manager = is_manager,
    105                                  )
    106     else:
    107         try:
    108             res = catalog(portal_type=pt,SearchableText=st,)
    109         except:
    110             return context.students_manager_view(rendered = rend,
    111                                  psm = 'Searchstring "%s" not allowed' % term,
    112                                  #psm = "%s, %s" % (psm,ds),
    113                                  students = items,
    114                                  is_manager = is_manager,
    115                                  )
    116 
     95    try:
     96        res = catalog(portal_type=pt,SearchableText=st)
     97    except:
     98        return context.students_manager_view(rendered = rend,
     99                             psm = 'Search string "%s" not allowed.' % term,
     100                             #psm = "%s, %s" % (psm,ds),
     101                             students = items,
     102                             is_manager = is_manager,
     103                             )
     104students = []
    117105if res:
    118106    for r in res:
    119107        if r.portal_type in ("StudentApplication","StudentPersonal"):
    120108            student = r.getObject().aq_parent
     109##            pp = '/'.join(r.getPath().split('/')[:-1])
     110##            student_cat = catalog(pathindex=pp,portal_type='Student')[0]
     111##            student_rs = student_cat.review_state
     112##            student = student_cat.getObject()
    121113        else:
    122114            student = r.getObject()
    123         if student not in items:
    124             items.append(student)
    125 students = []
     115        student_rs = wf.getInfoFor(student,'review_state','keiner')
     116        if with_review and student_rs != state:
     117            continue
     118        items.append(student)
    126119if items:
    127120    for item in items:
    128121        students.append(context.getStudentInfo(item))
    129 return context.students_manager_view(rendered = rend,
     122    return context.students_manager_view(rendered = rend,
    130123                             psm = "%d matching Students found" % len(items),
    131                              #psm = "%s, %s" % (psm,ds),
    132124                             students = students,
    133125                             is_manager = is_manager,
    134126                             )
     127return context.students_manager_view(rendered = rend,
     128                             psm = "Your search for %s in %s with state %s failed" % (st,what,state),
     129                             students = students,
     130                             is_manager = is_manager,
     131                             )
Note: See TracChangeset for help on using the changeset viewer.