From 85cfdb1f5bdee7c235516a161770a44e27ff8f62 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 --- 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 0418628b33..1c68165e94 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 @@ -164,7 +164,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 ) %] @@ -187,6 +187,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 63e49959d8..8f956fdc42 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 53f633500b..855913ae72 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; @@ -50,6 +51,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