From 1395f1afbbbb8d065d6815a4b5f77100ae802c2d 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 ;) --- .../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 7b934facc7e..44d74f97e52 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 688b2b10900..0a3cec07946 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 %]