Bug 35444 - Add easy way to retrieve a logged in user's categorycode
Summary: Add easy way to retrieve a logged in user's categorycode
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Emily Lamancusa (emlam)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-29 23:18 UTC by Lucas Gass (lukeg)
Modified: 2024-05-28 15:54 UTC (History)
4 users (show)

See Also:
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 (1.50 KB, patch)
2023-11-29 23:22 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 35444: Add hidden span with information about the loggedinuser categorycode (1.56 KB, patch)
2023-12-05 16:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35444: Add hidden span with information about the loggedinuser categorycode (1.63 KB, patch)
2024-01-25 17:49 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 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 (lukeg) 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 (emlam) 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 (emlam) 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 (lukeg) 2024-05-28 15:54:39 UTC
Enhancement won't be backported to 23.05.x