From 8794d31a624c3b3f86b3bf36c9a898e76ae010af Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Thu, 24 Oct 2024 08:12:09 +0000 Subject: [PATCH] Bug 30955: (follow-up) Merged related notices into lists This patch merges the SHARE_ACCEPT and SHARE_INVITE notices into the lists module. This makes a clearer case for introducing the lists module in the first place. --- .../bug_30955-move-notices-to-lists.pl | 16 ++++ .../mysql/en/mandatory/sample_notices.yml | 80 +++++++++---------- opac/opac-shareshelf.pl | 4 +- 3 files changed, 58 insertions(+), 42 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_30955-move-notices-to-lists.pl diff --git a/installer/data/mysql/atomicupdate/bug_30955-move-notices-to-lists.pl b/installer/data/mysql/atomicupdate/bug_30955-move-notices-to-lists.pl new file mode 100755 index 0000000000..64eca2e0b9 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30955-move-notices-to-lists.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "30955", + description => "Move existing list-based notices to new lists category", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( q{ UPDATE IGNORE letter SET module = 'lists' WHERE code = 'SHARE_ACCEPT'; } ); + say $out "Moved SHARE_ACCEPT notice to lists module"; + + $dbh->do( q{ UPDATE IGNORE letter SET module = 'lists' WHERE code = 'SHARE_INVITE'; } ); + say $out "Moved SHARE_INVITE notice to lists module"; + }, +}; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 3354e24b30..df26127d57 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1305,6 +1305,46 @@ tables: - "[% branch.branchillemail %]" - "[% branch.branchemail %]" + - module: lists + code: SHARE_ACCEPT + branchcode: "" + name: "Notification about an accepted share" + is_html: 0 + title: "Share on list <> accepted" + message_transport_type: email + lang: default + content: + - "Dear patron," + - "" + - "We want to inform you that <> <> accepted your invitation to share your list <> in our library catalog." + - "" + - "Thank you." + - "" + - "Your library." + + - module: lists + code: SHARE_INVITE + branchcode: "" + name: "Invitation for sharing a list" + is_html: 0 + title: "Share list <>" + message_transport_type: email + lang: default + content: + - "Dear patron," + - "" + - "One of our patrons, <> <>, invites you to share a list <> in our library catalog." + - "" + - "To access this shared list, please click on the following URL or copy-and-paste it into your browser address bar." + - "" + - "<>" + - "" + - "In case you are not a patron in our library or do not want to accept this invitation, please ignore this mail. Note also that this invitation expires within two weeks." + - "" + - "Thank you." + - "" + - "Your library." + - module: lists code: TRANSFER_OWNERSHIP branchcode: "" @@ -1446,46 +1486,6 @@ tables: - "

This link will be valid for 5 days from this email's reception, then you must reapply if you do not change your password.

" - "

Thank you.

" - - module: members - code: SHARE_ACCEPT - branchcode: "" - name: "Notification about an accepted share" - is_html: 0 - title: "Share on list <> accepted" - message_transport_type: email - lang: default - content: - - "Dear patron," - - "" - - "We want to inform you that <> <> accepted your invitation to share your list <> in our library catalog." - - "" - - "Thank you." - - "" - - "Your library." - - - module: members - code: SHARE_INVITE - branchcode: "" - name: "Invitation for sharing a list" - is_html: 0 - title: "Share list <>" - message_transport_type: email - lang: default - content: - - "Dear patron," - - "" - - "One of our patrons, <> <>, invites you to share a list <> in our library catalog." - - "" - - "To access this shared list, please click on the following URL or copy-and-paste it into your browser address bar." - - "" - - "<>" - - "" - - "In case you are not a patron in our library or do not want to accept this invitation, please ignore this mail. Note also that this invitation expires within two weeks." - - "" - - "Thank you." - - "" - - "Your library." - - module: members code: WELCOME branchcode: "" diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 4cc2b69045..25b739f384 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -191,7 +191,7 @@ sub notify_owner { #prepare letter my $letter = C4::Letters::GetPreparedLetter( - module => 'members', + module => 'lists', letter_code => 'SHARE_ACCEPT', branchcode => C4::Context->userenv->{"branch"}, lang => $patron->lang, @@ -257,7 +257,7 @@ sub send_invitekey { #prepare letter my $letter = C4::Letters::GetPreparedLetter( - module => 'members', + module => 'lists', letter_code => 'SHARE_INVITE', branchcode => C4::Context->userenv->{"branch"}, lang => 'default', # Not sure how we could use something more useful else here -- 2.43.0