From 43804c49cfcaf9a94942ea44bdbd169579ea4a32 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 26 Jan 2024 18:14:04 +0000 Subject: [PATCH] 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. --- .../prog/css/src/staff-global.scss | 57 ++++++++++++- .../intranet-tmpl/prog/en/includes/header.inc | 81 ++++++++++++------- .../prog/en/includes/html_helpers.inc | 2 +- .../prog/en/modules/circ/set-library.tt | 22 +++-- .../prog/en/modules/intranet-main.tt | 4 +- .../intranet-tmpl/prog/js/desk_selection.js | 29 ------- .../prog/js/register_selection.js | 27 ------- .../intranet-tmpl/prog/js/staff-global.js | 74 +++++++++++++++++ 8 files changed, 193 insertions(+), 103 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/desk_selection.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/register_selection.js diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 28beabafc7f..1ee0b46a96a 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4351,7 +4351,7 @@ input.renew { left: 0; right: 0; bottom: 0; - background-color: #ccc; + background-color: #CCC; -webkit-transition: .4s; transition: .4s; border-radius: 34px; @@ -4695,6 +4695,61 @@ div .suggestion_note { } } +#set_library_controls { + align-items: center; + display: flex; + + div:first-child { + flex-grow: 1; + } + + a.btn { + border-radius: 0; + font-size: 13px; + } +} + +#setlibrary_panel { + .setlibrary_panel_open { + border-bottom:1px solid #CCC; + border-top:1px solid #CCC; + } + + fieldset { + background-color: #554B4D; + margin: 0; + + &.rows { + float: none; + padding: 0; + width: auto; + } + + &.action { + padding: .5em 0 1em 1em; + } + } + + legend { + display: none; + } + + label { + color: #FFF; + display: block; + float: none; + font-weight: normal; + margin: 0; + padding-bottom: .2em; + text-align: left; + width: unset; + } + + select { + width: 80%; + } +} + @import "header"; @import "toolbar"; @import "forms"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index b08087fccfa..ac420bef39f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -3,6 +3,7 @@ [% USE Desks %] [% USE Registers %] [% USE Koha %] +[% PROCESS 'i18n.inc' %] [% IF Koha.Preference( 'CookieConsent' ) %] [% USE JSConsents %] [% END %] @@ -85,7 +86,7 @@