Bug 21076: Don't call autocomplete code after patron found
To test:
1 - Enable article requests
2 - Search on staff client
3 - Click 'Request article'
4 - Find a patron
5 - View error in console
6 - Apply patch
7 - Reload
8 - Not error is gone
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5a9bad7874)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
1d9ae5ecc6
commit
50f4e86350
|
|
@ -305,24 +305,26 @@
|
|||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$( "#patron" ).autocomplete({
|
||||
source: "/cgi-bin/koha/circ/ysearch.pl",
|
||||
minLength: 3,
|
||||
select: function( event, ui ) {
|
||||
$( "#patron" ).val( ui.item.cardnumber );
|
||||
$( "#holds_patronsearch" ).submit();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a>" + item.surname + ", " + item.firstname +
|
||||
" (" + item.cardnumber + ") <small>" + item.address +
|
||||
" " + item.city + " " + item.zipcode + " " +
|
||||
item.country + "</small></a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
[% UNLESS (patron ) %]
|
||||
$( "#patron" ).autocomplete({
|
||||
source: "/cgi-bin/koha/circ/ysearch.pl",
|
||||
minLength: 3,
|
||||
select: function( event, ui ) {
|
||||
$( "#patron" ).val( ui.item.cardnumber );
|
||||
$( "#holds_patronsearch" ).submit();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "ui-autocomplete-item", item )
|
||||
.append( "<a>" + item.surname + ", " + item.firstname +
|
||||
" (" + item.cardnumber + ") <small>" + item.address +
|
||||
" " + item.city + " " + item.zipcode + " " +
|
||||
item.country + "</small></a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
[% END %]
|
||||
|
||||
$( ".ar-update-branchcode" ).on('focus', function(){
|
||||
previous_branchcode = this.value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue