From 4d9858a540c8e65e2c427173c640c7d3debb5936 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 7 Jul 2022 14:58:22 +0100 Subject: [PATCH] Bug 31028: Add a catalog concerns management page This patch adds a new cataloguing concerns page to the staff client for managing reported catalog concerns. --- cataloguing/concerns.pl | 37 +++ .../prog/en/includes/cat-menu.inc | 17 +- .../prog/en/modules/cataloguing/concerns.tt | 229 ++++++++++++++++++ .../prog/en/modules/intranet-main.tt | 7 + .../prog/en/modules/tools/tools-home.tt | 5 + mainpage.pl | 6 + 6 files changed, 298 insertions(+), 3 deletions(-) create mode 100755 cataloguing/concerns.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt diff --git a/cataloguing/concerns.pl b/cataloguing/concerns.pl new file mode 100755 index 0000000000..4e3d1ff55e --- /dev/null +++ b/cataloguing/concerns.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use CGI qw ( -utf8 ); +use C4::Context; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); + +my $query = CGI->new; +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "cataloguing/concerns.tt", + query => $query, + type => "intranet", + flagsrequired => { cataloguing => '*' }, + } +); + +output_html_with_http_headers $query, $cookie, $template->output; + +1; 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 817552ecd8..98e338afcf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-menu.inc @@ -1,3 +1,14 @@ - +[% USE Koha %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt new file mode 100644 index 0000000000..cc23ea4c3d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt @@ -0,0 +1,229 @@ +[% USE raw %] +[% USE Asset %] +[% SET footerjs = 1 %] +[% USE TablesSettings %] +[% INCLUDE 'doc-head-open.inc' %] + + Concerns › Cataloging › Koha + +[% INCLUDE 'doc-head-close.inc' %] + + + + [% INCLUDE 'header.inc' %] + [% INCLUDE 'cataloging-search.inc' %] + + + +
+
+
+
+ + +

Concerns

+ +
+ + + + + + + + + + +
ReportedConcernTitleStatusActions
+
+
+ +
+ +
+
+ + + + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + [% INCLUDE 'js-date-format.inc' %] + [% INCLUDE 'js-patron-format.inc' %] + [% INCLUDE 'js-biblio-format.inc' %] + +[% END %] +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 67a51f7f5e..c6947acede 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -221,6 +221,13 @@
[% END %] + [% IF ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue %] +
+ Catalog concerns pending: + [% pending_catalog_concerns | html %] +
+ [% END %] + [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count %]
Checkout notes pending: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt index 7efa6aba1c..38e29cfbd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -221,6 +221,11 @@
Perform inventory of your catalog
[% END %] + [% IF ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue %] +
Catalog concerns
+
Manage catalog concern reports
+ [% END %] + [% IF ( CAN_user_tools_label_creator ) %]
Label creator
Create printable labels and barcodes from catalog data
diff --git a/mainpage.pl b/mainpage.pl index f5872e65bb..86558d63bb 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -31,6 +31,7 @@ use Koha::Patron::Discharge; use Koha::Reviews; use Koha::ArticleRequests; use Koha::ProblemReports; +use Koha::Catalog::Concerns; use Koha::Quotes; use Koha::Suggestions; use Koha::BackgroundJobs; @@ -103,6 +104,11 @@ my $pending_article_requests = Koha::ArticleRequests->search_limited( )->count; my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' }); +if ( C4::Context->preference('CatalogConcerns') || C4::Context->preference('OpacCatalogConcerns') ) { + my $concerns = Koha::Catalog::Concerns->search({ resolved_date => undef }); + $template->param( pending_catalog_concerns => $concerns->count ); +} + unless ( $logged_in_user->has_permission( { parameters => 'manage_background_jobs' } ) ) { my $already_ran_jobs = Koha::BackgroundJobs->search( { borrowernumber => $logged_in_user->borrowernumber } )->count ? 1 : 0; -- 2.20.1