Bugzilla – Attachment 91605 Details for
Bug 23344
Branch Transfer Limits - Warn if sysprefs are not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23344 - Branch Transfer Limits - Warn if sysprefs are not set
Bug-23344---Branch-Transfer-Limits---Warn-if-syspr.patch (text/plain), 2.97 KB, created by
Olli-Antti Kivilahti
on 2019-07-18 17:52:37 UTC
(
hide
)
Description:
Bug 23344 - Branch Transfer Limits - Warn if sysprefs are not set
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2019-07-18 17:52:37 UTC
Size:
2.97 KB
patch
obsolete
>From ac993a2365ddb8d7c20fbd8944fd5e53aa00f136 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@hypernova.fi> >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 @@ > <div class="col-sm-10 col-sm-push-2"> > <main> > >+[% IF errors.syspref_UseBranchTransferLimits_isMissing %] >+ <div class="dialog alert"><strong>Warning:</strong> This feature is disabled while system preference 'UseBranchTransferLimits' is not set. This feature is enabled and configured from the system preferences.</div> >+[% END %] >+ > <h1>Library [% fromBranch.branchcode | html %] - [% fromBranch.branchname | html %] Checkin and transfer policy</h1> > <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary"> > <label for="branchselect">Select a library :</label> >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23344
: 91605