From 2c8f13fee2de3c345713e151ee419f3353b1e8e4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 25 Oct 2022 15:33:04 +0100 Subject: [PATCH] Bug 31028: Add ability to report concerns from the staff interface This patch brings the CatalogConcerns feature to the staff client allowing non-cataloguers to report issues with catalog records from the record details page. Test plan 1) Enable the new `CatalogConcerns` system preference 2) Confirm that without the `edit_catalogue` permission your user can submit a catalog concern via `New -> New catalog concern` from the toolbar on a records detail display. 3) Confirm that the right user was recorded as the reporter on the catalog concern management page (You must have logged in again as a user with the `edit_catalogue` permission to see this page. Signed-off-by: David Nind Signed-off-by: Helen Oliver Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_31028.pl | 8 +++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/includes/cat-menu.inc | 4 +- .../prog/en/includes/cat-toolbar.inc | 5 +- .../includes/modals/add_catalog_concern.inc | 50 ++++++++++++++++++ .../admin/preferences/cataloguing.pref | 8 +++ .../en/modules/admin/preferences/opac.pref | 1 + .../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 ++++ .../en/modules/cataloguing/cataloging-home.tt | 4 +- .../prog/en/modules/circ/returns.tt | 12 ++++- .../prog/en/modules/intranet-main.tt | 4 +- .../prog/js/modals/add_catalog_concern.js | 51 +++++++++++++++++++ mainpage.pl | 2 +- 18 files changed, 206 insertions(+), 9 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/installer/data/mysql/atomicupdate/bug_31028.pl b/installer/data/mysql/atomicupdate/bug_31028.pl index 179f835fc2..47a2c40c62 100644 --- a/installer/data/mysql/atomicupdate/bug_31028.pl +++ b/installer/data/mysql/atomicupdate/bug_31028.pl @@ -125,5 +125,13 @@ return { } ); say $out "Added new notice 'TICKET_NOTIFY'"; + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo') + } + ); + say $out "`CatalogConcerns` preference added"; } } diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 85a1213abd..b12f1ce170 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -131,6 +131,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'), ('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'), ('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'), +('CatalogConcerns', '0', NULL, 'Allow users to report catalog concerns', 'YesNo'), ('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free'), ('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'), ('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc index 024b0c47e9..90cbd56bf2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc @@ -29,7 +29,7 @@ [% END %] - [% IF ( CAN_user_tools_inventory || ( Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue ) ) %] + [% IF ( CAN_user_tools_inventory || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) ) %]
Reports
    [% IF ( CAN_user_tools_inventory ) %] @@ -37,7 +37,7 @@ Inventory [% END %] - [% IF Koha.Preference('OpacCatalogConcerns') && CAN_user_editcatalogue_edit_catalogue %] + [% IF ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue %]
  • Catalog concerns
  • 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..8f446a1b97 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc @@ -0,0 +1,50 @@ +[% USE raw %] +[% USE AdditionalContents %] +[% SET CatalogConcernHelp = AdditionalContents.get( location => "CatalogConcernHelp", lang => lang, library => logged_in_user.branchcode ) %] +[% SET CatalogConcernTemplate = AdditionalContents.get( location => "CatalogConcernTemplate", lang => lang, library => logged_in_user.branchcode ) %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index c533548e8e..82c2c258f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -42,6 +42,14 @@ Cataloging: 1: "Allow" 0: "Don't allow" - authorized values to be created within the cataloguing module. Librarian will need the manage_auth_values subpermission. + - + - pref: CatalogConcerns + default: 0 + choices: + 0: "Don't allow" + 1: Allow + - "staff to report concerns about catalog records." + - '

    Note: You can also enable `OpacCatalogConcerns` to allow OPAC users the same option.

    ' - - "Use " - pref: CatalogerEmails diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index a952c17fdc..8e8c60e503 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -342,6 +342,7 @@ OPAC: 0: "Don't allow" 1: Allow - "OPAC users to report concerns about catalog records." + - '

    Note: Enabling `CatalogConcerns` will allow concern submissions from the staff client.

    ' - - pref: OPACReportProblem choices: 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 c22c79d679..dd6ffcee89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -84,10 +84,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 %] [% Asset.js("js/resolve_claim_modal.js") | $raw %] [% END %] - + [% IF ( Koha.Preference('CatalogConcerns') ) %] + + [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] + [% END %]