Bug 34608 - Add sort1 and sort2 to patron search results
Summary: Add sort1 and sort2 to patron search results
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 34996 (view as bug list)
Depends on: 34478 35329
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-24 11:04 UTC by Owen Leonard
Modified: 2024-04-23 11:09 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 34608: Add sort1 and sort2 to patron search results (5.63 KB, patch)
2023-08-24 11:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: Add sort1 and sort2 to patron search results (5.79 KB, patch)
2023-09-07 19:16 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 34608: (follow-up) Display authorized values if used (3.06 KB, patch)
2023-11-01 17:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: Add sort1 and sort2 to patron search results (5.82 KB, patch)
2023-12-04 16:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: (follow-up) Display authorized values if used (3.06 KB, patch)
2023-12-04 16:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: (follow-up) Display authorized values if used (3.11 KB, patch)
2023-12-04 19:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 34608: Add sort1 and sort2 to patron search results (5.82 KB, patch)
2024-02-29 12:32 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: (follow-up) Display authorized values if used (3.11 KB, patch)
2024-02-29 12:32 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: (follow-up) Display authorized values if used (3.09 KB, patch)
2024-04-22 10:57 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34608: Display dropdown list if linked with AV cat (4.80 KB, patch)
2024-04-23 09:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34608: Display dropdown list if linked with AV cat (4.84 KB, patch)
2024-04-23 11:09 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-08-24 11:04:45 UTC
Some libraries would like the option of showing columns for sort1 and sort2 to patron search results.
Comment 1 Owen Leonard 2023-08-24 11:22:01 UTC Comment hidden (obsolete)
Comment 2 Emily-Rose Francoeur 2023-09-07 19:16:01 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2023-10-07 17:55:35 UTC
I really like this, but there is a small caveat:
This works for the case where the sort fields are used with free text input, but not when you are using it with the bsort1 and bsort2 authorized values.
Comment 4 Owen Leonard 2023-11-01 16:13:00 UTC
*** Bug 34996 has been marked as a duplicate of this bug. ***
Comment 5 Owen Leonard 2023-11-01 17:47:38 UTC Comment hidden (obsolete)
Comment 6 David Nind 2023-12-04 04:25:32 UTC
The patch no longer applies 8-(... 

git bz apply 34608

Bug 34608 - Add sort1 and sort2 to patron search results

155343 - Bug 34608: Add sort1 and sort2 to patron search results
158194 - Bug 34608: (follow-up) Display authorized values if used

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 34608: Add sort1 and sort2 to patron search results
Using index info to reconstruct a base tree...
M	admin/columns_settings.yml
M	koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
M	koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
Auto-merging admin/columns_settings.yml
error: Failed to merge in the changes.
Patch failed at 0001 Bug 34608: Add sort1 and sort2 to patron search results
Comment 7 Owen Leonard 2023-12-04 16:55:25 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2023-12-04 16:55:28 UTC Comment hidden (obsolete)
Comment 9 David Nind 2023-12-04 19:25:41 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2024-02-29 10:58:33 UTC
Can you rebase on top of bug 35329 please (PQA and will be pushed very soon)? I can help if needed.
Comment 11 Owen Leonard 2024-02-29 12:32:04 UTC
Created attachment 162592 [details] [review]
Bug 34608: Add sort1 and sort2 to patron search results

This patch adds the option of displaying patron "sort1" and
"sort2" statistical fields in the patron module's main search
results. The fields are hidden by default in the updated table
configuration.

To test, apply the patch and restart services.

- Go to Patrons and perform a search.
- You should not see columns for sort1 and sort2.
- Under the "Columns" button you should see options to display sort1 and
  sort2. Confirm that they work to show and hide the columns.
- Confirm that the sort1 and sort2 columns are sortable and searchable.

- Go to Administration -> Table settings.
- Under Patrons -> member, toggle the sort1 and sort1 "hidden by
  default" checkboxes and save the configuration.
- Return to patron search results to confirm that the columns are now
  shown by default.

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Comment 12 Owen Leonard 2024-02-29 12:32:06 UTC
Created attachment 162593 [details] [review]
Bug 34608: (follow-up) Display authorized values if used

This patch shamelessly steals from Bug 33568 in order to allow the
correct authorized value description to be shown in the JS-generated
table of results for values of borrowers sort1 and sort2.

To test, apply the patch and go to Administration -> Authorized values.

- Add some values, if necessary, to both the 'Bsort1' and 'Bsort2'
  categories.
- Locate some patron records to edit, and set the patron's "Sort 1" and
  "Sort 2" fields.
- Perform a patron search which will return those patron records.
  - Confirm that the correct authorized value description is shown
    instead of the authorized value code.
- Delete all values from the 'Bsort1' and 'Bsort2' authorized value
  categories.
- Return to your patron search and confirm that "Sort 1" and "Sort 2"
  values are still being shown, though now it's the "raw" code.

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 Owen Leonard 2024-02-29 12:32:39 UTC
Rebased on top of Bug 34478 and Bug 35329.
Comment 14 Owen Leonard 2024-04-22 10:57:30 UTC
Created attachment 165260 [details] [review]
Bug 34608: (follow-up) Display authorized values if used

This patch shamelessly steals from Bug 33568 in order to allow the
correct authorized value description to be shown in the JS-generated
table of results for values of borrowers sort1 and sort2.

To test, apply the patch and go to Administration -> Authorized values.

- Add some values, if necessary, to both the 'Bsort1' and 'Bsort2'
  categories.
- Locate some patron records to edit, and set the patron's "Sort 1" and
  "Sort 2" fields.
- Perform a patron search which will return those patron records.
  - Confirm that the correct authorized value description is shown
    instead of the authorized value code.
- Delete all values from the 'Bsort1' and 'Bsort2' authorized value
  categories.
- Return to your patron search and confirm that "Sort 1" and "Sort 2"
  values are still being shown, though now it's the "raw" code.
Comment 15 Jonathan Druart 2024-04-23 09:00:55 UTC
Shouldn't we have a dropdown in the column filter if it's linked with bsort1 category?
Otherwise we won't be able to search using the description.
Comment 16 Jonathan Druart 2024-04-23 09:20:08 UTC
Created attachment 165360 [details] [review]
Bug 34608: Display dropdown list if linked with AV cat

If at least one AV exists for bsort1 we will show a dropdown list in the
column filter for bsort1. Same for bsort2.
Comment 17 Jonathan Druart 2024-04-23 09:20:25 UTC
Owen, does this make sense for you?
Comment 18 Owen Leonard 2024-04-23 11:09:34 UTC
Created attachment 165375 [details] [review]
Bug 34608: Display dropdown list if linked with AV cat

If at least one AV exists for bsort1 we will show a dropdown list in
the column filter for bsort1. Same for bsort2.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>