Bug 10691: (follow-up) replace HTML comments with TT contents
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / patron-search-box.inc
1 [% IF ( CAN_user_circulate ) %][% IF ( CircAutocompl ) %]<script type="text/javascript">
2 //<![CDATA[
3 $(document).ready(function(){
4     $( "#findborrower" ).autocomplete({
5         source: "/cgi-bin/koha/circ/ysearch.pl",
6         minLength: 3,
7         select: function( event, ui ) {
8             $( "#findborrower" ).val( ui.item.cardnumber );
9             $("#patronsearch").submit();
10             return false;
11         }
12     })
13     .data( "autocomplete" )._renderItem = function( ul, item ) {
14         return $( "<li></li>" )
15         .data( "item.autocomplete", item )
16         .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
17         .appendTo( ul );
18     };
19
20 });
21 //]]>
22 </script>[% END %]
23     <div id="circ_search" class="residentsearch">
24     <p class="tip">Enter patron card number or partial name:</p>
25     <form action="/cgi-bin/koha/circ/circulation.pl" id="patronsearch" method="post">
26     [% IF ( CircAutocompl ) %]
27     <div class="autocomplete">
28                 <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="focus" type="text" /> <input id="autocsubmit" type="submit" class="submit" value="Submit" />
29                 <input name="branch" value="[% branch %]" type="hidden" />
30                 <input name="printer" value="" type="hidden" />
31             [% IF ( stickyduedate ) %]
32                 <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
33                 <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
34             [% END %]
35         </div>
36         [% ELSE %]
37             <input id="findborrower" name="findborrower" size="40" class="focus" type="text" />
38             <input name="branch" value="[% branch %]" type="hidden" />
39             <input name="printer" value="" type="hidden" />
40             [% IF ( stickyduedate ) %]
41             <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
42             <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
43             [% END %]
44             <input value="Submit" class="submit" type="submit" />
45         [% END %]
46     </form>
47         </div>
48         [% END %]