From 7d1409e188437155911764757a0c61c54b0cd90d Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 27 Aug 2017 23:20:40 +0000 Subject: [PATCH] Bug 18915: Fix checkout note email message This patch replaces the <> in the email with <> and uses CHECKOUT_NOTE instead of PATRON_NOTE. This patch also adds the notice to installer/data/mysql/en/mandatory/sample_notices.sql, and updates the PATRON_NOTE entry in installer/data/mysql/updatedatabase.pl To test: 1) Apply patch and update database 2) View the message_queue table in mysql 3) Check out an item if haven't already 4) Go to OPAC and set a checkout note for an item 5) View message_queue table and confirm it the title is included in the email and all instances of 'patron note' have been replaced with 'checkout note' 6) Disable javascript in browser 7) repeat steps 4 and 5 and confirm all works as expected Sponsored-by: Catalyst IT Signed-off-by: Marjorie Vila Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens (cherry picked from commit c199ced310abdef53379115ee285757df20ac335) Signed-off-by: Fridolin Somers --- .../atomicupdate/bug_18915_-_modifying_patron_note_notice.sql | 1 + installer/data/mysql/en/mandatory/sample_notices.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 2 +- opac/opac-issue-note.pl | 2 +- opac/svc/patron_notes | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql diff --git a/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql b/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql new file mode 100644 index 0000000000..80035b22d1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql @@ -0,0 +1 @@ +UPDATE letter SET code = 'CHECKOUT_NOTE', name = 'Checkout note on item set by patron', title = 'Checkout note', content = REPLACE(content, "<>", "<>") WHERE code = 'PATRON_NOTE'; diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 7a5c4da1be..0eb0051d23 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -173,4 +173,5 @@ INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title` ('circulation', 'AR_COMPLETED', '', 'Article request - completed', 0, 'Article request completed', 'Dear <> <> (<>),\r\n\r\nWe have completed your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n\r\nYou may pick your article up at <>.\r\n\r\nThank you!', 'email'), ('circulation', 'AR_PENDING', '', 'Article request - open', 0, 'Article request received', 'Dear <> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n\r\n\r\nThank you!', 'email'), ('circulation', 'AR_SLIP', '', 'Article request - print slip', 0, 'Article request', 'Article request:\r\n\r\n<> <> (<>),\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n', 'print'), -('circulation', 'AR_PROCESSING', '', 'Article request - processing', 0, 'Article request processing', 'Dear <> <> (<>),\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n\r\nThank you!', 'email'); +('circulation', 'AR_PROCESSING', '', 'Article request - processing', 0, 'Article request processing', 'Dear <> <> (<>),\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n\r\nThank you!', 'email'), +('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<> <> has added a note to the item <> - <> (<>).','email'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 40c0f8eb07..b0a83a5102 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14308,7 +14308,7 @@ if( CheckVersion( $DBversion ) ) { $dbh->do(q| INSERT IGNORE INTO letter (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) - VALUES ('circulation', 'PATRON_NOTE', '', 'Patron note on item', '0', 'Patron issue note', '<> <> has added a note to the item <> - <> (<>).','email'); + VALUES ('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<> <> has added a note to the item <> - <> (<>).','email'); |); $dbh->do(q| diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index da7e95fa8b..e303b5c8b1 100755 --- a/opac/opac-issue-note.pl +++ b/opac/opac-issue-note.pl @@ -72,7 +72,7 @@ if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') ) { my $branch = Koha::Libraries->find( $issue->branchcode ); my $letter = C4::Letters::GetPreparedLetter ( module => 'circulation', - letter_code => 'PATRON_NOTE', + letter_code => 'CHECKOUT_NOTE', branchcode => $branch, tables => { 'biblio' => $biblio->{biblionumber}, diff --git a/opac/svc/patron_notes b/opac/svc/patron_notes index 6b6449cfc0..358b1a0b0a 100755 --- a/opac/svc/patron_notes +++ b/opac/svc/patron_notes @@ -82,7 +82,7 @@ if ($is_ajax) { my $biblio = GetBiblioFromItemNumber($issue->itemnumber); my $letter = C4::Letters::GetPreparedLetter ( module => 'circulation', - letter_code => 'PATRON_NOTE', + letter_code => 'CHECKOUT_NOTE', branchcode => $branch, tables => { 'biblio' => $biblio->{biblionumber}, -- 2.39.5