From b708776eb02eb0e655756bd1f11c7bbf2f9ef08f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Jan 2026 11:21:18 +0100 Subject: [PATCH] Bug 41562: Introduce "stores" for regular javascript We already have "Stores" in Vue, here we are going to use a shared object to store permissions and sysrepfs For follow-up bug reports we will have the need to store syspref's values and permissions. It seems a good idea to have a "store" to share the permissions and system preferences' values we need for the current page. Several "script" tag can coexist and define their own permissions or sysprefs. Added on its own bug for reusability purpose. Test plan: Test follow-up bug reports ;) Signed-off-by: Owen Leonard Signed-off-by: Paul Derscheid Signed-off-by: Lucas Gass --- .../prog/en/includes/doc-head-close.inc | 1 + .../en/includes/installer-doc-head-close.inc | 1 + koha-tmpl/intranet-tmpl/prog/js/stores.js | 23 +++++++++++++++++++ .../bootstrap/en/includes/doc-head-close.inc | 1 + .../bootstrap/en/modules/sci/sci-main.tt | 1 + .../bootstrap/en/modules/sco/help.tt | 1 + .../bootstrap/en/modules/sco/printslip.tt | 1 + .../bootstrap/en/modules/sco/sco-main.tt | 1 + koha-tmpl/opac-tmpl/bootstrap/js/stores.js | 23 +++++++++++++++++++ 9 files changed, 53 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/stores.js create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/stores.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index 7b934facc7..44d74f97e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -47,6 +47,7 @@ [% END %] [% Asset.js('js/Gettext.js') | $raw %] [% Asset.js('js/i18n.js') | $raw %] +[% Asset.js('js/stores.js') | $raw %] [% IF ( login ) %] [% Asset.css("css/login.css") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc index 688b2b1090..0a3cec0794 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc @@ -18,6 +18,7 @@ [% END %] [% Asset.js('js/Gettext.js') | $raw %] [% Asset.js('js/i18n.js') | $raw %] +[% Asset.js('js/stores.js') | $raw %]