From b9ebe74c4b668f45f6846d7e4a5f1a559df4b89b 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 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 --- 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 99cee0c87b..cf509bfe90 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -472,6 +472,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 3388e387a5..55d9229f8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -96,6 +96,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.30.2