From 76fb7e741cd1b3b9b037c47a3174c2c81470030b 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/modules/cataloguing/concerns.tt | 229 ++++++++++++++++++ .../prog/en/modules/intranet-main.tt | 9 +- .../prog/en/modules/tools/tools-home.tt | 5 + mainpage.pl | 6 + 5 files changed, 285 insertions(+), 1 deletion(-) 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/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt new file mode 100644 index 0000000000..c1e3641b56 --- /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 1c657872be..3ac87c1d66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -170,7 +170,7 @@
[%# Following statement must be in one line for translatability %] - [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %] + [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && pending_catalog_concerns && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %]
[% IF pending_article_requests %]
@@ -225,6 +225,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 73508b2c64..6ffdf522da 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 @@ -110,6 +110,11 @@
Rotating collections
Manage rotating collections
[% END %] + + [% IF ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue %] +
Catalog concerns
+
Manage catalog concern reports
+ [% END %]
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