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