Bug 14655: Add a warning if the checkin will fail

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 <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
This commit is contained in:
Jonathan Druart 2015-08-18 18:10:37 +01:00 committed by Tomas Cohen Arazi
parent 8dfde8b85a
commit cb2151529e
3 changed files with 11 additions and 4 deletions

View File

@ -351,6 +351,7 @@ if ($barcode) {
$riduedate{0} = 0;
push( @inputloop, \%input );
}
$template->param( privacy => $borrower->{privacy} );
}
$template->param( inputloop => \@inputloop );

View File

@ -588,6 +588,11 @@ No patron matched <span class="ex">[% message %]</span>
[% IF ( borrowernumber ) %]
<div class="yui-g">
[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
<div class="dialog alert"><strong>Error:</strong> This patron has requested a privacy on returning item but the AnonymousPatron pref is not set correctly.</div>
[% END %]
[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
[% IF ( flagged ) %]
<div class="yui-u first">

View File

@ -117,10 +117,11 @@ $(document).ready(function () {
<div id="yui-main">
<div class="yui-g">
[% IF !Koha.Preference('AnonymousPatron') %]
[% IF Koha.Preference('OPACPrivacy') %]
<div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
[% END %]
[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
<div class="dialog alert"><strong>Error:</strong> This patron has requested a privacy on returning item but the AnonymousPatron pref is not set correctly.</div>
[% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
<div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
[% END %]
[% IF additional_materials %]