Summary: | Patron search on placing a hold doesn't use jqueryui.autocomplete | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Templates | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | minor | ||
Priority: | P5 - low | CC: | bgkriegel, chrish, gmcharlt |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | Sponsored | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 10464 - Patron search on placing a hold should provide autocomplete
Bug 10464 - Patron search on placing a hold should provide autocomplete Bug 10464 - Patron search on placing a hold should provide autocomplete Bug 10464 - Patron search on placing a hold should provide autocomplete [PASSED QA] Bug 10464 - Patron search on placing a hold should provide autocomplete |
Description
Tomás Cohen Arazi (tcohen)
2013-06-13 17:00:10 UTC
Created attachment 18946 [details] [review] Bug 10464 - Patron search on placing a hold should provide autocomplete 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+ Sponsored-by: Universidad Nacional de Córdoba Created attachment 18947 [details] [review] Bug 10464 - Patron search on placing a hold should provide autocomplete 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 Created attachment 18982 [details] [review] Bug 10464 - Patron search on placing a hold should provide autocomplete 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 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Hi Tomas, I really like the idea :) But I have found something that I'd like you to investigate: When sending the form without waiting for the autocomplete to take place (I used 's') you get to the suggestion list that Koha already did before your patch. This is good because I think it works without Javascript, so is a good fallback. But when I am on this screen, there is a Javascript error in my Firebug console: $(...).autocomplete(...).data(...) is undefined Line 335 Could you take a look? If it's not too much of a rewrite to fix, you can switch back to 'signed off'. Created attachment 19041 [details] [review] Bug 10464 - Patron search on placing a hold should provide autocomplete 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 || borrower_list ) %] to fix the behaviour on the case of rendering the placing hold page instead. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 19042 [details] [review] [PASSED QA] Bug 10464 - Patron search on placing a hold should provide autocomplete 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 || borrower_list ) %] to fix the behaviour on the case of rendering the placing hold page instead. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Adding a nice new autocomplete feature. Pushed to master. Thanks, Tomás! A refactoring to consider in the near future is tweaking the patron search auto-complete JavaScript so that it can be contained in an include template rather than duplicating it among the following templates: koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt p Local template variables can be set via a TT include directive to set the form element IDs to apply the JavaScript to. This patch has been pushed to 3.12.x, will be in 3.12.2. Pushed to 3.10.x, will be in 3.10.8 Pushed to 3.8.x, will be in 3.8.15 |