Bug 36169

Summary: Add guarantee to patron categories with category type 'Staff'
Product: Koha Reporter: Alex Buckley <alexbuckley>
Component: PatronsAssignee: Alex Buckley <alexbuckley>
Status: Pushed to main --- QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, klehman, kyle.m.hall, lisette, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 36169: Patron categories with type='Staff' should be able to have guarantees
Bug 36169: Patron categories with type='Staff' should be able to have guarantees
Bug 36169: Patron categories with type='Staff' should be able to have guarantees
Bug 36169: Patron categories with type='Staff' should be able to have guarantees
Bug 36169: (QA follow-up) Tidy tests

Description Alex Buckley 2024-02-26 22:13:23 UTC
Currently the 'Add guarantee' link is only available if a patron account has a patron category with type='Adult' or 'Organisation' - see https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc#L13

It would be good if library staff - whose patron category has type='Staff' - could also see the link and add a guarantee as well.

Library staff belonging to a patron category with the type of 'Staff' is important because it adds a layer of protection to these accounts from being altered - a user must have the 'staffaccess' permission to change them. 

Therefore, it's not realistic to simply switch the library staff category to have type='Adult' so they can have guarantees added.
Comment 1 Alex Buckley 2024-02-27 02:58:59 UTC
Created attachment 162480 [details] [review]
Bug 36169: Patron categories with type='Staff' should be able to have guarantees

Library staff - whose patron category has a type='Staff' should be able to have guarantees added.

Test plan:
1) Create a 'Library staff' patron category with 'Category type' = 'Staff'

2) Create a patron account using the 'Library staff' patron category

3) Notice the '+ Add guarantee' button is not displayed in the members toolbar for the 'Library staff' patron you created

4) Apply patches and restart services

5) Refresh your browser window

6) Notice the '+ Add guarantee' button is now displaying for the 'Library staff' patron

7) Confirm you can successfully add a guarantee

8) Run unit test t/db_dependent/Koha/Patrons.t

Sponsored-By: Waitaki District Council, New Zealand
Comment 2 Lucas Gass 2024-03-01 17:35:14 UTC
Alex, I must not understand. What is the use case for STAFF adding a guarantee?
Comment 3 Alex Buckley 2024-03-12 03:59:13 UTC
(In reply to Lucas Gass from comment #2)
> Alex, I must not understand. What is the use case for STAFF adding a
> guarantee?

Hi Lucas, thanks for your question. 

We have a partner library where the librarians each have a Koha account belonging to the patron category 'Library staff' (this category has the type = 'staff' so the accounts cannot be so easily deleted). 

However, as their librarian have children registered at the library they would like to link their children's accounts to their 'Library staff' accounts. 

i.e. they do not want to have to manage two patron accounts: a 'Library staff' account and an 'Adult' account in order to add their children as guarantees.

Does that help clarify the use case?
Comment 4 Lisette Scheer 2024-03-28 19:46:00 UTC
Additionally, staff might use it like this:

Main tech services account/tech services manager is guarantor to all the people they manage. 
This way they can easily find all the checkouts in one place for the department.
Comment 5 Kathleen L. 2024-03-29 18:48:29 UTC
Comment to echo that this is being requested by our staff as well. Many have children and would like to be able to be able to see their kiddos' checkouts from their own accounts.
Comment 6 HKS3 Tadeusz Sośnierz 2024-05-10 11:27:48 UTC
Created attachment 166529 [details] [review]
Bug 36169: Patron categories with type='Staff' should be able to have guarantees

Library staff - whose patron category has a type='Staff' should be able to have guarantees added.

Test plan:
1) Create a 'Library staff' patron category with 'Category type' = 'Staff'

2) Create a patron account using the 'Library staff' patron category

3) Notice the '+ Add guarantee' button is not displayed in the members toolbar for the 'Library staff' patron you created

4) Apply patches and restart services

5) Refresh your browser window

6) Notice the '+ Add guarantee' button is now displaying for the 'Library staff' patron

7) Confirm you can successfully add a guarantee

8) Run unit test t/db_dependent/Koha/Patrons.t

Sponsored-By: Waitaki District Council, New Zealand
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Comment 7 Kyle M Hall 2024-07-19 18:07:35 UTC
Created attachment 169253 [details] [review]
Bug 36169: Patron categories with type='Staff' should be able to have guarantees

Library staff - whose patron category has a type='Staff' should be able to have guarantees added.

Test plan:
1) Create a 'Library staff' patron category with 'Category type' = 'Staff'

2) Create a patron account using the 'Library staff' patron category

3) Notice the '+ Add guarantee' button is not displayed in the members toolbar for the 'Library staff' patron you created

4) Apply patches and restart services

5) Refresh your browser window

6) Notice the '+ Add guarantee' button is now displaying for the 'Library staff' patron

7) Confirm you can successfully add a guarantee

8) Run unit test t/db_dependent/Koha/Patrons.t

Sponsored-By: Waitaki District Council, New Zealand
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall 2024-07-19 18:09:57 UTC
Created attachment 169254 [details] [review]
Bug 36169: Patron categories with type='Staff' should be able to have guarantees

Library staff - whose patron category has a type='Staff' should be able to have guarantees added.

Test plan:
1) Create a 'Library staff' patron category with 'Category type' = 'Staff'

2) Create a patron account using the 'Library staff' patron category

3) Notice the '+ Add guarantee' button is not displayed in the members toolbar for the 'Library staff' patron you created

4) Apply patches and restart services

5) Refresh your browser window

6) Notice the '+ Add guarantee' button is now displaying for the 'Library staff' patron

7) Confirm you can successfully add a guarantee

8) Run unit test t/db_dependent/Koha/Patrons.t

Sponsored-By: Waitaki District Council, New Zealand
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2024-07-19 18:10:03 UTC
Created attachment 169255 [details] [review]
Bug 36169: (QA follow-up) Tidy tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Katrin Fischer 2024-08-09 16:49:08 UTC
Pushed for 24.11!

Well done everyone, thank you!