Bug 29100 - Add checkouts data loop to predue/due notices script (advance_notices.pl)
Summary: Add checkouts data loop to predue/due notices script (advance_notices.pl)
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall (khall)
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 32211
  Show dependency treegraph
 
Reported: 2021-09-23 17:18 UTC by Kyle M Hall (khall)
Modified: 2023-02-15 21:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.03
Circulation function:


Attachments
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl ) (4.90 KB, patch)
2021-09-23 17:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (3.87 KB, patch)
2021-09-23 17:42 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (3.86 KB, patch)
2021-09-23 17:47 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl ) (4.97 KB, patch)
2022-05-03 09:58 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (3.93 KB, patch)
2022-05-03 09:58 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl ) (5.00 KB, patch)
2022-05-12 13:45 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (3.93 KB, patch)
2022-05-12 13:46 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (3.98 KB, patch)
2022-07-21 23:11 UTC, George Veranis
Details | Diff | Splinter Review
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s) (2.33 KB, patch)
2022-11-15 11:58 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl ) (5.05 KB, patch)
2022-11-15 15:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29100: Remove unnecessary loops (4.04 KB, patch)
2022-11-15 15:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s) (2.78 KB, patch)
2022-11-15 15:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s) (3.57 KB, patch)
2023-01-12 12:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2021-09-23 17:18:03 UTC
Predue / due notices are limited to using itemscontent to display checkouts data. It would be nice to make all the checkouts data available for those notices so that libraries could format that data more nicely if they wish.
Comment 1 Kyle M Hall (khall) 2021-09-23 17:37:53 UTC
Created attachment 125217 [details] [review]
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )

Predue / due notices are limited to using itemscontent to display checkouts data. It would be nice to make all the checkouts data available for those notices so that libraries could format that data more nicely if they wish.

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
Title: [% issue.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
Titles:
[% FOREACH i IN issues %]
* [% i.title %]
[% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles
Comment 2 Kyle M Hall (khall) 2021-09-23 17:42:23 UTC
Created attachment 125218 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only
Comment 3 Kyle M Hall (khall) 2021-09-23 17:47:05 UTC
Created attachment 125219 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only
Comment 4 Nick Clemens (kidclamp) 2022-05-03 09:58:23 UTC
Created attachment 134489 [details] [review]
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )

Predue / due notices are limited to using itemscontent to display checkouts data. It would be nice to make all the checkouts data available for those notices so that libraries could format that data more nicely if they wish.

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
Title: [% issue.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
Titles:
[% FOREACH i IN issues %]
* [% i.title %]
[% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Comment 5 Nick Clemens (kidclamp) 2022-05-03 09:58:27 UTC
Created attachment 134490 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Comment 6 Kyle M Hall (khall) 2022-05-12 13:45:53 UTC
Created attachment 134926 [details] [review]
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )

Predue / due notices are limited to using itemscontent to display checkouts data. It would be nice to make all the checkouts data available for those notices so that libraries could format that data more nicely if they wish.

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
Title: [% issue.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
Titles:
[% FOREACH i IN issues %]
* [% i.title %]
[% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Comment 7 Kyle M Hall (khall) 2022-05-12 13:46:03 UTC
Created attachment 134927 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Comment 8 Victor Grousset/tuxayo 2022-07-12 00:40:04 UTC
Hi :)

If I understand correctly there will be a change for existing notices. items.content now is the 1st title instead of the concatenation of all of them. Is that correct?
I don't know what is the template variable where it end but it's content will change then.
Comment 9 George Veranis 2022-07-21 23:11:41 UTC
Created attachment 137996 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 10 Sally 2022-07-29 10:51:14 UTC
This will be a great enhancement, thank you, Kyle :)
Comment 11 Katrin Fischer 2022-08-27 12:11:13 UTC
I fully support having an TT based option besides items.content for these notices. It's about time! But I am still a bit confused about this patch :(

What information can I get from issue or issues? (which tables?) We'll definitely need to document. As it has the title in your example, I assume it's not just a line from the issues table, but more than that.

https://wiki.koha-community.org/wiki/Notices_with_Template_Toolkit#Variables_available_in_each_notice

Terminology: We really should be using checkout instead of issue.

If we use checkout(s), will it be the same as the one available in other notices?
Comment 12 Kyle M Hall (khall) 2022-09-23 18:04:51 UTC
(In reply to Katrin Fischer from comment #11)
> I fully support having an TT based option besides items.content for these
> notices. It's about time! But I am still a bit confused about this patch :(
> 
> What information can I get from issue or issues? (which tables?) We'll
> definitely need to document. As it has the title in your example, I assume
> it's not just a line from the issues table, but more than that.
> 
> https://wiki.koha-community.org/wiki/
> Notices_with_Template_Toolkit#Variables_available_in_each_notice
> 
> Terminology: We really should be using checkout instead of issue.
> 
> If we use checkout(s), will it be the same as the one available in other
> notices?

Yes, that is correct. It gives that notice access to the checkout object, which means the library can can then have much greater ability to customize the format of the notice than with items.content. The library gets access to the checkout, the bib and the item data ( among others ).
Comment 13 Katrin Fischer 2022-10-08 16:15:42 UTC
Hi Kyle,

can we please use checkout and checkouts instead of issue? Then it would match with the other notices:

https://wiki.koha-community.org/wiki/Notices_with_Template_Toolkit
Comment 14 Katrin Fischer 2022-11-14 22:00:56 UTC
Would still love to have this.
Comment 15 Kyle M Hall (khall) 2022-11-15 11:58:36 UTC
Created attachment 143898 [details] [review]
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s)
Comment 16 Katrin Fischer 2022-11-15 15:32:33 UTC
Created attachment 143910 [details] [review]
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )

Predue / due notices are limited to using itemscontent to display checkouts data. It would be nice to make all the checkouts data available for those notices so that libraries could format that data more nicely if they wish.

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
Title: [% issue.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
Titles:
[% FOREACH i IN issues %]
* [% i.title %]
[% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2022-11-15 15:32:37 UTC
Created attachment 143911 [details] [review]
Bug 29100: Remove unnecessary loops

Remove loops that only operate one one result only

Signed-off-by: Felicity Brown <Felicity.Brown@montgomerycountymd.gov>
Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2022-11-15 15:32:43 UTC
Created attachment 143912 [details] [review]
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s)

Adapted test plan:

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
   Title: [% checkout.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
   Titles:
   [% FOREACH c IN checkouts %]
    * [% c.title %][% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Tomás Cohen Arazi (tcohen) 2023-01-12 12:22:02 UTC
Created attachment 145235 [details] [review]
Bug 29100: (QA follow-up) Rename issue(s) keys to checkout(s)

Adapted test plan:

1) Apply this patch
2) For DUE and PREDUE notices, set the message body to the following:
   Title: [% checkout.title %]
3) For DUEDGST and PREDUEDGST notices, set the message body to the following:
   Titles:
   [% FOREACH c IN checkouts %]
    * [% c.title %][% END %]
4) Generate PREDUE and DUE notices for patrons including digests
5) Verify those notices contain the checkout titles

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tcohen renamed @issues => @checkouts as well
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 20 Tomás Cohen Arazi (tcohen) 2023-02-08 12:05:59 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 21 Pedro Amorim 2023-02-09 13:15:58 UTC
Nice work everyone!

Pushed to 22.11.x for next release
Comment 22 Lucas Gass (lukeg) 2023-02-15 21:42:28 UTC
Enhancement will not be backported to 22.05.x.