Bug 23697 - Add auto complete for patron search in patron module
Summary: Add auto complete for patron search in patron module
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Matthias Meusburger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 26125
  Show dependency treegraph
 
Reported: 2019-09-30 10:24 UTC by delaye
Modified: 2021-06-14 21:28 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds an optional auto-complete function to the patron search field when in the patrons module. The `CircAutocompl` system preference is renamed to `PatronAutoComplete` and use for both the circulation and patrons module auto-complete.
Version(s) released in:
19.11.00


Attachments
Bug 23697: Add autocompletion search in patron module (3.66 KB, patch)
2019-10-02 12:24 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 23697: Add autocompletion search in patron module (3.73 KB, patch)
2019-10-02 13:35 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 23697, Follow-up: Add autocompletion search in patron module (13.89 KB, patch)
2019-10-04 09:17 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 23697: Add autocompletion search in patron module (3.86 KB, patch)
2019-10-04 10:12 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 23697, Follow-up: Add autocompletion search in patron module (14.09 KB, patch)
2019-10-04 10:12 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 23697: Add autocompletion search in patron module (3.92 KB, patch)
2019-10-07 19:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: (follow-up) Add autocompletion search in patron module (14.16 KB, patch)
2019-10-07 19:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete (10.63 KB, patch)
2019-10-07 19:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: Add autocompletion search in patron module (3.93 KB, patch)
2019-10-07 19:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: (follow-up) Add autocompletion search in patron module (14.23 KB, patch)
2019-10-07 19:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete (10.72 KB, patch)
2019-10-07 19:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23697: (QA follow-up) Fix quotes in database update statement (1.08 KB, patch)
2019-10-07 19:04 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description delaye 2019-09-30 10:24:11 UTC
How add autocompletion search in patron module.

with jquery it's possible like this

$(document).ready(function(){
  $( '#searchmember' ).autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/cgi-bin/koha/circ/ysearch.pl",
        dataType: "json",
        data: {
          term: request.term
        
        },
        success: function(data) {
          response( $.map( data, function( item ) {
            return {
              label: item.surname + " , " + item.firstname + " .-Date of birth naissance: " + item.dateofbirth + " .-Address: " + item.address + " .-City:" + item.city,
              value: item.surname + " " + item.firstname
            }
          }));
        }
      });
    },
    minLength: 1,
  });
});
Comment 1 Matthias Meusburger 2019-10-02 12:24:01 UTC
Created attachment 93443 [details] [review]
Bug 23697: Add autocompletion search in patron module

 Test plan:

  - Apply the patch
  - Go to "Patrons" (members/members-home.pl)
  - Check that autocomplete is enabled for patron search
Comment 2 Lucas Gass 2019-10-02 13:35:27 UTC
Created attachment 93476 [details] [review]
Bug 23697: Add autocompletion search in patron module

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>
Comment 3 Katrin Fischer 2019-10-02 16:03:14 UTC
This works fine!

Just have a little 'but': For the patron auto-complete we got a system preference to turn the feature off: CircAutocompl

So my question would be: Should we also use this pref here? Does it need a pref?

I am setting 'Failed QA' - let's discuss this quickly tomorrow. Also adding Owen in CC as he might know about the reasoning behind the pref in circulation.
Comment 4 Katrin Fischer 2019-10-02 16:17:54 UTC
After discussing with Owen, I think it would be best if we use the pref for this as well and update the wording of the pref a little bit to cover both.

Matts, could you provide a follow-up please?
Comment 5 Matthias Meusburger 2019-10-03 07:46:03 UTC
Any hint on what the syspref should be renamed to? 

PatronAutoCompl? 

And why not PatronAutoCompletion, since truncated words are ugly and may me meaningless to some people?
Comment 6 Katrin Fischer 2019-10-03 08:01:47 UTC
(In reply to Matthias Meusburger from comment #5)
> Any hint on what the syspref should be renamed to? 
> 
> PatronAutoCompl? 
> 
> And why not PatronAutoCompletion, since truncated words are ugly and may me
> meaningless to some people?

I actually meant only correcting the description (although you have a point about it being a bit ugly :) )

Now: 

[Don't try|Try] to guess the patron being entered while typing a patron search on the circulation screen. Only returns the first 10 results at a time. 

Maybe change to:

[Don't try|Try] to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.
Comment 7 David Nind 2019-10-03 08:43:35 UTC
How about:

[Don't try|Try] to guess the patron when typing a name in the circulation check out and patron search screens. Only shows the first 10 results.

Like the idea of making the preference name PatronAutoCompletion.
Comment 8 Matthias Meusburger 2019-10-04 09:17:48 UTC
Created attachment 93721 [details] [review]
Bug 23697, Follow-up: Add autocompletion search in patron module

 - Rename CircAutocompl system preference to PatronAutocompletion
 - Take this system preference into consideration for patron search
Comment 9 Biblibre Sandboxes 2019-10-04 10:12:11 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 10 Biblibre Sandboxes 2019-10-04 10:12:41 UTC
Created attachment 93738 [details] [review]
Bug 23697: Add autocompletion search in patron module

 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>
Comment 11 Biblibre Sandboxes 2019-10-04 10:12:44 UTC
Created attachment 93739 [details] [review]
Bug 23697, Follow-up: Add autocompletion search in patron module

 - Rename CircAutocompl system preference to PatronAutocompletion
 - Take this system preference into consideration for patron search

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 12 Katrin Fischer 2019-10-07 19:02:16 UTC
Created attachment 93832 [details] [review]
Bug 23697: Add autocompletion search in patron module

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>
Comment 13 Katrin Fischer 2019-10-07 19:02:24 UTC
Created attachment 93833 [details] [review]
Bug 23697: (follow-up) Add autocompletion search in patron module

- Rename CircAutocompl system preference to PatronAutocompletion
 - Take this system preference into consideration for patron search

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2019-10-07 19:02:29 UTC
Created attachment 93834 [details] [review]
Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete

Just a find and replace on the changed system preference name.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2019-10-07 19:04:00 UTC
Created attachment 93835 [details] [review]
Bug 23697: Add autocompletion search in patron module

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>
Comment 16 Katrin Fischer 2019-10-07 19:04:05 UTC
Created attachment 93836 [details] [review]
Bug 23697: (follow-up) Add autocompletion search in patron module

 - Rename CircAutocompl system preference to PatronAutocompletion
 - Take this system preference into consideration for patron search

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2019-10-07 19:04:10 UTC
Created attachment 93837 [details] [review]
Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete

Just a find and replace on the changed system preference name.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2019-10-07 19:04:14 UTC
Created attachment 93838 [details] [review]
Bug 23697: (QA follow-up) Fix quotes in database update statement
Comment 19 Martin Renvoize 2019-10-08 13:53:32 UTC
Nice work!

Pushed to master for 19.11.00