From 1a4ff97ac78aff4c46f9348890c5bcb753c1a5e0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 15 Jul 2022 12:37:03 +0100 Subject: [PATCH] Bug 31162: Add a cataloging module home page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a new cataloging-home template and controller and replaces most cases of links to addbooks. This serves to provide a new cataloging home page for the cataloging module and keeps it distinct from the current addbooks page it partially replaces as a starting point for cataloging. We migrate most cataloging related tools from the 'Tools' module whilst opting to move 'Rotating collections' to the 'Circulation' section of the 'Tools' homepage. We also add links to the cataloging tab of system preferences and a the adminstration pages if the user has the correct permissions to have access to these areas. Signed-off-by: KIT Signed-off-by: Emmanuel Bétemps Signed-off-by: Katrin Fischer --- Koha/Manual.pm | 1 + cataloguing/cataloging-home.pl | 52 +++ .../intranet-tmpl/prog/en/includes/header.inc | 2 +- .../prog/en/modules/cataloguing/addbiblio.tt | 4 +- .../prog/en/modules/cataloguing/addbooks.tt | 2 +- .../prog/en/modules/cataloguing/additem.tt | 2 +- .../en/modules/cataloguing/cataloging-home.tt | 245 +++++++++++++++ .../prog/en/modules/cataloguing/editor.tt | 2 +- .../prog/en/modules/cataloguing/linkitem.tt | 2 +- .../prog/en/modules/cataloguing/merge.tt | 2 +- .../prog/en/modules/intranet-main.tt | 2 +- .../prog/en/modules/tools/tools-home.tt | 297 +++++++----------- 12 files changed, 417 insertions(+), 196 deletions(-) create mode 100755 cataloguing/cataloging-home.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt diff --git a/Koha/Manual.pm b/Koha/Manual.pm index 46641f8127..1382ebcc16 100644 --- a/Koha/Manual.pm +++ b/Koha/Manual.pm @@ -122,6 +122,7 @@ our $mapping = { 'catalogue/moredetail' => '/cataloging.html#item-records', 'catalogue/search-history' => '/plugins.html#search-history', 'catalogue/search' => '/searching.html', + 'cataloguing/cataloging-home' => '/cataloging.html', 'cataloguing/addbiblio' => '/cataloging.html#bibliographic-records', 'cataloguing/addbooks' => '/cataloging.html', 'cataloguing/additem' => '/cataloging.html#item-records', diff --git a/cataloguing/cataloging-home.pl b/cataloguing/cataloging-home.pl new file mode 100755 index 0000000000..78327409ec --- /dev/null +++ b/cataloguing/cataloging-home.pl @@ -0,0 +1,52 @@ +#!/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::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Context; + +use Koha::BiblioFrameworks; +use Koha::Z3950Servers; + +my $query = CGI->new; +my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( + { + template_name => "cataloguing/cataloging-home.tt", + query => $query, + type => "intranet", + flagsrequired => { editcatalogue => '*' }, + } +); + +my $servers = Koha::Z3950Servers->search( + { + recordtype => 'biblio', + servertype => ['zed','sru'], + } +); + +my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); + +$template->param( + servers => $servers, + frameworks => $frameworks +); + +output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index df45410d3c..c04af1d0da 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -31,7 +31,7 @@