Koha/cataloguing/cataloging-home.pl
Nick Clemens 85cfdb1f5b
Bug 33133: Add fast cataloging to 'Cataloging' page
This patch adds a check for the existence of the Fast Add framework to
the Koha mainpage and the cataloging home page

If it exists, and the user has fast cataloging permission then there
will be a link to Cataloging on the home page, and to Fast add on the
cataloging page

To test:
1 - Have two patrons, one with superlibrarian and one with only
  catalogue + fast_cataloging
2 - Make sure you have a fast add framework (code:FA)
3 - Have two windows/tabs one with each patron (one private/incognito or
  use two browsers)
4 - View mainpage.pl for both
5 - Superlibrarian has Catalogue link, other does not
6 - Browse to http://localhost:8081/cgi-bin/koha/cataloguing/cataloging-home.pl
7 - Superlibrarian sees stuff, other can access page, but has no buttons
8 - Apply patch
9 - Repeat 4 - both have a link
10 - Repeat 7 - both have a link to fast add
11 - Confirm fast add link works

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-27 12:50:07 +02:00

53 lines
1.6 KiB
Perl
Executable file

#!/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 <http://www.gnu.org/licenses>.
#
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( fast_cataloging => 1 ) if $frameworks->find({ frameworkcode => 'FA' });
$template->param(
servers => $servers,
frameworks => $frameworks
);
output_html_with_http_headers $query, $cookie, $template->output;