Changeset 1002


Ignore:
Timestamp:
6 Dec 2006, 18:08:45 (18 years ago)
Author:
joachim
Message:

search for PIN added

Location:
WAeUP_SRP/trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/ScratchCards.py

    r978 r1002  
    136136              } for p in pins_cat.searchResults(prefix_batch = "%s%d"
    137137                                               % (doc.prefix,doc.batch_no),
    138                                                ) if not p.student]
    139         used = [{'pin': p.pin,
    140               'serial': p.serial,
    141               'student': p.student,
    142               } for p in pins_cat.searchResults(prefix_batch = "%s%d"
    143                                                % (doc.prefix,doc.batch_no),
    144                                                ) if p.student]
    145         if len (unused) <= max_pins:
    146             return unused,used
    147         return unused[:max_pins],used
     138                                               )[-max_pins:] if not p.student]
     139##        used = [{'pin': p.pin,
     140##              'serial': p.serial,
     141##              'student': p.student,
     142##              } for p in pins_cat.searchResults(prefix_batch = "%s%d"
     143##                                               % (doc.prefix,doc.batch_no),
     144##                                               ) if p.student]
     145##        if len (unused) <= max_pins:
     146##            return unused,used
     147        return unused
    148148
    149149InitializeClass(ScratchCardBatch)
  • WAeUP_SRP/trunk/profiles/default/layouts.xml

    r916 r1002  
    1313 <object name="student" meta_type="CPS Layout"/>
    1414 <object name="scratch_card_batch" meta_type="CPS Layout"/>
     15 <object name="scratch_card_search" meta_type="CPS Layout"/>
    1516 <object name="student_study_course" meta_type="CPS Layout"/>
    1617 <object name="student_accommodation" meta_type="CPS Layout"/>
  • WAeUP_SRP/trunk/profiles/default/vocabularies.xml

    r933 r1002  
    2121 <object name="pin_prefixes" meta_type="CPS Vocabulary"/>
    2222 <object name="student_search_mode" meta_type="CPS Vocabulary"/>
     23 <object name="scratch_card_search_mode" meta_type="CPS Vocabulary"/>
    2324 <object name="student_status_voc" meta_type="CPS Vocabulary"/>
    2425 <object name="searchable_student_states" meta_type="CPS Vocabulary"/>
  • WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt

    r999 r1002  
    1 <metal:html tal:define="info context/getBatchInfo;
     1<metal:html tal:define="info options/info;
     2                        rendered options/rendered;
    23                        mtool here/portal_membership;
    34                        member mtool/getAuthenticatedMember;
    45                        ">
    5 
    66  <metal:body use-macro="here/main_template/macros/master">
    77    <metal:block fill-slot="header">
     
    2929        <h3>Unused</h3>
    3030        <table>
    31           <tr tal:repeat="pin info/unused">
     31          <tr tal:repeat="pin python: info['unused'][:2]">
    3232            <td width="50px"> <span tal:content="pin/serial" />: </td>
    3333            <td tal:content="pin/pin" />
     
    3535        </table>
    3636        </span>
     37        <span tal:replace="structure rendered" />
    3738
    38         <h3>Used</h3>
     39        <h3>Results</h3>
    3940        <table>
    4041          <tr tal:repeat="pin info/used">
    4142            <td width="50px"> <span tal:content="pin/serial" />: </td>
    4243            <td tal:content="pin/pin" />
     44            <td tal:content="pin/student_id" />
    4345            <td>
    4446              <a tal:condition="pin/student_url" href="" tal:content="pin/student"
  • WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py

    r845 r1002  
    2525info['unused'],used = batch.getContent().getUnusedPins()
    2626l = []
    27 students_rpath = context.portal_catalog(meta_type = "StudentsFolder")[-1].relative_path
    28 students_url = "%s/%s" % (context.portal_url(),students_rpath)
     27p_url = context.portal_url
     28students_url = "%s/%s" % (p_url,"students")
    2929
    3030for item in used:
     
    3232    if len(sno)==10:
    3333    #if bd.prefix == "APP":
    34         res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication')
     34        #res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication')
     35        res = context.students_catalog(jamb_reg_no=sno)
    3536        if len(res) > 0:
    36             item['student_url'] = "%s/%s" % (context.portal_url(),res[0].relative_path)
     37            item['student_url'] = "%s/%s" % (context.portal_url(),res[0].id)
     38            item['student_id'] = res[0].id
    3739        else:
    3840            item['student_url'] = None
    3941    else:
    4042        item['student_url'] = '%s/%s' % (students_url,item['student'])
     43        item['student_id'] = student
    4144info['used'] = used
    4245return info
  • WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt

    r1001 r1002  
    1010          <tr tal:repeat="batch batches">
    1111            <td><a href="batch"
    12                    tal:attributes="href string:${batch/getPath}"
     12                   tal:attributes="href string:${batch/getPath}/search_pins"
    1313                   tal:content="batch/Title"></a></td>   
    1414          </tr>
Note: See TracChangeset for help on using the changeset viewer.