From d65cf822ea4def049d8c77d454ad6713543c6b0a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 3 Mar 2023 20:23:31 +0000 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 85cfdb1f5bdee7c235516a161770a44e27ff8f62) Signed-off-by: Matt Blenkinsop --- cataloguing/cataloging-home.pl | 1 + .../prog/en/modules/cataloguing/cataloging-home.tt | 8 +++++++- koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- mainpage.pl | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cataloguing/cataloging-home.pl b/cataloguing/cataloging-home.pl index 78327409ec..28c52939b3 100755 --- a/cataloguing/cataloging-home.pl +++ b/cataloguing/cataloging-home.pl @@ -43,6 +43,7 @@ my $servers = Koha::Z3950Servers->search( ); my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); +$template->param( fast_cataloging => 1 ) if $frameworks->find({ frameworkcode => 'FA' }); $template->param( servers => $servers, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt index 70c1a82214..b2203ccd46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt @@ -158,7 +158,7 @@
- [% IF ( CAN_user_tools_label_creator || CAN_user_tools_upload_local_cover_images ) %] + [% IF ( CAN_user_tools_label_creator || CAN_user_tools_upload_local_cover_images || ( fast_cataloging && CAN_user_editcatalogue_fast_cataloging ) ) %]

Tools

    [% IF ( CAN_user_tools_label_creator ) %] @@ -181,6 +181,12 @@ [% END %] + [% IF ( CAN_user_editcatalogue_fast_cataloging ) %] +
  • + Fast cataloging +
  • + [% END %] +
[% END %] 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 4f4440e4ae..dec77b4852 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -124,7 +124,7 @@ [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ) %] + [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || ( fast_cataloging && CAN_user_editcatalogue_fast_cataloging ) ) %]
  • Cataloging
  • diff --git a/mainpage.pl b/mainpage.pl index f5872e65bb..4ca699bd43 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -30,6 +30,7 @@ use Koha::Patron::Modifications; use Koha::Patron::Discharge; use Koha::Reviews; use Koha::ArticleRequests; +use Koha::BiblioFrameworks; use Koha::ProblemReports; use Koha::Quotes; use Koha::Suggestions; @@ -49,6 +50,9 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $logged_in_user = Koha::Patrons->find($loggedinuser); +# Checking if there is a Fast Cataloging Framework +$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); + my $homebranch; if (C4::Context->userenv) { $homebranch = C4::Context->userenv->{'branch'}; -- 2.39.5