Bug 23295: DBRev 24.06.00.040

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Katrin Fischer 2024-10-24 08:45:15 +00:00
parent 82638e85b5
commit 4a6352376e
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
3 changed files with 10 additions and 18 deletions

View file

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "24.06.00.039";
$VERSION = "24.06.00.040";
sub version {
return $VERSION;

View file

@ -1,16 +0,0 @@
use Modern::Perl;
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)};
$dbh->do(
q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('RestrictPatronsWithFailedNotices', '0', NULL, 'If enabled then when SMS and email notices fail sending at the Koha level then a debarment will be applied to a patrons account', 'YesNo') }
);
say $out "Added system preference 'RestrictPatronsWithFailedNotices'";
},
};

View file

@ -7,13 +7,21 @@ return {
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('RestrictPatronsWithFailedNotices', '0', NULL, 'If enabled then when SMS and email notices fail sending at the Koha level then a debarment will be applied to a patrons account', 'YesNo') }
);
say_success ( $out, "Added new system preference 'RestrictPatronsWithFailedNotices'" );
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'" );
say_success( $out, "Added new system restriction type 'NOTICE_FAILURE_SUSPENSION'" );
} catch {
say_failure( $out, "Database modification failed with errors: $_" );
};
},
};