Bugzilla – Attachment 93835 Details for
Bug 23697
Add auto complete for patron search in patron module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23697: Add autocompletion search in patron module
Bug-23697-Add-autocompletion-search-in-patron-modu.patch (text/plain), 3.93 KB, created by
Katrin Fischer
on 2019-10-07 19:04:00 UTC
(
hide
)
Description:
Bug 23697: Add autocompletion search in patron module
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-10-07 19:04:00 UTC
Size:
3.93 KB
patch
obsolete
>From 327a05a1da9a0fe9a40500fe9bd1112f57c1f5dd Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Wed, 2 Oct 2019 14:21:00 +0200 >Subject: [PATCH] Bug 23697: Add autocompletion search in patron module >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > > Test plan: > > - Apply the patch > - Go to "Patrons" (members/members-home.pl) > - Check that autocomplete is enabled for patron search > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/includes/patron-search.inc | 12 ++++++----- > koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 24 ++++++++++++++++++++++ > 2 files changed, 31 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index bde60b4dd6..74908496c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -8,12 +8,14 @@ > <div id="patron_search" class="residentsearch"> > <p class="tip">Enter patron card number or partial name:</p> > <form action="/cgi-bin/koha/members/member.pl" method="post"> >- <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" /> >- <input type="hidden" name="quicksearch" value="1" /> >- <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span> >- <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span> >+ <div class="autocomplete"> >+ <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" /> >+ <input type="hidden" name="quicksearch" value="1" /> >+ <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span> >+ <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span> >+ <input value="Search" class="submit" type="submit" /> >+ </div> > >- <input value="Search" class="submit" type="submit" /> > > <div id="filters"> > <p><label for="searchfieldstype">Search fields:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >index c6e751b0f1..b08af98b5e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >@@ -95,8 +95,32 @@ $(document).ready(function(){ > $("#patronImageEdit .modal-title").text(modalTitle); > $("#patronImageEdit").modal("show"); > }); >+ >+ var obj = $( "#searchmember" ).autocomplete({ >+ source: "/cgi-bin/koha/circ/ysearch.pl", >+ minLength: 3, >+ select: function( event, ui ) { >+ window.location.href = ui.item.link; >+ } >+ }).data( "ui-autocomplete" ); >+ if( obj ) { >+ obj._renderItem = function( ul, item ) { >+ item.link = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber; >+ 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 href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) >+ .appendTo( ul ); >+ }; >+ } > }); > >+ >+ > function searchfield_date_tooltip(filter) { > var field = "#searchmember" + filter; > var type = "#searchfieldstype" + filter; >-- >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 23697
:
93443
|
93476
|
93721
|
93738
|
93739
|
93832
|
93833
|
93834
| 93835 |
93836
|
93837
|
93838