Bug 35444

Summary: Add easy way to retrieve a logged in user's categorycode
Product: Koha Reporter: Lucas Gass <lucas>
Component: Staff interfaceAssignee: Lucas Gass <lucas>
Status: RESOLVED FIXED QA Contact: Emily Lamancusa <emily.lamancusa>
Severity: enhancement    
Priority: P5 - low CC: dcook, emily.lamancusa, fridolin.somers, gmcharlt
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This adds a hidden span to the HTML source code of the staff interface that includes the patron category code of the currently logged in staff user.
Version(s) released in:
24.05.00,23.11.06
Circulation function:
Attachments: Bug 35444: Add hidden span with information about the loggedinuser categorycode
Bug 35444: Add hidden span with information about the loggedinuser categorycode
Bug 35444: Add hidden span with information about the loggedinuser categorycode

Description Lucas Gass 2023-11-29 23:18:28 UTC
It would be useful when customizing Koha if we could easily know what the category code of the logged in user.
Comment 1 Lucas Gass 2023-11-29 23:22:26 UTC
Created attachment 159380 [details] [review]
Bug 35444: Add hidden span with information about the loggedinuser categorycode

To test:
1. APPLY PATCH
2. Log into the staff interface and use the browser's dev tools to look for the HTML class 'loggedincategorycode'. It should match the current logged in user's categorycode.
3. You could also use a console.log like so:

console.log( $('.loggedincategorycode').text() );
Comment 2 David Cook 2023-11-30 01:36:53 UTC
That could be interesting. Are you thinking mostly in terms of CSS or something else?
Comment 3 Owen Leonard 2023-12-05 16:43:14 UTC
Created attachment 159597 [details] [review]
Bug 35444: Add hidden span with information about the loggedinuser categorycode

To test:
1. APPLY PATCH
2. Log into the staff interface and use the browser's dev tools to look
   for the HTML class 'loggedincategorycode'. It should match the
   current logged in user's categorycode.
3. You could also use a console.log like so:

console.log( $('.loggedincategorycode').text() );

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Emily Lamancusa 2024-01-25 17:49:58 UTC
Created attachment 161454 [details] [review]
Bug 35444: Add hidden span with information about the loggedinuser categorycode

To test:
1. APPLY PATCH
2. Log into the staff interface and use the browser's dev tools to look
   for the HTML class 'loggedincategorycode'. It should match the
   current logged in user's categorycode.
3. You could also use a console.log like so:

console.log( $('.loggedincategorycode').text() );

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 5 Emily Lamancusa 2024-01-25 17:51:07 UTC
Trivial change, QA script happy. Passing QA.
Comment 6 Katrin Fischer 2024-03-22 14:48:18 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-05-23 08:07:05 UTC
Pushed to 23.11.x for 23.11.06

Very useful :D
Comment 8 David Cook 2024-05-26 23:30:21 UTC
Sometimes, I think that we should create an API to provide information about the logged in user...
Comment 9 Lucas Gass 2024-05-28 15:54:39 UTC
Enhancement won't be backported to 23.05.x