Bug 23295: (follow-up) Add 'NOTICE_FAILURE_SUSPENSION' as a new system restriction type

Sponsored-by: Catalyst IT

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Alex Buckley 2024-10-08 04:20:13 +00:00 committed by Katrin Fischer
parent 3e984446ca
commit c44239a933
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 24 additions and 1 deletions

View File

@ -115,7 +115,7 @@ sub restrict_patron_when_notice_fails {
AddDebarment(
{
borrowernumber => $self->borrowernumber,
type => 'SUSPENSION',
type => 'NOTICE_FAILURE_SUSPENSION',
comment => $comment,
expiration => undef,
}

View File

@ -0,0 +1,18 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
return {
bug_number => "23295",
description => "Automatically debar patrons if SMS or email notice fail",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
try {
$dbh->do(q{INSERT IGNORE INTO restriction_types (code, display_text, is_system, is_default) VALUES ('NOTICE_FAILURE_SUSPENSION', 'Notice failure suspension', 1, 0)});
say_success( $out, "Added a new system restriction_types 'NOTICE_FAILURE_SUSPENSION'" );
}
catch {
say_failure( $out, "Database modification failed with errors: $_" );
};
},
};

View File

@ -44,3 +44,8 @@ tables:
display_text: "Discharge"
is_system: 1
is_default: 0
- code: "NOTICE_FAILURE_SUSPENSION"
display_text: "Notice failure suspension"
is_system: 1
is_default: 0