Bug 35517 - Choose correct default header search tab according to permissions
Summary: Choose correct default header search tab according to permissions
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-07 18:14 UTC by Owen Leonard
Modified: 2024-01-19 22:30 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the display of the header search form on the staff interface home page so that staff patrons with different permissions will see the correct tab in the header search form. Previously, the default was to display the check out search - if they didn't have circulation permissions, the search tabs were initially hidden.
Version(s) released in:
24.05.00,23.11.02


Attachments
Bug 35517: Choose correct default header search tab according to permissions (3.91 KB, patch)
2023-12-07 18:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35517: Choose correct default header search tab according to permissions (3.96 KB, patch)
2023-12-08 19:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 35517: Choose correct default header search tab according to permissions (4.02 KB, patch)
2024-01-08 23:40 UTC, Victor Grousset/tuxayo
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-12-07 18:14:20 UTC
On the staff interface home page the default header search box is the checkout one. But if the user doesn't have circulation permission the search tabs are initially hidden.
Comment 1 Owen Leonard 2023-12-07 18:29:17 UTC
Created attachment 159661 [details] [review]
Bug 35517: Choose correct default header search tab according to permissions

This patch adds some additional template logic to the header search form
for the staff interface home page so that users with different
permissions will see the correct tab in the header search form.

To test, apply the patch and view the staff interface home page using a
user with different permissions:

- 'catalogue' and 'circulate'
  - Header should show circulation search
- 'catalogue' and 'borrowers'
  - Header should show patron search
- 'catalogue' only
  - Header should show catalog search
Comment 2 David Nind 2023-12-08 19:09:12 UTC
Created attachment 159677 [details] [review]
Bug 35517: Choose correct default header search tab according to permissions

This patch adds some additional template logic to the header search form
for the staff interface home page so that users with different
permissions will see the correct tab in the header search form.

To test, apply the patch and view the staff interface home page using a
user with different permissions:

- 'catalogue' and 'circulate'
  - Header should show circulation search
- 'catalogue' and 'borrowers'
  - Header should show patron search
- 'catalogue' only
  - Header should show catalog search

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Victor Grousset/tuxayo 2024-01-06 21:15:03 UTC
How should this interact with Bug 30230 ?

Just do the following substitution?
(CAN_user_borrowers_edit_borrowers)
↓↓
(CAN_user_borrowers_edit_borrowers) || (CAN_user_borrowers_list_borrowers)
Comment 4 Owen Leonard 2024-01-08 11:32:38 UTC
(In reply to Victor Grousset/tuxayo from comment #3)

> (CAN_user_borrowers_edit_borrowers) || (CAN_user_borrowers_list_borrowers)

That looks correct to me. In either case the user should have access to the patron search tab.
Comment 5 Victor Grousset/tuxayo 2024-01-08 23:40:54 UTC
Created attachment 160671 [details] [review]
Bug 35517: Choose correct default header search tab according to permissions

This patch adds some additional template logic to the header search form
for the staff interface home page so that users with different
permissions will see the correct tab in the header search form.

To test, apply the patch and view the staff interface home page using a
user with different permissions:

- 'catalogue' and 'circulate'
  - Header should show circulation search
- 'catalogue' and 'borrowers'
  - Header should show patron search
- 'catalogue' only
  - Header should show catalog search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2024-01-08 23:41:11 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 7 Katrin Fischer 2024-01-11 13:06:13 UTC
(In reply to Owen Leonard from comment #4)
> (In reply to Victor Grousset/tuxayo from comment #3)
> 
> > (CAN_user_borrowers_edit_borrowers) || (CAN_user_borrowers_list_borrowers)
> 
> That looks correct to me. In either case the user should have access to the
> patron search tab.

This patch has not been pushed yet, I'll keep it in mind! (Waiting for a not hard follow-up... )
Comment 8 Katrin Fischer 2024-01-11 14:50:03 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-01-15 14:13:31 UTC
Pushed to 23.11.x for 23.11.02
Comment 10 Victor Grousset/tuxayo 2024-01-15 21:18:44 UTC
(In reply to Katrin Fischer from comment #7)
> This patch has not been pushed yet, I'll keep it in mind! (Waiting for a not
> hard follow-up... )

It wasn't sure at the time of my 1st message here which one would be merged first. But when I QAed this one, I left a comment on bug 30230 to say that it needs a change.
Comment 11 Lucas Gass 2024-01-19 22:30:55 UTC
Quite a few merge conflicts with 23.05.x, no backport. If needed please rebase.