Bug 3150 - Move emails for sending cart and list contents into notices tool
Summary: Move emails for sending cart and list contents into notices tool
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Marcel de Rooy
URL:
Keywords:
: 7983 11443 22931 23882 26786 (view as bug list)
Depends on: 27266
Blocks: 31224 7001 33223
  Show dependency treegraph
 
Reported: 2009-04-23 02:40 UTC by Liz Rea
Modified: 2024-02-08 16:42 UTC (History)
20 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Large patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/685
Text to go in the release notes:
This patch creates notices using Template Toolkit syntax for sending emails containing cart (named CART) and list (named LIST) contents. This provides libraries more flexibility around what the emails contain and means they can be more translatable.
Version(s) released in:
23.05.00


Attachments
Bug 3150: WIP (15.67 KB, patch)
2020-12-03 02:48 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: WIP (20.06 KB, patch)
2020-12-21 02:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: WIP (17.48 KB, patch)
2020-12-21 21:10 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (119.78 KB, patch)
2020-12-22 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (119.83 KB, patch)
2021-02-24 05:12 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (119.70 KB, patch)
2021-03-16 11:46 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (109.43 KB, patch)
2021-05-05 04:41 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (135.93 KB, patch)
2021-05-05 04:41 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (71.27 KB, patch)
2021-05-17 01:29 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (85.50 KB, patch)
2021-05-17 01:29 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (71.32 KB, patch)
2021-05-17 10:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (85.54 KB, patch)
2021-05-17 10:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (71.30 KB, patch)
2021-07-22 03:04 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (85.54 KB, patch)
2021-07-22 03:04 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (80.26 KB, patch)
2021-07-22 03:04 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (70.35 KB, patch)
2021-09-24 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (85.54 KB, patch)
2021-09-24 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (80.47 KB, patch)
2021-09-24 01:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (714 bytes, patch)
2021-09-27 23:01 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (51.45 KB, patch)
2021-10-19 20:42 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (60.29 KB, patch)
2021-10-19 20:42 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (50.73 KB, patch)
2021-10-19 20:42 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (714 bytes, patch)
2021-10-19 20:42 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (51.40 KB, patch)
2022-02-03 20:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (60.29 KB, patch)
2022-02-03 20:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (50.82 KB, patch)
2022-02-03 20:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (714 bytes, patch)
2022-02-03 20:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (51.45 KB, patch)
2022-04-28 22:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (60.29 KB, patch)
2022-04-28 22:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (50.82 KB, patch)
2022-04-28 22:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (714 bytes, patch)
2022-04-28 22:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (7.52 KB, patch)
2022-04-28 22:14 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (8.64 KB, patch)
2022-05-02 21:25 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.00 KB, patch)
2022-07-14 05:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (47.71 KB, patch)
2022-07-14 05:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (35.96 KB, patch)
2022-07-14 05:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (716 bytes, patch)
2022-07-14 05:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.78 KB, patch)
2022-07-14 05:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.00 KB, patch)
2022-07-14 13:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (47.70 KB, patch)
2022-07-14 13:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (35.96 KB, patch)
2022-07-14 13:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (762 bytes, patch)
2022-07-14 13:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.77 KB, patch)
2022-07-14 13:44 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fix .yml formatting (3.70 KB, patch)
2022-07-19 15:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (41.82 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (24.70 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (35.96 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (762 bytes, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.81 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fix .yml formatting (3.70 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.31 KB, patch)
2022-09-07 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (41.82 KB, patch)
2022-09-07 07:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (48.23 KB, patch)
2022-09-07 07:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (35.96 KB, patch)
2022-09-07 07:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (762 bytes, patch)
2022-09-07 07:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.81 KB, patch)
2022-09-07 07:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fix .yml formatting (3.70 KB, patch)
2022-09-07 07:13 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.31 KB, patch)
2022-09-07 07:13 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (41.78 KB, patch)
2023-01-12 03:23 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (48.71 KB, patch)
2023-01-12 03:23 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.85 KB, patch)
2023-01-12 03:23 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (764 bytes, patch)
2023-01-12 03:24 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.86 KB, patch)
2023-01-12 03:24 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.32 KB, patch)
2023-01-12 03:24 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (41.73 KB, patch)
2023-01-25 22:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (48.66 KB, patch)
2023-01-25 22:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.81 KB, patch)
2023-01-25 22:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (762 bytes, patch)
2023-01-25 22:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.80 KB, patch)
2023-01-25 22:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.36 KB, patch)
2023-01-25 22:24 UTC, David Nind
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.37 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (50.57 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.85 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (764 bytes, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.86 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.36 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Use get_marc_contributors (16.93 KB, patch)
2023-02-13 01:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.32 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (50.52 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.81 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (762 bytes, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.80 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.36 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Use get_marc_contributors (16.90 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: Fix file permission on database update file (663 bytes, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Send list and cart emails immediately again (3.59 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Improve and fix new notice templates (25.34 KB, patch)
2023-02-17 16:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: Include host item entries in LIST and CART notices (5.09 KB, patch)
2023-02-20 23:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make subs to get host/related parts for notices (8.47 KB, patch)
2023-02-27 00:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.38 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (50.57 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.86 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (819 bytes, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.85 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.41 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Use get_marc_contributors (16.96 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: Fix file permission on database update file (720 bytes, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Send list and cart emails immediately again (3.65 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Improve and fix new notice templates (25.40 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: Include host item entries in LIST and CART notices (5.15 KB, patch)
2023-03-07 18:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make subs to get host/related parts for notices (8.52 KB, patch)
2023-03-07 18:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make sure host information displays for unlinked records (11.19 KB, patch)
2023-03-07 18:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make sure host information displays for unlinked records (11.26 KB, patch)
2023-03-10 02:54 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 3150: Move emails for sending cart and list contents to notices (42.43 KB, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) HTML filtering TT notices and removing old files (50.63 KB, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Reformat notices, don't send if no sender email (36.92 KB, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Add missing bracket (875 bytes, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Fixing errors and notices (6.91 KB, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter (1.47 KB, patch)
2023-03-14 17:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Use get_marc_contributors (17.01 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: Fix file permission on database update file (776 bytes, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Send list and cart emails immediately again (3.70 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Improve and fix new notice templates (25.45 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: Include host item entries in LIST and CART notices (5.20 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make subs to get host/related parts for notices (8.58 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (follow-up) Make sure host information displays for unlinked records (11.30 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Remove unused variables (951 bytes, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Don't load unused and deleted tt files (2.46 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 3150: (QA follow-up) Tidy scripts (22.63 KB, patch)
2023-03-14 17:09 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:07:03 UTC


---- Reported by wizzyrea@gmail.com 2009-04-23 14:40:27 ----

This is currently uneven in application. Holds notifications are editable through the web interface, but cart/list/shelf/suggestion response emails are governed by templates.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:07 UTC  ---

This bug was previously known as _bug_ 3150 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3150

Actual time not defined. Setting to 0.0
CC member kdr@ckls.org does not have an account here

Comment 1 Liz Rea 2012-02-20 16:32:01 UTC
We should add these templates to the notices system once it is pushed.
Comment 2 Katrin Fischer 2013-01-28 12:52:16 UTC
The one nice thing about the emails being in the templates is, that they are translatable. Maybe we could have an option to send cart/shelf list mails depending on chosen templates?
Comment 3 Katrin Fischer 2016-12-28 14:11:12 UTC
We had a lot of libraries ask about this by now - I didn't like the idea at the beginning because it would mean losing translatability. But there seems to be some recent work on making notices translatable - so that would be great.

Adding other bugs as see alsos:
Bug 17762 - Ability to translate notices
Comment 4 Katrin Fischer 2017-01-04 09:45:48 UTC
*** Bug 7983 has been marked as a duplicate of this bug. ***
Comment 5 Katrin Fischer 2019-05-04 20:08:34 UTC
The only hardcoded notifications at the moment that I can think of that are not dealt with on other bugs (ILL, slips for payment + fines) are cart and list. Changing the bug title to reflect that.

We'll need to make sure they work with the TranslateNotices system preference.
Comment 6 Katrin Fischer 2019-08-18 21:22:59 UTC
*** Bug 22931 has been marked as a duplicate of this bug. ***
Comment 7 Katrin Fischer 2019-11-24 12:53:37 UTC
*** Bug 23882 has been marked as a duplicate of this bug. ***
Comment 8 Katrin Fischer 2020-10-22 18:56:29 UTC
*** Bug 26786 has been marked as a duplicate of this bug. ***
Comment 9 Aleisha Amohia 2020-12-03 02:48:16 UTC
Created attachment 114127 [details] [review]
Bug 3150: WIP

This is not ready yet!
Comment 10 Aleisha Amohia 2020-12-17 00:38:53 UTC
I'm currently working on this, and a big goal is to make it work as a notice with the template toolkit syntax. I believe this depends on moving some of the old C4/Biblio.pm subroutines (GetMarcAuthors etc) into Koha/Biblio.pm. That work would be substantial and needs to be done first, in separate bugs.
Comment 11 Katrin Fischer 2020-12-17 09:35:27 UTC
Could we imagine replacing the old subroutines by a more generic approach of accessing the information in the MARC record instead of moving them? 

Thinking of something like:

[% record.245a %]
We can actually do something similar in CSV profiles, but it appears sadly undocumented in the manual: Bug 12404 (the help file with the documentation was removed, but some examples in the comment of the bug)

I think if we don't match the current output 100% that would actually be a good thing as the old routines sometimes display subfields that you don't really want to see in the notices, and it's all hard coded and not nice to use or change or format. So we will likely have more issues to deal with later on always coming back to these methods.

And it could be really useful for other notices as well (later).
Comment 12 Jonathan Druart 2020-12-17 09:59:51 UTC
Hello Aleisha,

This is a very interesting part to move to the notice templates!

However I am expecting it to be tricky, as you saw already :)

Before starting to implement anything I would suggest you to come with a plan. I can provide you early feedback to see if we are starting with the best solution.

In my opinion we should only pass Koha::Objects-based variables to the template. Reusing the existing variables will make us start with obsolete code (it will be harder to improve it in the future as the libraries will have this TT code in their templates).

(In reply to Katrin Fischer from comment #11)
> Could we imagine replacing the old subroutines by a more generic approach of
> accessing the information in the MARC record instead of moving them? 
> 
> Thinking of something like:
> 
> [% record.245a %]

Says we are talking about GetMarcUrls, it could be something like:
[% SET marc_record = biblio.metadata.record %]
[% FOR f IN marc_record.field('856') %]
  [%# Then do something for every 856 field
[% END %]

But then you are going to rewrite the code that is in a subroutine to a TT syntax, that will be copy/pasted in different places.
And it's not what we want, it's too error prone (no test coverage, dup of code).

The only long term and viable solution is to move them to the Koha namespace.
Have the Get* subroutines moved to Koha::Biblio methods, have the test coverage, replace the existing occurrences, and finally reuse them from the template notices.
But this task is huge...
Comment 13 Jonathan Druart 2020-12-17 10:58:51 UTC
I would start with passing Koha::Biblios to the template and see how easy/hard it is to replace the existing template file with a notice template using the TT syntax.

[% FOR biblio IN biblios %]

  [%# title and subtitle are easy to retrieve %]

  [%# authors, we loop on the MARC fields %]

  [%# isbn, we need Koha::Biblio->get_isbns %]

  [%# and so on...

[% END %]

First with send shelves at the OPAC.
Comment 14 Katrin Fischer 2020-12-17 11:25:52 UTC
Hi Aleisha, 

I think Joubu's right... after looking at the methods I realized that we need something easier to use for people in the templates and also something that will work with MARC21 and UNIMARC. 

Moving them one by one on separate bugs like you suggested is a good idea. Maybe we could use the feedback on bug 16522 or start with one to make sure we got a good pattern before moving all of them.
Comment 15 Aleisha Amohia 2020-12-17 19:57:08 UTC
Yup... What Joubu has said is just a longer way of saying what I said in my comment :) so glad we're all agreed.
Comment 16 Katrin Fischer 2020-12-17 20:05:44 UTC
(In reply to Aleisha Amohia from comment #15)
> Yup... What Joubu has said is just a longer way of saying what I said in my
> comment :) so glad we're all agreed.

Took me a little bit to get there :)
Comment 17 Aleisha Amohia 2020-12-17 23:09:07 UTC
Starting with GetMarcAuthors at Bug 27266
Comment 18 Aleisha Amohia 2020-12-18 01:21:22 UTC
GetMarcNotes at Bug 27268
Comment 19 Aleisha Amohia 2020-12-18 02:35:35 UTC
GetMarcSubjects at Bug 27269
Comment 20 Aleisha Amohia 2020-12-18 02:53:05 UTC
GetMarcSeries at Bug 27270
Comment 21 Aleisha Amohia 2020-12-18 02:53:43 UTC
GetMarcUrls at Bug 27271
Comment 22 Aleisha Amohia 2020-12-18 02:58:33 UTC
GetItemsInfo at Bug 27272
Comment 23 Jonathan Druart 2020-12-18 09:28:04 UTC
(In reply to Aleisha Amohia from comment #20)
> GetMarcSeries at Bug 27270

This is not used and is not needed from send-basket and send-shelves scripts. (ie. no "MARCSERIES" in templates)
Comment 24 Jonathan Druart 2020-12-18 09:29:32 UTC
(In reply to Aleisha Amohia from comment #18)
> GetMarcNotes at Bug 27268

No occurrences of "GetMarcNotes" from send-basket and send-shelves scripts.
Comment 25 Jonathan Druart 2020-12-18 09:46:04 UTC
(In reply to Aleisha Amohia from comment #17)
> Starting with GetMarcAuthors at Bug 27266

Are you sure you will want to reuse that from the template notice?
It seems that to answer bug 17868 you will only need to loop over the MARC subfields (for instance GetMarcAuthors is building links we don't need).

Additional questions: should not we take advantage of the move to fix the inconsistencies in the return values?

I don't think "just moving" code from C4 to Koha is sufficient.
Comment 26 Katrin Fischer 2020-12-18 10:03:28 UTC
(In reply to Jonathan Druart from comment #25)
> (In reply to Aleisha Amohia from comment #17)
> > Starting with GetMarcAuthors at Bug 27266
> 
> Are you sure you will want to reuse that from the template notice?
> It seems that to answer bug 17868 you will only need to loop over the MARC
> subfields (for instance GetMarcAuthors is building links we don't need).
> 
> Additional questions: should not we take advantage of the move to fix the
> inconsistencies in the return values?
> 
> I don't think "just moving" code from C4 to Koha is sufficient.

To further simplify things we could let go of the marcflavour parameter as this only seems to be used in context where the marcflavour of the installation is used.

I think another question is if we are using them only for the notices or to replace all calls to templates - if we want to replace the other calls, we'd need to keep the links etc.
Comment 27 Aleisha Amohia 2020-12-20 20:32:33 UTC
Ah I see what you're both saying. i'll give that a go
Comment 28 Tomás Cohen Arazi 2020-12-20 22:18:30 UTC
In my opinion, we should pass Koha::Object(s) to the template as much as possible. It will be much easier to document the things that are available for rendering, as opposed to the current situation, on which it is not straight forward to know what is available in which context.
Comment 29 Aleisha Amohia 2020-12-21 02:12:43 UTC
Created attachment 114545 [details] [review]
Bug 3150: WIP
Comment 30 Aleisha Amohia 2020-12-21 02:14:28 UTC
I've made some starting changes to the notices to use Koha::Biblio objects mostly (you can see it in the atomic update in the patch).

I need some guidance/help with a few things:
- I wasn't sure where to get the dewey and classification info from
- I wasn't sure which notes field to use (biblioitems or biblio)
- the Author and Subjects subroutines are the hardest for me to refactor because I'm not sure how different libraries use them

Some feedback would be great!
Comment 31 Jonathan Druart 2020-12-21 11:00:29 UTC
(In reply to Aleisha Amohia from comment #30)
> I've made some starting changes to the notices to use Koha::Biblio objects
> mostly (you can see it in the atomic update in the patch).
> 
> I need some guidance/help with a few things:
> - I wasn't sure where to get the dewey and classification info from

It looks like they are always empty.
It's broken since the following commit:
  commit af466ca41ab02150f4f6c60bf6262b079b2e6e85
  Date:   Thu Oct 18 18:53:52 2007 -0500
  start of reworking call number handling and other Biblio changes

IMO we should not reintroduce them on this bug report.

> - I wasn't sure which notes field to use (biblioitems or biblio)

It's coming GetBiblioData
 729     my $query = " SELECT * , biblioitems.notes AS bnotes, itemtypes.notforloan as bi_notforloan, biblio.notes                                                                                                

So it's the 'notes' from biblio.

> - the Author and Subjects subroutines are the hardest for me to refactor
> because I'm not sure how different libraries use them

Hum... Another weirdness.
On opac-sendshelf: MARCSUBJCTS is set but not used in the template, 'subject' is used instead, but never sent from the pl...
and it's the same for the other ones (sendbasket, sendshelf both OPAC and staff interfaces).
I'd drop it as well.

For MARCAUTHORS I'd try and write the equivalent of C4::Biblio::GetMarcAuthors in TT, and see how it goes (10 lines or 30 lines?). If it's too ugly then move to Koha::Biblio->get_MARC_authors (or get_authors_from_MARC?)

> Some feedback would be great!

Don't forget that you are in a quite dirty place. Don't loose time with things that are not working, drop them.
I'd suggest that you focus on the simplest template first, no need to work in parallel on the four ones.

Additional note, in your patch you are not looping at all on a Koha::Biblio set. As it's a WIP maybe you are aware of it, but I prefer to highlight it in case you missed it.
Comment 32 Aleisha Amohia 2020-12-21 21:10:44 UTC Comment hidden (obsolete)
Comment 33 Aleisha Amohia 2020-12-22 01:38:07 UTC Comment hidden (obsolete)
Comment 34 David Nind 2021-02-24 05:12:08 UTC Comment hidden (obsolete)
Comment 35 David Nind 2021-02-24 05:20:50 UTC
Testing notes (koha-testing-docker):
- I was able to test the emails being sent by copying the HTML for the message from the database and pasting it into a Thunderbird email message (Insert > HTML) - everything looked okay to me.
- I wasn't able to properly test the attachment, but I'm going to assume the code creates a valid iso2709 file for attaching, sending, and saving/viewing by the recipient.
- There was some minor things I noticed with the email input forms (the ones that pop up after you click the email buttons in Koha) - the 'Comment' label for the input box follows directly after the email address input box. Depending on the width of the pop up window the label isn't aligned properly to the left, but this behaviour is the same as what it was before the patch was applied.
Comment 36 Martin Renvoize 2021-03-16 11:46:48 UTC Comment hidden (obsolete)
Comment 37 Martin Renvoize 2021-03-16 11:49:27 UTC
This feels good in testing and QA scripts are passing.

Well done working through this Aleisha, I imagine it was rather painful.

Passing QA

(Caveat applies for dependanct bug, I think get_marc_authors is nicer than get_authors_from_MARC).
Comment 38 Jonathan Druart 2021-04-07 10:25:05 UTC
Why don't you HTML filter the variables in the template notice?
Comment 39 Jonathan Druart 2021-04-07 10:37:32 UTC
Do we still need the following files?

koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt
Comment 40 Aleisha Amohia 2021-05-05 04:32:14 UTC
(In reply to Jonathan Druart from comment #38)
> Why don't you HTML filter the variables in the template notice?

The original notices use $raw filtering (sendbasket.tt etc), so that's what I used. I can change them all to HTML.

(In reply to Jonathan Druart from comment #39)
> Do we still need the following files?
> 
> koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt
> koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt
> koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt
> koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt

I don't think so, I'll remove them.
Comment 41 Aleisha Amohia 2021-05-05 04:41:50 UTC Comment hidden (obsolete)
Comment 42 Aleisha Amohia 2021-05-05 04:41:56 UTC Comment hidden (obsolete)
Comment 43 David Nind 2021-05-13 12:18:36 UTC
I was too slow on this one as well... the patch no longer applies 8-(..

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 3150: Move emails for sending cart and list contents to notices
Using index info to reconstruct a base tree...
M	installer/data/mysql/en/mandatory/sample_notices.yml
M	installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
M	installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
A	installer/data/mysql/it-IT/necessari/notices.sql
M	installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
A	installer/data/mysql/pl-PL/mandatory/sample_notices.sql
A	installer/data/mysql/ru-RU/mandatory/sample_notices.sql
A	installer/data/mysql/uk-UA/mandatory/sample_notices.sql
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): installer/data/mysql/uk-UA/mandatory/sample_notices.sql deleted in HEAD and modified in Bug 3150: Move emails for sending cart and list contents to notices. Version Bug 3150: Move emails for sending cart and list contents to notices of installer/data/mysql/uk-UA/mandatory/sample_notices.sql left in tree.
CONFLICT (modify/delete): installer/data/mysql/ru-RU/mandatory/sample_notices.sql deleted in HEAD and modified in Bug 3150: Move emails for sending cart and list contents to notices. Version Bug 3150: Move emails for sending cart and list contents to notices of installer/data/mysql/ru-RU/mandatory/sample_notices.sql left in tree.
CONFLICT (modify/delete): installer/data/mysql/pl-PL/mandatory/sample_notices.sql deleted in HEAD and modified in Bug 3150: Move emails for sending cart and list contents to notices. Version Bug 3150: Move emails for sending cart and list contents to notices of installer/data/mysql/pl-PL/mandatory/sample_notices.sql left in tree.
Auto-merging installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
CONFLICT (modify/delete): installer/data/mysql/it-IT/necessari/notices.sql deleted in HEAD and modified in Bug 3150: Move emails for sending cart and list contents to notices. Version Bug 3150: Move emails for sending cart and list contents to notices of installer/data/mysql/it-IT/necessari/notices.sql left in tree.
Auto-merging installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
Auto-merging installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
Auto-merging installer/data/mysql/en/mandatory/sample_notices.yml
error: Failed to merge in the changes.
Patch failed at 0001 Bug 3150: Move emails for sending cart and list contents to notices
Comment 44 Aleisha Amohia 2021-05-17 01:29:03 UTC Comment hidden (obsolete)
Comment 45 Aleisha Amohia 2021-05-17 01:29:09 UTC Comment hidden (obsolete)
Comment 46 David Nind 2021-05-17 10:35:43 UTC Comment hidden (obsolete)
Comment 47 David Nind 2021-05-17 10:35:48 UTC Comment hidden (obsolete)
Comment 48 Marcel de Rooy 2021-06-25 08:59:49 UTC
Looking here
Comment 49 Marcel de Rooy 2021-06-25 09:27:13 UTC
There is a problem with these mails. I do not have an attachment, but this is in the body:

This is a multi-part message in MIME format.

--_----------=_1624613146275290
Content-Disposition: inline
Content-Length: 1127
Content-Transfer-Encoding: binary
Content-Type: text/html; charset="utf-8"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

[etc]
Comment 50 Marcel de Rooy 2021-06-25 09:28:09 UTC
+        my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress');

You might wonder if we should send this mail if the first_valid_email_address would be empty. Why should the recipient reply to the library here?
Comment 51 Marcel de Rooy 2021-06-25 09:29:01 UTC
This would be a great improvement imo. But it still needs soem attention..
Comment 52 Aleisha Amohia 2021-07-22 03:04:03 UTC Comment hidden (obsolete)
Comment 53 Aleisha Amohia 2021-07-22 03:04:09 UTC Comment hidden (obsolete)
Comment 54 Aleisha Amohia 2021-07-22 03:04:15 UTC Comment hidden (obsolete)
Comment 55 Aleisha Amohia 2021-07-22 03:05:21 UTC
(In reply to Marcel de Rooy from comment #49)
> There is a problem with these mails. I do not have an attachment, but this
> is in the body:
>

I think that is the way MIME::Lite works but correct me if I'm wrong! I think the attachment gets embedded in the email. So hard to test by looking at the message queue or notices tab, would be good to test with the actual email sent.
Comment 56 Marcel de Rooy 2021-07-28 12:05:40 UTC
(In reply to Aleisha Amohia from comment #55)
> (In reply to Marcel de Rooy from comment #49)
> > There is a problem with these mails. I do not have an attachment, but this
> > is in the body:
> >
> 
> I think that is the way MIME::Lite works but correct me if I'm wrong! I
> think the attachment gets embedded in the email. So hard to test by looking
> at the message queue or notices tab, would be good to test with the actual
> email sent.

IIRC I looked here at the emails via Outlook web client.
Comment 57 Aleisha Amohia 2021-09-24 01:38:37 UTC
Created attachment 125225 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 58 Aleisha Amohia 2021-09-24 01:38:44 UTC
Created attachment 125226 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Comment 59 Aleisha Amohia 2021-09-24 01:38:59 UTC
Created attachment 125227 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.
Comment 60 Owen Leonard 2021-09-24 10:51:41 UTC
I get an error from the opac-sendbasket popup whether or not I'm logged in:

Could not compile /kohadevbox/koha/opac/opac-sendbasket.pl: syntax error at /kohadevbox/koha/opac/opac-sendbasket.pl line 122, near "else"
BEGIN not safe after errors--compilation aborted at /kohadevbox/koha/opac/opac-sendbasket.pl line 137.

The QA tool also raises several warnings.
Comment 61 Aleisha Amohia 2021-09-27 23:01:23 UTC
Created attachment 125379 [details] [review]
Bug 3150: (follow-up) Add missing bracket
Comment 62 Aleisha Amohia 2021-09-27 23:03:04 UTC
(In reply to Owen Leonard from comment #60)
> I get an error from the opac-sendbasket popup whether or not I'm logged in:
> 
> Could not compile /kohadevbox/koha/opac/opac-sendbasket.pl: syntax error at
> /kohadevbox/koha/opac/opac-sendbasket.pl line 122, near "else"
> BEGIN not safe after errors--compilation aborted at
> /kohadevbox/koha/opac/opac-sendbasket.pl line 137.

Have fixed

> 
> The QA tool also raises several warnings.

The QA test tools all pass for me - can you please paste the output?
Comment 63 David Nind 2021-10-05 08:03:13 UTC
Patch no longer applies 8-(..

Applying: Bug 3150: Move emails for sending cart and list contents to notices
Using index info to reconstruct a base tree...
M	basket/sendbasket.pl
M	opac/opac-sendbasket.pl
M	opac/opac-sendshelf.pl
M	virtualshelves/sendshelf.pl
Falling back to patching base and 3-way merge...
Auto-merging virtualshelves/sendshelf.pl
CONFLICT (content): Merge conflict in virtualshelves/sendshelf.pl
Auto-merging opac/opac-sendshelf.pl
CONFLICT (content): Merge conflict in opac/opac-sendshelf.pl
Auto-merging opac/opac-sendbasket.pl
CONFLICT (content): Merge conflict in opac/opac-sendbasket.pl
Auto-merging basket/sendbasket.pl
CONFLICT (content): Merge conflict in basket/sendbasket.pl
error: Failed to merge in the changes.
Patch failed at 0001 Bug 3150: Move emails for sending cart and list contents to notices
hint: Use 'git am --show-current-patch' to see the failed patch
Comment 64 Aleisha Amohia 2021-10-19 20:42:04 UTC
Created attachment 126544 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 65 Aleisha Amohia 2021-10-19 20:42:10 UTC
Created attachment 126545 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Comment 66 Aleisha Amohia 2021-10-19 20:42:19 UTC
Created attachment 126546 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.
Comment 67 Aleisha Amohia 2021-10-19 20:42:29 UTC
Created attachment 126547 [details] [review]
Bug 3150: (follow-up) Add missing bracket
Comment 68 Caroline Cyr La Rose 2022-02-01 16:18:25 UTC
Patch doesn't apply :/
Comment 69 Aleisha Amohia 2022-02-03 20:26:40 UTC
Sorry this applied cleanly for me! Can you please paste your merge conflict output?
Comment 70 Aleisha Amohia 2022-02-03 20:27:34 UTC
Oops commented on the wrong bug!
Comment 71 Aleisha Amohia 2022-02-03 20:43:00 UTC
Created attachment 130150 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 72 Aleisha Amohia 2022-02-03 20:43:07 UTC
Created attachment 130151 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Comment 73 Aleisha Amohia 2022-02-03 20:43:14 UTC
Created attachment 130152 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.
Comment 74 Aleisha Amohia 2022-02-03 20:43:20 UTC
Created attachment 130153 [details] [review]
Bug 3150: (follow-up) Add missing bracket
Comment 75 Shi Yao Wang 2022-03-10 18:22:35 UTC
Merge conflict when applying 27266:

Falling back to patching base and 3-way merge...
Auto-merging virtualshelves/sendshelf.pl
CONFLICT (content): Merge conflict in virtualshelves/sendshelf.pl
Auto-merging t/db_dependent/Koha/Biblio.t
CONFLICT (content): Merge conflict in t/db_dependent/Koha/Biblio.t
Auto-merging t/Biblio.t
Auto-merging opac/opac-sendshelf.pl
CONFLICT (content): Merge conflict in opac/opac-sendshelf.pl
Auto-merging opac/opac-sendbasket.pl
CONFLICT (content): Merge conflict in opac/opac-sendbasket.pl
Auto-merging opac/opac-detail.pl
Auto-merging opac/opac-basket.pl
CONFLICT (content): Merge conflict in opac/opac-basket.pl
Auto-merging basket/sendbasket.pl
CONFLICT (content): Merge conflict in basket/sendbasket.pl
Auto-merging basket/basket.pl
CONFLICT (content): Merge conflict in basket/basket.pl
Auto-merging Koha/Biblio.pm
CONFLICT (content): Merge conflict in Koha/Biblio.pm
Auto-merging C4/Biblio.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 27266: Move GetMarcAuthors to Koha namespace
Comment 76 Aleisha Amohia 2022-03-10 22:40:19 UTC
Bug 27266 has already been upstreamed so you don't need to apply it first. Bug 3150 should apply cleanly on the latest main branch.
Comment 77 Martin Renvoize 2022-03-11 11:50:15 UTC
Hmm, should we be dropping the X-Abuse-Report headers here?.. was that deliberate?
Comment 78 Katrin Fischer 2022-03-11 23:26:22 UTC
Maybe a reabase issue - we do want to keep them.
Comment 79 Aleisha Amohia 2022-03-13 23:00:10 UTC
Hi both,

Would it be reasonable to add the X-Abuse-Report part to the C4::Letters::_send_message_by_email? This is the only place I can see to specify a header. If so I can create a different bug that this one can depend on.

Also, is that specified because we use KohaAdminEmailAddress as the from address?

Aleisha
Comment 80 Katrin Fischer 2022-03-14 08:18:54 UTC
I think I have confused it with another thing we did a while ago as an anti-Spam measure (bug 24588)

I am not sure if it has to do with the from address, but there are other notices we send or potentially send from KohaAdminEmailAddress, like the cart emails.

Martin, as you pointed it out, do we need to keep (and maybe move to a separate report to make it consistent) or can we drop that here?
Comment 81 Christian Stelzenmüller 2022-04-26 13:04:39 UTC
Hi everyone,

i'm sorry, step 7 in the test plan doesn't work for me. There are no messages in the message queue.

I hope i'm not doing anything wrong. I also tried applying bug 3150 and 27266, one after the other, because i wasn't sure, but the results were the same.
Comment 82 Owen Leonard 2022-04-26 15:51:26 UTC
I got errors from each of these scripts:

basket/sendbasket.pl
opac/opac-sendbasket.pl
opac/opac-sendshelf.pl
virtualshelves/sendshelf.pl

The default CART and LIST notices contain HTML but the "HTML message" checkbox is not checked when I edit the notice.

When viewing the list of notices, I see this:

+─────────+───────+────────────+
| module  | Code  | Name       |
+─────────+───────+────────────+
| catalog | CART  | Send cart  |
| catalog | LIST  | Send list  |
+─────────+───────+────────────+

But when I edit either of those notices "Acquisitions" is selected as the module. This isn't the case with other notices.
Comment 83 Aleisha Amohia 2022-04-28 22:13:36 UTC
Created attachment 134304 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 84 Aleisha Amohia 2022-04-28 22:13:43 UTC
Created attachment 134305 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Comment 85 Aleisha Amohia 2022-04-28 22:13:49 UTC
Created attachment 134306 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.
Comment 86 Aleisha Amohia 2022-04-28 22:13:56 UTC
Created attachment 134307 [details] [review]
Bug 3150: (follow-up) Add missing bracket
Comment 87 Aleisha Amohia 2022-04-28 22:14:02 UTC
Created attachment 134308 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices
Comment 88 David Nind 2022-04-29 23:26:07 UTC
Hi Aleisha.

The same as Christian in comment #81, nothing is showing up for me in the message_queue table (using koha-testing-docker) as per step 7.

Email address set for the account used (koha in this case) and I also added a valid email address for KohaAdminEmailAddress.

I also tested with the sending of emails enabled,* and nothing came through (they did come through before applying the patch).

* To enable basic email sending by adding this to koha-conf.xml (user_name = gmail address, password = app password set up for your account):

<smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>youraddress@gmail.com</user_name>
    <password>yourpassword</password>
    <debug>1</debug>
 </smtp_server>

David
Comment 89 Owen Leonard 2022-05-02 17:02:17 UTC
I notice this in the error logs, FWIW:

[2022/05/02 16:47:55] [WARN] No catalog CART letter transported by email at /kohadevbox/koha/C4/Letters.pm line 583.
[2022/05/02 16:48:20] [WARN] No catalog LIST letter transported by email at /kohadevbox/koha/C4/Letters.pm line 583.

I do see the CART and LIST notices in the staff interface.

+-----------+------+-----------+----------------------------------+
| module    | code | name      | title                            |
+-----------+------+-----------+----------------------------------+
| catalogue | CART | Send cart | Your cart                        |
| catalogue | LIST | Send list | Your list: [% listname | html %] |
+-----------+------+-----------+----------------------------------+
Comment 90 Aleisha Amohia 2022-05-02 21:25:11 UTC
Created attachment 134477 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices
Comment 91 David Nind 2022-05-03 09:30:54 UTC
Patch no longer applies 8-(..

git bz apply 3150

Bug 3150 - Move emails for sending cart and list contents into notices tool

134304 - Bug 3150: Move emails for sending cart and list contents to notices
134305 - Bug 3150: (follow-up) HTML filtering TT notices and removing old files
134306 - Bug 3150: (follow-up) Reformat notices, don't send if no sender email
134307 - Bug 3150: (follow-up) Add missing bracket
134477 - Bug 3150: (follow-up) Fixing errors and notices

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 3150: Move emails for sending cart and list contents to notices
Using index info to reconstruct a base tree...
M	installer/data/mysql/en/mandatory/sample_notices.yml
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/en/mandatory/sample_notices.yml
CONFLICT (content): Merge conflict in installer/data/mysql/en/mandatory/sample_notices.yml
error: Failed to merge in the changes.
Patch failed at 0001 Bug 3150: Move emails for sending cart and list contents to notices
Comment 92 Katrin Fischer 2022-05-06 07:21:42 UTC
I tried to fix the conflict, but then I get:

git bz apply --continue
Applying: Bug 3150: Move emails for sending cart and list contents to notices
Applying: Bug 3150: (follow-up) HTML filtering TT notices and removing old files
Applying: Bug 3150: (follow-up) Reformat notices, don't send if no sender email
Applying: Bug 3150: (follow-up) Add missing bracket
Applying: Bug 3150: (follow-up) Fixing errors and notices
error: sha1 information is lacking or useless (installer/data/mysql/en/mandatory/sample_notices.yml).
error: could not build fake ancestor
Patch failed at 0001 Bug 3150: (follow-up) Fixing errors and notices
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-3150-follow-up-Fixing-errors-and-notices-m9LiH9.patch

Aleisha, can you please have a look?
Comment 93 Aleisha Amohia 2022-07-14 05:16:27 UTC
Created attachment 137690 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 94 Aleisha Amohia 2022-07-14 05:16:33 UTC
Created attachment 137691 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Comment 95 Aleisha Amohia 2022-07-14 05:16:40 UTC
Created attachment 137692 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.
Comment 96 Aleisha Amohia 2022-07-14 05:16:46 UTC
Created attachment 137693 [details] [review]
Bug 3150: (follow-up) Add missing bracket
Comment 97 Aleisha Amohia 2022-07-14 05:16:52 UTC
Created attachment 137694 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices
Comment 98 David Nind 2022-07-14 13:43:37 UTC
Created attachment 137716 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 99 David Nind 2022-07-14 13:43:44 UTC
Created attachment 137717 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 100 David Nind 2022-07-14 13:43:50 UTC
Created attachment 137718 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 101 David Nind 2022-07-14 13:43:56 UTC
Created attachment 137719 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 102 David Nind 2022-07-14 13:44:03 UTC
Created attachment 137720 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 103 David Nind 2022-07-14 14:02:40 UTC
Testing notes (using koha-testing-docker):

1. I ran through the test plan both before and after applying the patches.

2. After the patches are applied, remember to update the database! Otherwise, the new notices are not added, and you get a warning in the log files:
 [2022/07/14 13:01:00] [WARN] No catalogue LIST letter transported by email at /kohadevbox/koha/C4/Letters.pm line 583.
  [2022/07/14 13:07:33] [WARN] No catalogue CART letter transported by email at /kohadevbox/koha/C4/Letters.pm line 583.

3. Enable basic email sending by adding this to the instance koha-conf.xml (user_name = gmail address, password = app password set up for your account, not your normal password):

<smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>youraddress@gmail.com</user_name>
    <password>yourapppassword</password>
    <debug>1</debug>
 </smtp_server>

4. Added an email address to koha user, added email addresses for KohaAdminEmailAddress and ReplytoDefault (not sure if this was required).

5. Before the patch was applied, steps 3 and 4 were sufficient for the lists and cart contents to be sent to the email address.

6. After the patches are applied, the messages are now put in the message queue (koha-mysql kohadev, then select * from message_queue;).

7. To send the messages so you can review them in your email client, run misc/cronjobs/process_message_queue.pl
Comment 104 Katrin Fischer 2022-07-19 15:58:56 UTC
Created attachment 137878 [details] [review]
Bug 3150: (follow-up) Fix .yml formatting

 FAIL	  yaml_valid
 YAML::XS::Load Error: The problem:      did not find expected key  was found at document: 1, line: 1748, column: 1 while parsing a block mapping at line: 23, column: 1
Comment 105 Katrin Fischer 2022-08-26 17:08:19 UTC
Patches currently don't apply and the conflicts looked a bit too intimidating for me:

Applying: Bug 3150: Move emails for sending cart and list contents to notices
Using index info to reconstruct a base tree...
M	basket/sendbasket.pl
M	installer/data/mysql/en/mandatory/sample_notices.yml
M	opac/opac-sendbasket.pl
M	opac/opac-sendshelf.pl
M	virtualshelves/sendshelf.pl
Falling back to patching base and 3-way merge...
Auto-merging virtualshelves/sendshelf.pl
CONFLICT (content): Merge conflict in virtualshelves/sendshelf.pl
Auto-merging opac/opac-sendshelf.pl
CONFLICT (content): Merge conflict in opac/opac-sendshelf.pl
Auto-merging opac/opac-sendbasket.pl
CONFLICT (content): Merge conflict in opac/opac-sendbasket.pl
Auto-merging installer/data/mysql/en/mandatory/sample_notices.yml
Auto-merging basket/sendbasket.pl
CONFLICT (content): Merge conflict in basket/sendbasket.pl
error: Failed to merge in the changes.
Patch failed at 0001 Bug 3150: Move emails for sending cart and list contents to notices
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-3150-Move-emails-for-sending-cart-and-list-con-Oc2KWz.patch
Comment 106 Martin Renvoize 2022-09-07 06:45:18 UTC
(In reply to Katrin Fischer from comment #80)
> I think I have confused it with another thing we did a while ago as an
> anti-Spam measure (bug 24588)
> 
> I am not sure if it has to do with the from address, but there are other
> notices we send or potentially send from KohaAdminEmailAddress, like the
> cart emails.
> 
> Martin, as you pointed it out, do we need to keep (and maybe move to a
> separate report to make it consistent) or can we drop that here?

I think we can probably drop it actually.. I can't find anywhere in the wider world that recognises that header at all.
Comment 107 Martin Renvoize 2022-09-07 06:57:32 UTC
Comment on attachment 137716 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

Review of attachment 137716 [details] [review]:
-----------------------------------------------------------------

::: basket/sendbasket.pl
@@ +101,5 @@
> +        my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress');
> +        C4::Letters::EnqueueLetter({
> +            letter => $letter,
> +            message_transport_type => 'email',
> +            borrowernumber => $patron->borrowernumber,

I'm not sure we should be setting borrowernumber here.. it's somewhat misleading as the notice will appear as being sent to this borrower under their notices.. we don't really have the directionality in the UI to clearly show if a message was inbound or outbound so I don't know that it should be tied to the user here.
Comment 108 Martin Renvoize 2022-09-07 06:58:07 UTC
Agree with Katrin.. I'm not close enough to this code to do the rebase.. not sure what's changed to cause the conflict so unpicking the diff is challenging.
Comment 109 Martin Renvoize 2022-09-07 07:09:00 UTC
Created attachment 140246 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 110 Martin Renvoize 2022-09-07 07:09:06 UTC
Created attachment 140247 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 111 Martin Renvoize 2022-09-07 07:09:12 UTC
Created attachment 140248 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 112 Martin Renvoize 2022-09-07 07:09:18 UTC
Created attachment 140249 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 113 Martin Renvoize 2022-09-07 07:09:23 UTC
Created attachment 140250 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 114 Martin Renvoize 2022-09-07 07:09:28 UTC
Created attachment 140251 [details] [review]
Bug 3150: (follow-up) Fix .yml formatting

 FAIL	  yaml_valid
 YAML::XS::Load Error: The problem:      did not find expected key  was found at document: 1, line: 1748, column: 1 while parsing a block mapping at line: 23, column: 1
Comment 115 Martin Renvoize 2022-09-07 07:09:34 UTC
Created attachment 140252 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter
Comment 116 Martin Renvoize 2022-09-07 07:12:30 UTC
Created attachment 140253 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 117 Martin Renvoize 2022-09-07 07:12:36 UTC
Created attachment 140254 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 118 Martin Renvoize 2022-09-07 07:12:42 UTC
Created attachment 140255 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 119 Martin Renvoize 2022-09-07 07:12:48 UTC
Created attachment 140256 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 120 Martin Renvoize 2022-09-07 07:12:54 UTC
Created attachment 140257 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 121 Martin Renvoize 2022-09-07 07:13:03 UTC
Created attachment 140258 [details] [review]
Bug 3150: (follow-up) Fix .yml formatting

 FAIL	  yaml_valid
 YAML::XS::Load Error: The problem:      did not find expected key  was found at document: 1, line: 1748, column: 1 while parsing a block mapping at line: 23, column: 1
Comment 122 Martin Renvoize 2022-09-07 07:13:08 UTC
Created attachment 140259 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter
Comment 123 Martin Renvoize 2022-09-07 07:13:38 UTC
The rebase wasn't too terrible actually..  back to you Katrin
Comment 124 Aleisha Amohia 2022-09-07 20:57:26 UTC
Thanks Martin!
Comment 125 David Cook 2022-12-05 00:45:52 UTC
Looking forward to this one...
Comment 126 Aleisha Amohia 2023-01-12 03:23:35 UTC
Created attachment 145229 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 127 Aleisha Amohia 2023-01-12 03:23:44 UTC
Created attachment 145230 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 128 Aleisha Amohia 2023-01-12 03:23:54 UTC
Created attachment 145231 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 129 Aleisha Amohia 2023-01-12 03:24:04 UTC
Created attachment 145232 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 130 Aleisha Amohia 2023-01-12 03:24:13 UTC
Created attachment 145233 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 131 Aleisha Amohia 2023-01-12 03:24:22 UTC
Created attachment 145234 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter
Comment 132 David Nind 2023-01-12 18:48:29 UTC
I'm getting an sha1 error when trying to apply the patch:

git bz apply 3150

Bug 3150 - Move emails for sending cart and list contents into notices tool

140258 - Bug 3150: (follow-up) Fix .yml formatting
145229 - Bug 3150: Move emails for sending cart and list contents to notices
145230 - Bug 3150: (follow-up) HTML filtering TT notices and removing old files
145231 - Bug 3150: (follow-up) Reformat notices, don't send if no sender email
145232 - Bug 3150: (follow-up) Add missing bracket
145233 - Bug 3150: (follow-up) Fixing errors and notices
145234 - Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 3150: (follow-up) Fix .yml formatting
error: sha1 information is lacking or useless (installer/data/mysql/en/mandatory/sample_notices.yml).
error: could not build fake ancestor
Patch failed at 0001 Bug 3150: (follow-up) Fix .yml formatting
Comment 133 Aleisha Amohia 2023-01-25 21:02:59 UTC
That patch should've been made obsolete, fixed
Comment 134 David Nind 2023-01-25 22:23:21 UTC
Created attachment 145676 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 135 David Nind 2023-01-25 22:23:30 UTC
Created attachment 145677 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 136 David Nind 2023-01-25 22:23:39 UTC
Created attachment 145678 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 137 David Nind 2023-01-25 22:23:47 UTC
Created attachment 145679 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 138 David Nind 2023-01-25 22:23:55 UTC
Created attachment 145680 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 139 David Nind 2023-01-25 22:24:04 UTC
Created attachment 145681 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Signed-off-by: David Nind <david@davidnind.com>
Comment 140 David Nind 2023-01-25 22:25:27 UTC
(In reply to Aleisha Amohia from comment #133)
> That patch should've been made obsolete, fixed

Thanks Aleisha!

Testing notes -- unchanged: see comment #103
Comment 141 Katrin Fischer 2023-02-03 14:03:43 UTC
Hi Aleisha,

with bug 16522 now pushed, this no longer applies. Could you pleas rebase? 

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 3150: Move emails for sending cart and list contents to notices
Using index info to reconstruct a base tree...
M	basket/sendbasket.pl
M	opac/opac-sendbasket.pl
M	opac/opac-sendshelf.pl
M	virtualshelves/sendshelf.pl
Falling back to patching base and 3-way merge...
Auto-merging virtualshelves/sendshelf.pl
CONFLICT (content): Merge conflict in virtualshelves/sendshelf.pl
Auto-merging opac/opac-sendshelf.pl
CONFLICT (content): Merge conflict in opac/opac-sendshelf.pl
Auto-merging opac/opac-sendbasket.pl
CONFLICT (content): Merge conflict in opac/opac-sendbasket.pl
Auto-merging basket/sendbasket.pl
CONFLICT (content): Merge conflict in basket/sendbasket.pl
error: Failed to merge in the changes.
Patch failed at 0001 Bug 3150: Move emails for sending cart and list contents to notices
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-3150-Move-emails-for-sending-cart-and-list-con-7TAJ75.patch
Comment 142 Aleisha Amohia 2023-02-13 01:18:03 UTC
Created attachment 146560 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 143 Aleisha Amohia 2023-02-13 01:18:08 UTC
Created attachment 146561 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 144 Aleisha Amohia 2023-02-13 01:18:14 UTC
Created attachment 146562 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 145 Aleisha Amohia 2023-02-13 01:18:19 UTC
Created attachment 146563 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 146 Aleisha Amohia 2023-02-13 01:18:24 UTC
Created attachment 146564 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 147 Aleisha Amohia 2023-02-13 01:18:29 UTC
Created attachment 146565 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Signed-off-by: David Nind <david@davidnind.com>
Comment 148 Aleisha Amohia 2023-02-13 01:18:34 UTC
Created attachment 146566 [details] [review]
Bug 3150: (follow-up) Use get_marc_contributors
Comment 149 Katrin Fischer 2023-02-17 16:23:19 UTC
Created attachment 146858 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 150 Katrin Fischer 2023-02-17 16:23:23 UTC
Created attachment 146859 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 151 Katrin Fischer 2023-02-17 16:23:28 UTC
Created attachment 146860 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Comment 152 Katrin Fischer 2023-02-17 16:23:32 UTC
Created attachment 146861 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Comment 153 Katrin Fischer 2023-02-17 16:23:37 UTC
Created attachment 146862 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Comment 154 Katrin Fischer 2023-02-17 16:23:41 UTC
Created attachment 146863 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Signed-off-by: David Nind <david@davidnind.com>
Comment 155 Katrin Fischer 2023-02-17 16:23:46 UTC
Created attachment 146864 [details] [review]
Bug 3150: (follow-up) Use get_marc_contributors
Comment 156 Katrin Fischer 2023-02-17 16:23:50 UTC
Created attachment 146865 [details] [review]
Bug 3150: Fix file permission on database update file
Comment 157 Katrin Fischer 2023-02-17 16:23:54 UTC
Created attachment 146866 [details] [review]
Bug 3150: (follow-up) Send list and cart emails immediately again

With this patch set the cart and list emails are sent via
the message_queue instead of bypassing it and being sent
immediately. This patch keeps them in message_queue, but
also sends them immediately, restoring the previous behavior.
Comment 158 Katrin Fischer 2023-02-17 16:23:59 UTC
Created attachment 146867 [details] [review]
Bug 3150: (follow-up) Improve and fix new notice templates

This fixes several issues found and improves formatting:

* Add missing line breaks <br> where required as we are now using HTML
* Add missing USE statements to show
  * library
  * location
  * Link to the OPAC (Preference was not resolved)
* Make sure there is a comma between library and location
* Make sure Author(s): only displays when there is content after
* The comment field allows multi-line comments, formatting is now preserved
Comment 159 Katrin Fischer 2023-02-17 16:25:22 UTC
I have to say, I am not sad to see a lot of this old code go away,especially the old template files. This appears as quite a code clean-up.

10 files changed, 306 insertions(+), 1083 deletions(-)

1) The database update and the sample files are both marked as "is_html", but were missing some line breaks and such. I ended up also fixing some issues with missing USE statements causing the OPAC link to not display.

--> Follow-up provided, see commit message for more details

2) Currently the mails are sent immediately, this should be kept moving forward.

--> Follow-up provided

3) The notices need to be amended to include the changes from bug 16522 to avoid a regression:

Bug 16522 - Add 773 (Host item entry) to the cart and list displays and e-mails

--> I got stuck on this one, could you please take a look, Aleisha?
Comment 160 Aleisha Amohia 2023-02-20 23:18:50 UTC
Created attachment 146987 [details] [review]
Bug 3150: Include host item entries in LIST and CART notices

Incorporating fixes from Bug 16522
Comment 161 Katrin Fischer 2023-02-21 15:38:11 UTC
With the last patch I get an error in the send form:

ERROR PROCESSING TEMPLATE: undef error - ... at input text line 21.
at /kohadevbox/koha/virtualshelves/sendshelf.pl line 100.
at /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm line 289
Comment 162 Aleisha Amohia 2023-02-27 00:27:38 UTC
Created attachment 147423 [details] [review]
Bug 3150: (follow-up) Make subs to get host/related parts for notices
Comment 163 Katrin Fischer 2023-03-07 18:04:15 UTC
Created attachment 147868 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 164 Katrin Fischer 2023-03-07 18:04:20 UTC
Created attachment 147869 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 165 Katrin Fischer 2023-03-07 18:04:24 UTC
Created attachment 147870 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 166 Katrin Fischer 2023-03-07 18:04:28 UTC
Created attachment 147871 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 167 Katrin Fischer 2023-03-07 18:04:32 UTC
Created attachment 147872 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 168 Katrin Fischer 2023-03-07 18:04:37 UTC
Created attachment 147873 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 169 Katrin Fischer 2023-03-07 18:04:41 UTC
Created attachment 147874 [details] [review]
Bug 3150: (follow-up) Use get_marc_contributors

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 170 Katrin Fischer 2023-03-07 18:04:46 UTC
Created attachment 147875 [details] [review]
Bug 3150: Fix file permission on database update file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 171 Katrin Fischer 2023-03-07 18:04:50 UTC
Created attachment 147876 [details] [review]
Bug 3150: (follow-up) Send list and cart emails immediately again

With this patch set the cart and list emails are sent via
the message_queue instead of bypassing it and being sent
immediately. This patch keeps them in message_queue, but
also sends them immediately, restoring the previous behavior.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 172 Katrin Fischer 2023-03-07 18:04:54 UTC
Created attachment 147877 [details] [review]
Bug 3150: (follow-up) Improve and fix new notice templates

This fixes several issues found and improves formatting:

* Add missing line breaks <br> where required as we are now using HTML
* Add missing USE statements to show
  * library
  * location
  * Link to the OPAC (Preference was not resolved)
* Make sure there is a comma between library and location
* Make sure Author(s): only displays when there is content after
* The comment field allows multi-line comments, formatting is now preserved

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 173 Katrin Fischer 2023-03-07 18:04:58 UTC
Created attachment 147878 [details] [review]
Bug 3150: Include host item entries in LIST and CART notices

Incorporating fixes from Bug 16522

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 174 Katrin Fischer 2023-03-07 18:05:03 UTC
Created attachment 147879 [details] [review]
Bug 3150: (follow-up) Make subs to get host/related parts for notices

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 175 Katrin Fischer 2023-03-07 18:05:07 UTC
Created attachment 147880 [details] [review]
Bug 3150: (follow-up) Make sure host information displays for unlinked records

When the 773 entry is not linked to a record using $w or
Easyanalytics we still want to display the information
about the source/host item in the emails.

To test:
1. Activate the UseControlNumber system preference
2. Search for a record and make sure it has 001 set to some value.
3. Use Edit > Add child record to create an analytical record from this record.
4. Make sure 773$w was filled in and finish by adding any mandatory fields, save.
5. Add this record to your cart. Also add a 773$g with the pages or similar.
6. Create another record with 773$t and $g, but without $w.
7. Also add this record to your cart.
8. Add a few other records to the cart.
9. Host item information (In: ) should display for all entries with 773 in the record.

This also makes use of the biblio-title include to display the
different parts of the title (245$abnp), if the record is linked.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 176 Aleisha Amohia 2023-03-10 02:54:51 UTC
Created attachment 148045 [details] [review]
Bug 3150: (follow-up) Make sure host information displays for unlinked records

When the 773 entry is not linked to a record using $w or
Easyanalytics we still want to display the information
about the source/host item in the emails.

To test:
1. Activate the UseControlNumber system preference
2. Search for a record and make sure it has 001 set to some value.
3. Use Edit > Add child record to create an analytical record from this record.
4. Make sure 773$w was filled in and finish by adding any mandatory fields, save.
5. Add this record to your cart. Also add a 773$g with the pages or similar.
6. Create another record with 773$t and $g, but without $w.
7. Also add this record to your cart.
8. Add a few other records to the cart.
9. Host item information (In: ) should display for all entries with 773 in the record.

This also makes use of the biblio-title include to display the
different parts of the title (245$abnp), if the record is linked.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 177 Aleisha Amohia 2023-03-10 02:55:14 UTC
Katrin's follow-up looks great so have done an additional sign-off
Comment 178 Kyle M Hall 2023-03-14 17:08:34 UTC
Created attachment 148170 [details] [review]
Bug 3150: Move emails for sending cart and list contents to notices

This patch creates notices using Template Toolkit syntax for sending
emails containing cart and list contents.

To test:
1. Apply Bug 27266
2. Run update database and restart services
3. In the staff client, add multiple items to your cart and to a list
4. Go to your cart and click Send to email the contents
5. Add an email and a comment and click Send
6. Confirm the information shown in the success message is correct
7. In your terminal, log into the database. View the message queue ( i.e. select * from message_queue; ). Confirm that your email has been queued and the content is all correct. Confirm the cart contents has been included as an attachment.
8. Go to your list and click Send list to email the contents
9. Repeat steps 5-7
10. Log into the OPAC
11. Add multiple items to your cart and to a list
12. Repeat steps 4-9
13. By the end, you should have four emails in your message queue. All
of the data about the items should be correct, they should all have
attachments, and be addressed to the correct email address.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 179 Kyle M Hall 2023-03-14 17:08:44 UTC
Created attachment 148171 [details] [review]
Bug 3150: (follow-up) HTML filtering TT notices and removing old files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 180 Kyle M Hall 2023-03-14 17:08:48 UTC
Created attachment 148172 [details] [review]
Bug 3150: (follow-up) Reformat notices, don't send if no sender email

This patch reformats the notices so that the is_html flag is disabled
and the notices display better

It also throws an error if trying to send an email but the logged in
borrower has no valid email address.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 181 Kyle M Hall 2023-03-14 17:08:52 UTC
Created attachment 148173 [details] [review]
Bug 3150: (follow-up) Add missing bracket

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 182 Kyle M Hall 2023-03-14 17:08:56 UTC
Created attachment 148174 [details] [review]
Bug 3150: (follow-up) Fixing errors and notices

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 183 Kyle M Hall 2023-03-14 17:08:59 UTC
Created attachment 148175 [details] [review]
Bug 3150: (QA follow-up) Remove borrowernumber from EnqueueLetter

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 184 Kyle M Hall 2023-03-14 17:09:03 UTC
Created attachment 148176 [details] [review]
Bug 3150: (follow-up) Use get_marc_contributors

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 185 Kyle M Hall 2023-03-14 17:09:07 UTC
Created attachment 148177 [details] [review]
Bug 3150: Fix file permission on database update file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 186 Kyle M Hall 2023-03-14 17:09:11 UTC
Created attachment 148178 [details] [review]
Bug 3150: (follow-up) Send list and cart emails immediately again

With this patch set the cart and list emails are sent via
the message_queue instead of bypassing it and being sent
immediately. This patch keeps them in message_queue, but
also sends them immediately, restoring the previous behavior.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 187 Kyle M Hall 2023-03-14 17:09:15 UTC
Created attachment 148179 [details] [review]
Bug 3150: (follow-up) Improve and fix new notice templates

This fixes several issues found and improves formatting:

* Add missing line breaks <br> where required as we are now using HTML
* Add missing USE statements to show
  * library
  * location
  * Link to the OPAC (Preference was not resolved)
* Make sure there is a comma between library and location
* Make sure Author(s): only displays when there is content after
* The comment field allows multi-line comments, formatting is now preserved

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 188 Kyle M Hall 2023-03-14 17:09:18 UTC
Created attachment 148180 [details] [review]
Bug 3150: Include host item entries in LIST and CART notices

Incorporating fixes from Bug 16522

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 189 Kyle M Hall 2023-03-14 17:09:22 UTC
Created attachment 148181 [details] [review]
Bug 3150: (follow-up) Make subs to get host/related parts for notices

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 190 Kyle M Hall 2023-03-14 17:09:26 UTC
Created attachment 148182 [details] [review]
Bug 3150: (follow-up) Make sure host information displays for unlinked records

When the 773 entry is not linked to a record using $w or
Easyanalytics we still want to display the information
about the source/host item in the emails.

To test:
1. Activate the UseControlNumber system preference
2. Search for a record and make sure it has 001 set to some value.
3. Use Edit > Add child record to create an analytical record from this record.
4. Make sure 773$w was filled in and finish by adding any mandatory fields, save.
5. Add this record to your cart. Also add a 773$g with the pages or similar.
6. Create another record with 773$t and $g, but without $w.
7. Also add this record to your cart.
8. Add a few other records to the cart.
9. Host item information (In: ) should display for all entries with 773 in the record.

This also makes use of the biblio-title include to display the
different parts of the title (245$abnp), if the record is linked.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 191 Kyle M Hall 2023-03-14 17:09:30 UTC
Created attachment 148183 [details] [review]
Bug 3150: (QA follow-up) Remove unused variables

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 192 Kyle M Hall 2023-03-14 17:09:34 UTC
Created attachment 148184 [details] [review]
Bug 3150: (QA follow-up) Don't load unused and deleted tt files

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 193 Kyle M Hall 2023-03-14 17:09:37 UTC
Created attachment 148185 [details] [review]
Bug 3150: (QA follow-up) Tidy scripts

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 194 Katrin Fischer 2023-03-15 06:55:51 UTC
Thanks, Kyle!
Comment 195 Tomás Cohen Arazi 2023-03-27 10:47:13 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 196 Matt Blenkinsop 2023-04-11 09:04:18 UTC
Enhancement - not backporting to 22.11.x

Nice work everyone!
Comment 197 Katrin Fischer 2023-07-09 08:31:20 UTC
*** Bug 11443 has been marked as a duplicate of this bug. ***
Comment 198 Martin Renvoize 2024-02-08 16:41:06 UTC
This exposed intranet-facing data in opac baskets :(.  We dropped the filters from the metadata record fetching :S
Comment 199 Martin Renvoize 2024-02-08 16:42:10 UTC
I'm fixing it in whilst rebasing bug 31224.. but it's a bit upsetting that we opened up that leak.