Bug 34075

Summary: Allow specifying default tab view for authorities
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: MARC Authority data supportAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, kkrueger, mspinney
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/757
Text to go in the release notes:
This enhancement adds a new system preference DefaultAuthorityTab that allows libraries to choose which tab is selected first when viewing an authority record.
Version(s) released in:
23.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 35058    
Attachments: Bug 34075: Add DefaultAuthorityTab system preference
Bug 34075: Add DefaultAuthorityTab system preference
Bug 34075: Add DefaultAuthorityTab system preference
Bug 34075: (follow-up) Fixes for QA tool errors
Bug 34075: Add DefaultAuthorityTab system preference
Bug 34075: (follow-up) Fixes for QA tool errors
Bug 34075: Improve JS code

Description Nick Clemens (kidclamp) 2023-06-21 11:53:49 UTC
Currently the authorities page defaults to the first tab in the record, generally 0XX

Some libraries would like this to default to the 1XX, or other tabs
Comment 1 Nick Clemens (kidclamp) 2023-06-21 12:44:07 UTC
Created attachment 152518 [details] [review]
Bug 34075: Add DefaultAuthorityTab system preference

This patch adds a new system preference, DefaultAuthorityTab.
When set, this will choose the default display on the authorities details
page.

To test:
1 - Apply patch, update database
2 - View an authority detail
3 - You should default to the 0XX or first tab
4 - Set DefaultAuthorityTab to a number that there is no tab for in your authority
5 - Reload and verify details page loads the first tba
6 - Set DefaultAuthorityTab to 1XX or another tab that exists in your record
7 - Reload the details and confirm the correct tab is selected
Comment 2 Owen Leonard 2023-06-22 11:44:49 UTC
I don't see an atomicupdate with this. Should there be?
Comment 3 Nick Clemens (kidclamp) 2023-06-22 19:18:09 UTC
Created attachment 152582 [details] [review]
Bug 34075: Add DefaultAuthorityTab system preference

This patch adds a new system preference, DefaultAuthorityTab.
When set, this will choose the default display on the authorities details
page.

To test:
1 - Apply patch, update database
2 - View an authority detail
3 - You should default to the 0XX or first tab
4 - Set DefaultAuthorityTab to a number that there is no tab for in your authority
5 - Reload and verify details page loads the first tba
6 - Set DefaultAuthorityTab to 1XX or another tab that exists in your record
7 - Reload the details and confirm the correct tab is selected
Comment 4 Nick Clemens (kidclamp) 2023-06-22 19:18:31 UTC
(In reply to Owen Leonard from comment #2)
> I don't see an atomicupdate with this. Should there be?

Woops! Thanks Owen!
Comment 5 Sam Lau 2023-06-22 19:42:03 UTC
Created attachment 152584 [details] [review]
Bug 34075: Add DefaultAuthorityTab system preference

This patch adds a new system preference, DefaultAuthorityTab.
When set, this will choose the default display on the authorities details
page.

To test:
1 - Apply patch, update database
2 - View an authority detail
3 - You should default to the 0XX or first tab
4 - Set DefaultAuthorityTab to a number that there is no tab for in your authority
5 - Reload and verify details page loads the first tba
6 - Set DefaultAuthorityTab to 1XX or another tab that exists in your record
7 - Reload the details and confirm the correct tab is selected

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 6 Owen Leonard 2023-06-23 13:05:52 UTC
Created attachment 152633 [details] [review]
Bug 34075: (follow-up) Fixes for QA tool errors

- Added missing filter to template variable
- Correct spelling in atomicupdate
Comment 7 Jonathan Druart 2023-07-19 07:32:46 UTC
Created attachment 153625 [details] [review]
Bug 34075: Add DefaultAuthorityTab system preference

This patch adds a new system preference, DefaultAuthorityTab.
When set, this will choose the default display on the authorities details
page.

To test:
1 - Apply patch, update database
2 - View an authority detail
3 - You should default to the 0XX or first tab
4 - Set DefaultAuthorityTab to a number that there is no tab for in your authority
5 - Reload and verify details page loads the first tba
6 - Set DefaultAuthorityTab to 1XX or another tab that exists in your record
7 - Reload the details and confirm the correct tab is selected

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2023-07-19 07:32:48 UTC
Created attachment 153626 [details] [review]
Bug 34075: (follow-up) Fixes for QA tool errors

- Added missing filter to template variable
- Correct spelling in atomicupdate

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2023-07-19 07:32:51 UTC
Created attachment 153627 [details] [review]
Bug 34075: Improve JS code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2023-07-19 07:33:19 UTC
IMO this third patch improves the JS part. Feel free to drop it if you disagree.
Comment 11 Tomás Cohen Arazi (tcohen) 2023-10-10 13:56:20 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-10-12 20:59:14 UTC
Enhancement not pushed to 23.05.x