From ac993a2365ddb8d7c20fbd8944fd5e53aa00f136 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Thu, 18 Jul 2019 20:16:07 +0300 Subject: [PATCH] Bug 23344 - Branch Transfer Limits - Warn if sysprefs are not set The admin-menu branch_transfer_limits.pl is available but doesn't say anything about sysprefs that need setting. Testing and finding out the limits don't work is confusing. It would be more intuitive to just use the feature in the background without having to mess with any extra sysprefs. Or set the aforementioned sysprefs in the branch_transfer_limits.pl -page. This patch adds a simple warning if syspref 'UseBranchTransferLimits' is not activated. Sponsored-by: The National Library of Finland --- admin/branch_transfer_limits.pl | 4 ++++ .../prog/en/modules/admin/branch_transfer_limits.tt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index 0334950b26..ad602625b8 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -28,6 +28,7 @@ use C4::Koha; use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; my $input = new CGI; +my %errors; # Collect possible errors here. my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "admin/branch_transfer_limits.tt", @@ -47,6 +48,8 @@ else $fromBranch = Koha::Libraries->find($input->param('fromBranch')); } +$errors{syspref_UseBranchTransferLimits_isMissing} = 1 if not(C4::Context->preference('UseBranchTransferLimits')); + # Set the template language for the correct limit type using $limitType my $limitType = C4::Context->preference("BranchTransferLimitsType") || "ccode"; @@ -101,6 +104,7 @@ foreach my $code ( @codes ) { $template->param( + errors => \%errors, branchcount => $branchcount, codes_loop => \@codes_loop, branches => \@branches, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt index 0d656e7bef..a38fd85304 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt @@ -19,6 +19,10 @@
+[% IF errors.syspref_UseBranchTransferLimits_isMissing %] +
Warning: This feature is disabled while system preference 'UseBranchTransferLimits' is not set. This feature is enabled and configured from the system preferences.
+[% END %] +

Library [% fromBranch.branchcode | html %] - [% fromBranch.branchname | html %] Checkin and transfer policy

-- 2.17.1