From 9d7e88e32582c9561d20d5931a9864ccbc381b7f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Aug 2015 18:10:37 +0100 Subject: [PATCH] Bug 14655: Add a warning if the checkin will fail MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On the checkin and checkout page, the checkin will fail if the patron has requested the privacy and the AnonymousPatron is not correctly set. This patch adds a warning message on both pages. Test plan: 0/ Be sure you don't have any patron with privacy=2 (Never) 1/ Set OPACPrivacy, not AnonymousPatron 2/ Go on the checkin, you should a warning (same as before this patch). 3/ Set the privacy=2 for a patron 4/ Go on the circulation page, a warning should appear (for this specific patron) 5/ Check an item out to this patron 6/ Check the item in on the checkin page. The item is not checked in and you get a specific message for this patron. Confirm other/correct situations don't trigger the messages. Followed test plan. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit cb2151529e0c2d031a01e68bd5deab26d2ffbaff) Signed-off-by: Chris Cormack (cherry picked from commit 625aec5b8541f8e83fa3bbea473616f90ab1396d) Signed-off-by: Liz Rea --- circ/returns.pl | 1 + .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 +++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 9 +++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 9121dd499d..a175b450df 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -337,6 +337,7 @@ if ($barcode) { $riduedate{0} = 0; push( @inputloop, \%input ); } + $template->param( privacy => $borrower->{privacy} ); } $template->param( inputloop => \@inputloop ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 95ce96da41..2486dd4642 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -514,6 +514,11 @@ No patron matched [% message %] [% IF ( borrowernumber ) %]
+ +[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %] +
Error: This patron has requested a privacy on returning item but the AnonymousPatron pref is not set correctly.
+[% END %] + [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%] [% IF ( flagged ) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 5c2b99cde8..3e3d35f157 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -107,10 +107,11 @@ $(document).ready(function () {
-[% IF !Koha.Preference('AnonymousPatron') %] - [% IF Koha.Preference('OPACPrivacy') %] -
Error: The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.
- [% END %] + +[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %] +
Error: This patron has requested a privacy on returning item but the AnonymousPatron pref is not set correctly.
+[% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %] +
Error: The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.
[% END %] [% IF additional_materials %] -- 2.39.5