From d91b4f6eac8ab8a62e904b3edd942df41d811214 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 25 Sep 2023 21:53:45 -1000 Subject: [PATCH] Bug 34910: Do not allow checkout for anonymous patron MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The anonymous patron circulation page should show an alert message and not allow check-out. 1) Configure an existing borrowernumber in system preference AnonymousPatron 2) Go to circulation page of this borrower : /cgi-bin/koha/circ/circulation.pl?borrowernumber=x 3) Check you see alert 'This is the anonymous patron, so circulation is disabled.' Signed-off-by: Kelly McElligott Signed-off-by: Johanna Miettunen Signed-off-by: Päivi Knuutinen Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit aca49ca14b9f2d009f469144f975cd9fbf098181) Signed-off-by: Fridolin Somers (cherry picked from commit 9a64d2c93a97f387f89ae157bc379bf7b1261a4a) Signed-off-by: Matt Blenkinsop --- circ/circulation.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index 98ebc026be..f49c9f8597 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -485,6 +485,10 @@ if ( $patron ) { $template->param( is_debarred=> 1 ); $noissues = 1; } + if ( $patron->borrowernumber eq C4::Context->preference("AnonymousPatron") ) { + $template->param( is_anonymous => 1 ); + $noissues = 1; + } my $account = $patron->account; if( ( my $owing = $account->non_issues_charges ) > 0 ) { my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why?? 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 278278d8d0..5f214df79c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -94,6 +94,10 @@
Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.
[% END %] + [% IF is_anonymous %] +
This is the anonymous patron, so circulation is disabled.
+ [% END %] + [% IF ( NEEDSCONFIRMATION ) %]
[% IF CAN_user_circulate_force_checkout or ADDITIONAL_MATERIALS %] -- 2.39.5