Bugzilla – Attachment 18947 Details for
Bug 10464
Patron search on placing a hold doesn't use jqueryui.autocomplete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10464 - Patron search on placing a hold should provide autocomplete
Bug-10464---Patron-search-on-placing-a-hold-should.patch (text/plain), 4.39 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-06-13 18:27:59 UTC
(
hide
)
Description:
Bug 10464 - Patron search on placing a hold should provide autocomplete
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-06-13 18:27:59 UTC
Size:
4.39 KB
patch
obsolete
>From 99c2ef8074b0a6cd1f39047e362e3ffbffce786a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 13 Jun 2013 14:20:43 -0300 >Subject: [PATCH] Bug 10464 - Patron search on placing a hold should provide > autocomplete >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >We should provide the autocomplete feature, already present for the circulation search >box, if CircAutocompl is properly set; and leave as it currently works otherwise of >course. > >This patch grabs the autocomplete handling javascript stuff from patron-search-box.inc >and puts an adjusted version on reserve/request.tt and also adjusts form and input >id's to match those configured in the autocomplete call. This changes where needed >due to name collisions with the patron-search-box.inc that is present everywhere. > >To test: >- On a biblio record, go to the Holds tab, mine looks like > /cgi-bin/koha/reserve/request.pl?biblionumber=2 >- A search box is shown for patron searching. >- Search for a patron: it works as usual. >- Make sure CircAutocompl is 'Don\'t try' >- Apply the patch >- Click the Holds tab again, and do the same search: functionality should remain intact. >- Change CircAutocompl to 'Try' >- Click the Holds tab again >- Autocomplete should show you the possible options, and once you choose one result, it should work as usual. > >Note: once you apply the patch the width of the search input field will be doubled. If you are oleonard and >prefer to stick with size=20, please amend the patch, I just prefered how it looked at size=40. > >Regards >To+ > >Edit: Wrapped the JavaScript code with [% UNLESS ( borrowernumber ) %] to fix the behaviour >on the case of rendering the placing hold page instead. > >Sponsored-by: Universidad Nacional de Córdoba >--- > .../prog/en/modules/reserve/request.tt | 38 ++++++++++++++++---- > 1 file changed, 31 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index f2c7564..2b986ad 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -130,6 +130,30 @@ function checkMultiHold() { > }); > > $('#hold-request-form').preventDoubleFormSubmit(); >+ >+[% UNLESS ( borrowernumber ) %] >+ [% IF ( CircAutocompl ) %] >+ $( "#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( "autocomplete" )._renderItem = function( ul, item ) { >+ return $( "<li></li>" ) >+ .data( "item.autocomplete", item ) >+ .append( "<a>" + item.surname + ", " + item.firstname + >+ " (" + item.cardnumber + ") <small>" + item.address + >+ " " + item.city + " " + item.zipcode + " " + >+ item.country + "</small></a>" ) >+ .appendTo( ul ); >+ }; >+ [% END %] >+[% END %] >+ > }); > > // ]]> >@@ -176,15 +200,15 @@ function checkMultiHold() { > [% IF ( messageborrower ) %] > <div class="dialog alert"><h3>Patron Not Found</h3><p>No patron with this name, please, try another</p> </div> > [% END %] >- <form action="request.pl?biblionumber=[% biblionumber %]" method="post"> >+ <form id="holds_patronsearch" action="request.pl?biblionumber=[% biblionumber %]" method="post"> > [% UNLESS borrower_list %] >- <fieldset class="brief"> >- <label for="patron">Patron: </label> >- <div class="hint">Enter patron card number or partial name:</div> >- <input type="text" size="20" id="patron" class="focus" name="findborrower" /> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ <fieldset class="brief"> >+ <label for="patron">Patron: </label> >+ <div class="hint">Enter patron card number or partial name:</div> >+ <input type="text" size="40" id="patron" class="focus" name="findborrower" /> > <input type="submit" value="Search" /> >- </fieldset> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ </fieldset> > [% ELSE %] > <fieldset> > <select size="7" name="borrowernumber"> >-- >1.7.9.5
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 10464
:
18946
|
18947
|
18982
|
19041
|
19042