From 895a3788d83be37689a2fa092aa060b971a322e8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 23 Jul 2024 16:47:02 +0100 Subject: [PATCH] Bug 23781: DBRev 24.06.00.019 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- .../240600019.pl} | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) rename installer/data/mysql/{atomicupdate/bug_23781-recalls_sms_notices.pl => db_revs/240600019.pl} (69%) diff --git a/Koha.pm b/Koha.pm index 56b4e968bc..f3c0b5e016 100644 --- a/Koha.pm +++ b/Koha.pm @@ -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.018"; +$VERSION = "24.06.00.019"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl b/installer/data/mysql/db_revs/240600019.pl similarity index 69% rename from installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl rename to installer/data/mysql/db_revs/240600019.pl index 4a56684c8a..7b787330fe 100755 --- a/installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl +++ b/installer/data/mysql/db_revs/240600019.pl @@ -1,4 +1,5 @@ use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); return { bug_number => "23781", @@ -9,20 +10,20 @@ return { $dbh->do( q{ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation','RETURN_RECALLED_ITEM','','Notification to return a recalled item','0','Return recalled item','Your item has been recalled: <> (<>). Please return it by <.','sms'), ('circulation','PICKUP_RECALLED_ITEM','','Recalled item awaiting pickup','0','Recalled item awaiting pickup','A recalled item: <> (<>) is ready for you to pick up at <>. Please collect by <>.','sms') } - ); - - say $out "Added recalls SMS notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM"; + ) != '0E0' + ? say_success( $out, "Added recalls SMS notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM" ) + : say_info( $out, "SMS notices already exist, RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, left intact" ); $dbh->do( q{ INSERT IGNORE INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (12, 'Recall_Waiting', 0), (13, 'Recall_Requested', 0) } - ); - - say $out "Added message attributes for recalls: Recall_Waiting, Recall_Requested"; + ) != '0E0' + ? say_success( $out, "Added message attributes for recalls: Recall_Waiting, Recall_Requested" ) + : say_info( $out, "Message attributes for recalls already exist" ); $dbh->do( q{ INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) VALUES (12, "email", 0, "circulation", "PICKUP_RECALLED_ITEM", null), (12, "sms", 0, "circulation", "PICKUP_RECALLED_ITEM", null), (12, "phone", 0, "circulation", "PICKUP_RECALLED_ITEM", null), (13, "email", 0, "circulation", "RETURN_RECALLED_ITEM", null), (13, "sms", 0, "circulation", "RETURN_RECALLED_ITEM", null), (13, "phone", 0, "circulation", "RETURN_RECALLED_ITEM", null) } - ); - - say $out "Added message transports for recalls notices"; + ) != '0E0' + ? say_success( $out, "Added message transports for recalls notices" ) + : say_info( $out, "Message transports for recalls already exist" ); }, }; -- 2.39.5