|
Lines 87-103
Link Here
|
| 87 |
var obj = $( "#findborrower" ).autocomplete({ |
87 |
var obj = $( "#findborrower" ).autocomplete({ |
| 88 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
88 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
| 89 |
minLength: 3, |
89 |
minLength: 3, |
| 90 |
select: function( event, ui ) { |
|
|
| 91 |
$( "#findborrower" ).val( ui.item.cardnumber ); |
| 92 |
$("#patronsearch").submit(); |
| 93 |
return false; |
| 94 |
} |
| 95 |
}).data( "ui-autocomplete" ); |
90 |
}).data( "ui-autocomplete" ); |
| 96 |
if( obj ) { |
91 |
if( obj ) { |
| 97 |
obj._renderItem = function( ul, item ) { |
92 |
obj._renderItem = function( ul, item ) { |
|
|
93 |
var cardnumber = ""; |
| 94 |
if( item.cardnumber != "" ){ |
| 95 |
// Display card number in parentheses if it exists |
| 96 |
cardnumber = " (" + item.cardnumber + ") "; |
| 97 |
} |
| 98 |
return $( "<li></li>" ) |
98 |
return $( "<li></li>" ) |
| 99 |
.data( "ui-autocomplete-item", item ) |
99 |
.data( "ui-autocomplete-item", item ) |
| 100 |
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) |
100 |
.append( "<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) |
| 101 |
.appendTo( ul ); |
101 |
.appendTo( ul ); |
| 102 |
}; |
102 |
}; |
| 103 |
} |
103 |
} |
| 104 |
- |
|
|