Bugzilla – Attachment 91940 Details for
Bug 23405
Circulation autocomplete for patron lookup broken if cardnumber is empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty
Bug-23405-Circulation-autocomplete-for-patron-look.patch (text/plain), 3.39 KB, created by
Ian Walls
on 2019-08-02 19:32:58 UTC
(
hide
)
Description:
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2019-08-02 19:32:58 UTC
Size:
3.39 KB
patch
obsolete
>From ba1b914e2d69ab823f5c13e1f20aa76439b601c9 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 31 Jul 2019 16:01:39 +0000 >Subject: [PATCH] Bug 23405: Circulation autocomplete for patron lookup broken > if cardnumber is empty > >This patch modifies the JavaScript behind the patron search >results autocomplete widget which is displayed when typing in the search >header's "Check out" tab. > >The script is modified to use the patron's borrowernumber instead of >cardnumber when redirecting to the checkout page. > >Instead of copying the patron's card number into the search form and >triggering a submit, the autocomplete output uses direct links to each >result. > >To better handle patrons with no card number, the output is modified to >show card number with parentheses only if card number is present. > >To test you should have a patron in your database which has no card >number. Make sure CircAutocompl is enabled. > >- From the circulation home page, type a patron name in the "Check out" > form and wait for autocomplete search results to display. > >- Patrons with a card number should be listed in the format: Surname, > First name (Card number) Address. > >- Patrons without a card number should be listed as: Surname, First > name Address. > >- Clicking on either kind of result should link you the checkout screen > for that patron. > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >Signed-off-by: Ian Walls <ian@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >index f91f734788..1ca12ff3c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >@@ -87,17 +87,17 @@ > var obj = $( "#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( "ui-autocomplete" ); > if( obj ) { > obj._renderItem = function( ul, item ) { >+ var cardnumber = ""; >+ if( item.cardnumber != "" ){ >+ // Display card number in parentheses if it exists >+ cardnumber = " (" + item.cardnumber + ") "; >+ } > return $( "<li></li>" ) > .data( "ui-autocomplete-item", item ) >- .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) >+ .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>" ) > .appendTo( ul ); > }; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23405
:
91894
|
91939
|
91940
|
92041