Bug 36582 - Add option to set library, desk, and register from user menu
Summary: Add option to set library, desk, and register from user menu
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: Academy
Depends on: 30123
Blocks:
  Show dependency treegraph
 
Reported: 2024-04-11 15:19 UTC by Owen Leonard
Modified: 2024-04-25 16:28 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Screen recording showing the menu interaction (215.62 KB, image/gif)
2024-04-11 15:19 UTC, Owen Leonard
Details
Bug 36582: Add option to set library, desk, and register from user menu (22.13 KB, patch)
2024-04-15 17:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36582: Add option to set library, desk, and register from user menu (22.57 KB, patch)
2024-04-22 10:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36582: Add option to set library, desk, and register from user menu (21.65 KB, patch)
2024-04-23 11:20 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36582: Add option to set library, desk, and register from user menu (22.84 KB, patch)
2024-04-25 16:28 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2024-04-11 15:19:06 UTC
Created attachment 164769 [details]
Screen recording showing the menu interaction

I'm proposing a change to the staff interface's user dropdown menu so that one can set their library, desk, and register right from the dropdown menu. See the attached gif.
Comment 1 Lucas Gass 2024-04-11 15:26:34 UTC
Big +1 from me.
Comment 2 Katrin Fischer 2024-04-13 10:56:36 UTC
+2 :)
Comment 3 Owen Leonard 2024-04-15 17:00:34 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2024-04-15 17:01:13 UTC
This is technically BLOCKED but I thought I'd get eyes on it since it's otherwise ready.
Comment 5 Martin Renvoize 2024-04-19 05:18:18 UTC
Nice
Comment 6 Owen Leonard 2024-04-22 10:59:34 UTC
Created attachment 165261 [details] [review]
Bug 36582: Add option to set library, desk, and register from user menu

This patch adds an expandable "panel" in the user dropdown menu in the
staff client. Expanding the panel will load the form from
set-library.pl, including library, desk and register options if present.

The patch moves the contents of desk_selection.js and
register_selection.js into staff-global.js so that the functionality is
available on every page.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Test plan stolen from Bug 36572:

1. Have 3 staff accounts to test:
  -STAFF A: superlibrarian
  -STAFF B: loggedinlibrary permission
  -STAFF C: no loggedinlibrary or superlibrarian permission
2. Enable 'UseCirculationDesks' and create some desks. (Admin >
   Circulation desks)
3. Enable 'UseCashRegisters' and create some registers ( Admin > Cash
   registers)
4. Use STAFF A ( superlibrarian ) and make sure you can change branch,
   desk and register.
5. Use STAFF B ( loggedinlibrary permission ) and make sure you can
   change branch, desk and register.
6. Use STAFF C ( no loggedinlibrary or superlibrarian permission ) and
   make sure you can change branch, desk and register.
7. Each time you change you should be redirected to the page you were
   previously on.
8. Turn off UseCirculationDesks, make sure everything still works.
9. Turn off UseCashRegisters, make sure everthing still works.
Comment 7 Owen Leonard 2024-04-23 11:20:02 UTC
Created attachment 165377 [details] [review]
Bug 36582: Add option to set library, desk, and register from user menu

This patch adds an expandable "panel" in the user dropdown menu in the
staff client. Expanding the panel will load the form from
set-library.pl, including library, desk and register options if present.

The patch moves the contents of desk_selection.js and
register_selection.js into staff-global.js so that the functionality is
available on every page.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Test plan stolen from Bug 36572:

1. Have 3 staff accounts to test:
  -STAFF A: superlibrarian
  -STAFF B: loggedinlibrary permission
  -STAFF C: no loggedinlibrary or superlibrarian permission
2. Enable 'UseCirculationDesks' and create some desks. (Admin >
   Circulation desks)
3. Enable 'UseCashRegisters' and create some registers ( Admin > Cash
   registers)
4. Use STAFF A ( superlibrarian ) and make sure you can change branch,
   desk and register.
5. Use STAFF B ( loggedinlibrary permission ) and make sure you can
   change branch, desk and register.
6. Use STAFF C ( no loggedinlibrary or superlibrarian permission ) and
   make sure you can change branch, desk and register.
7. Each time you change you should be redirected to the page you were
   previously on.
8. Turn off UseCirculationDesks, make sure everything still works.
9. Turn off UseCashRegisters, make sure everthing still works.
Comment 8 Lucas Gass 2024-04-23 14:21:06 UTC
Not a blocker but a question. If I log in as STAFF C ( not a superlibrarian and no logged in library permission ) I don't see the gear icon for switching desk/register but if I visit circ/set-library.pl I can set either my desk or register. Is this the intended behavior?
Comment 9 Owen Leonard 2024-04-23 14:47:23 UTC
Yes the logic needs to be a little more complex.
Comment 10 Brendan Lawlor 2024-04-23 15:00:32 UTC
The interface for this is a big improvement. Nice!

I think there is a currently a small bug in the register_selection.js that needs to be fixed for this to work.

With this patch applied it's possible to set your cash register to one that is not associated with the branch that is selected.

To reproduce:
1. Create a few circulation desks and cash registers
2. Set your circulation desk and cash register for library A
3. Return to the set library page and choose library B
4. Notice the cash registers options have updated for library B but the default selected cash register did not change
5. Clicking submit sets the cash register to one that should not be available for library A
Comment 11 Owen Leonard 2024-04-25 16:28:52 UTC
Created attachment 165573 [details] [review]
Bug 36582: Add option to set library, desk, and register from user menu

This patch adds an expandable "panel" in the user dropdown menu in the
staff client. Expanding the panel will load the form from
set-library.pl, including library, desk and register options if present.

The patch moves the contents of desk_selection.js and
register_selection.js into staff-global.js so that the functionality is
available on every page.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Test plan stolen from Bug 36572:

1. Have 3 staff accounts to test:
  -STAFF A: superlibrarian
  -STAFF B: loggedinlibrary permission
  -STAFF C: no loggedinlibrary or superlibrarian permission
2. Enable 'UseCirculationDesks' and create some desks. (Admin >
   Circulation desks)
3. Enable 'UseCashRegisters' and create some registers ( Admin > Cash
   registers)
4. Use STAFF A ( superlibrarian ) and make sure you can change branch,
   desk and register.
5. Use STAFF B ( loggedinlibrary permission ) and make sure you can
   change branch, desk and register.
6. Use STAFF C ( no loggedinlibrary or superlibrarian permission ) and
   make sure you can change branch, desk and register.
7. Each time you change you should be redirected to the page you were
   previously on.
8. Turn off UseCirculationDesks, make sure everything still works.
9. Turn off UseCashRegisters, make sure everthing still works.