From c62a5515d4f1bb85b40b2941d5e9295a4dad68cf Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 16 Aug 2022 12:36:55 +0100 Subject: [PATCH] Bug 31028: Add 'Add catalog concern' to cataloguing toolbar This patch moves the add concern modal js and template markup into their own files and then references them to add the 'Add concern' option to the cataloguing toolbar. --- .../prog/en/includes/cat-toolbar.inc | 5 +- .../includes/modals/add_catalog_concern.inc | 36 +++++++++++ .../prog/en/modules/catalogue/ISBDdetail.tt | 11 ++++ .../prog/en/modules/catalogue/MARCdetail.tt | 10 ++++ .../prog/en/modules/catalogue/detail.tt | 11 ++++ .../prog/en/modules/catalogue/imageviewer.tt | 11 ++++ .../en/modules/catalogue/labeledMARCdetail.tt | 11 ++++ .../prog/en/modules/catalogue/moredetail.tt | 11 ++++ .../prog/en/modules/cataloguing/concerns.tt | 59 +------------------ .../prog/en/modules/circ/returns.tt | 12 +++- .../prog/js/modals/add_catalog_concern.js | 26 ++++++++ 11 files changed, 144 insertions(+), 59 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/js/modals/add_catalog_concern.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index a1ca101dba..b9a4c3184f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -2,7 +2,7 @@ [% INCLUDE 'blocking_errors.inc' %]
-[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_serials_create_subscription ) %] +[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_serials_create_subscription || Koha.Preference('CatalogConcerns') ) %]
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc new file mode 100644 index 0000000000..10bf54c9bb --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc @@ -0,0 +1,36 @@ + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index 1b92e5b512..11e0567a4c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -85,10 +85,21 @@
+ [% IF ( Koha.Preference('CatalogConcerns') ) %] + [% INCLUDE 'modals/add_catalog_concern.inc' %] + [% END %] + [% MACRO jsinclude BLOCK %] [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] [% Asset.js("js/browser.js") | $raw %] + [% IF ( Koha.Preference('CatalogConcerns') ) %] + + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 445f02a4e1..a7f02a8e4c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1355,6 +1355,10 @@ [% END %] +[% IF ( Koha.Preference('CatalogConcerns') ) %] +[% INCLUDE 'modals/add_catalog_concern.inc' %] +[% END %] + [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] @@ -1367,7 +1371,13 @@ [% Asset.js("js/resolve_claim_modal.js") | $raw %] [% END %] - + [% IF ( Koha.Preference('CatalogConcerns') ) %] + + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %]