From 25d005be9398c4419858f7fde070de4985ee28fc 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 00e019de88..c64a7f5886 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -82,10 +82,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 be91ab7be7..19931dfbee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1350,6 +1350,10 @@ [% END %] +[% IF ( Koha.Preference('CatalogConcerns') ) %] +[% INCLUDE 'modals/add_catalog_concern.inc' %] +[% END %] + [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] @@ -1362,7 +1366,13 @@ [% Asset.js("js/resolve_claim_modal.js") | $raw %] [% END %] - + [% IF ( Koha.Preference('CatalogConcerns') ) %] + + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %]