Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc
Tomas Cohen Arazi 6d9d5581ab Bug 10406: memove div and more obsolete CSS related to YUI autocomplete
To test:

- Apply, then test the patron search form

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-06-12 07:24:30 -07:00

48 lines
2.2 KiB
HTML

[% IF ( CAN_user_circulate ) %][% IF ( CircAutocompl ) %]<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$( "#findborrower" ).autocomplete({
source: "/cgi-bin/koha/circ/ysearch.pl",
minLength: 3,
select: function( event, ui ) {
$( "#findborrower" ).val( ui.item.cardnumber );
$("#patronsearch").submit();
return false;
}
})
.data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
.appendTo( ul );
};
});
//]]>
</script>[% END %]
<div id="circ_search" class="residentsearch">
<p class="tip">Enter patron card number or partial name:</p>
<form action="/cgi-bin/koha/circ/circulation.pl" id="patronsearch" method="post">
[% IF ( CircAutocompl ) %]
<div class="autocomplete">
<input autocomplete="off" id="findborrower" name="findborrower" size="40" class="focus" type="text" /> <input id="autocsubmit" type="submit" class="submit" value="Submit" />
<input name="branch" value="[% branch %]" type="hidden" />
<input name="printer" value="" type="hidden" />
[% IF ( stickyduedate ) %]
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
[% END %]
</div>
[% ELSE %]
<input id="findborrower" name="findborrower" size="40" class="focus" type="text" />
<input name="branch" value="[% branch %]" type="hidden" />
<input name="printer" value="" type="hidden" />
[% IF ( stickyduedate ) %]
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
[% END %]
<input value="Submit" class="submit" type="submit" />
[% END %]
</form>
</div>
[% END %]