From 96479a2af6705481a8e240fb958f92925981c695 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 21 Apr 2024 23:05:27 +0000 Subject: [PATCH] Bug 23781: Database updates This patch adds RETURN_RECALLED_ITEM and PICKUP_RECALLED_ITEM SMS notices and makes recalls notices available to be configured in patron messaging preferences. Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- .../bug_23781-recalls_sms_notices.pl | 28 +++++++++++++++++++ .../mysql/en/mandatory/sample_notices.yml | 22 +++++++++++++++ .../sample_notices_message_attributes.sql | 5 ++-- .../sample_notices_message_transports.sql | 8 +++++- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl diff --git a/installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl b/installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl new file mode 100755 index 0000000000..87c8dc2643 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23781-recalls_sms_notices.pl @@ -0,0 +1,28 @@ +use Modern::Perl; + +return { + bug_number => "23781", + description => "Recalls notices and messaging preferences", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $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"; + + $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"; + + $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"; + }, +}; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 0cb966a78a..2b01624e7f 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -2283,6 +2283,28 @@ tables: - "" - "Thank you!" + - module: circulation + code: RETURN_RECALLED_ITEM + branchcode: "" + name: "Notification to return a recalled item" + is_html: 0 + title: "Return recalled item" + message_transport_type: sms + lang: default + content: + - "Your item has been recalled: <> (<>). Please return it by <." + + - module: circulation + code: PICKUP_RECALLED_ITEM + branchcode: "" + name: "Recalled item awaiting pickup" + is_html: 0 + title: "Recalled item awaiting pickup" + message_transport_type: sms + lang: default + content: + - "A recalled item: <> (<>) is ready for you to pick up at <>. Please collect by <>." + - module: circulation code: RECALL_REQUESTER_DET branchcode: "" diff --git a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql index bd0294c960..31bf6d0b37 100644 --- a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql +++ b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql @@ -10,5 +10,6 @@ values (8, 'Ill_unavailable', 0), (9, 'Auto_Renewals', 0), (10, 'Hold_Reminder', 0), -(11, 'Ill_update', 0); - +(11, 'Ill_update', 0), +(12, 'Recall_Waiting', 0), +(13, 'Recall_Requested', 0); diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql index 55ed683d6b..977e59f5ea 100644 --- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql +++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql @@ -44,4 +44,10 @@ values (10, 'itiva', 0, 'circulation', 'HOLD_REMINDER'), (11, 'email', 0, 'ill', 'ILL_REQUEST_UPDATE'), (11, 'sms', 0, 'ill', 'ILL_REQUEST_UPDATE'), -(11, 'phone', 0, 'ill', 'ILL_REQUEST_UPDATE'); +(11, 'phone', 0, 'ill', 'ILL_REQUEST_UPDATE'), +(12, "email", 0, "circulation", "PICKUP_RECALLED_ITEM"), +(12, "sms", 0, "circulation", "PICKUP_RECALLED_ITEM"), +(12, "phone", 0, "circulation", "PICKUP_RECALLED_ITEM"), +(13, "email", 0, "circulation", "RETURN_RECALLED_ITEM"), +(13, "sms", 0, "circulation", "RETURN_RECALLED_ITEM"), +(13, "phone", 0, "circulation", "RETURN_RECALLED_ITEM");