From e5ae465d761e79a61c2c9fa040327ca8dc0934c5 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. --- .../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 | 48 +++++++++++++++++++ .../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 | 29 +++++++++++ mainpage.pl | 2 +- 18 files changed, 182 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 3292dfe7d8..1333089b50 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 563692878c..caccf118a0 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -129,6 +129,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