Bugzilla – Attachment 134489 Details for
Bug 29100
Add checkouts data loop to predue/due notices script (advance_notices.pl)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )
Bug-29100-Add-checkouts-data-loop-to-predue-notice.patch (text/plain), 4.97 KB, created by
Nick Clemens
on 2022-05-03 09:58:23 UTC
(
hide
)
Description:
Bug 29100: Add checkouts data loop to predue notices script ( advance_notices.pl )
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2022-05-03 09:58:23 UTC
Size:
4.97 KB
patch
obsolete
>From d2b36d2c6f4a419c05427edb82a49a566604d625 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Thu, 23 Sep 2021 13:24:42 -0400 >Subject: [PATCH] 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> >--- > misc/cronjobs/advance_notices.pl | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 96029dced0..b31d295855 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -292,7 +292,9 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > my $letter_type = 'DUE'; > $sth->execute($upcoming->{'borrowernumber'},$upcoming->{'itemnumber'},'0'); > my $titles = ""; >+ my @issues; > while ( my $item_info = $sth->fetchrow_hashref()) { >+ push( @issues, $item_info ); > $titles .= C4::Letters::get_item_content( { item => $item_info, item_content_fields => \@item_content_fields } ); > } > >@@ -303,7 +305,10 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > branchcode => $branchcode, > biblionumber => $item->biblionumber, > itemnumber => $upcoming->{'itemnumber'}, >- substitute => { 'items.content' => $titles }, >+ substitute => { >+ 'items.content' => $titles, >+ issue => $issues[0], >+ }, > message_transport_type => $transport, > } ) > or warn "no letter of type '$letter_type' found for borrowernumber ".$upcoming->{'borrowernumber'}.". Please see sample_notices.sql"; >@@ -339,7 +344,9 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > my $letter_type = 'PREDUE'; > $sth->execute($upcoming->{'borrowernumber'},$upcoming->{'itemnumber'},$borrower_preferences->{'days_in_advance'}); > my $titles = ""; >+ my @issues; > while ( my $item_info = $sth->fetchrow_hashref()) { >+ push( @issues, $item_info ); > $titles .= C4::Letters::get_item_content( { item => $item_info, item_content_fields => \@item_content_fields } ); > } > >@@ -350,7 +357,10 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > branchcode => $branchcode, > biblionumber => $item->biblionumber, > itemnumber => $upcoming->{'itemnumber'}, >- substitute => { 'items.content' => $titles }, >+ substitute => { >+ 'items.content' => $titles, >+ issue => $issues[0], >+ }, > message_transport_type => $transport, > } ) > or warn "no letter of type '$letter_type' found for borrowernumber ".$upcoming->{'borrowernumber'}.". Please see sample_notices.sql"; >@@ -587,7 +597,9 @@ sub send_digests { > borrower_preferences => $borrower_preferences > }); > my $titles = ""; >+ my @issues; > while ( my $item_info = $next_item_info->()) { >+ push( @issues, $item_info ); > $titles .= C4::Letters::get_item_content( { item => $item_info, item_content_fields => \@item_content_fields } ); > } > >@@ -596,9 +608,11 @@ sub send_digests { > { > letter_code => $params->{letter_code}, > borrowernumber => $borrowernumber, >+ issues => \@issues, > substitute => { > count => $count, > 'items.content' => $titles, >+ issues => \@issues, > %branch_info > }, > branchcode => $branchcode, >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29100
:
125217
|
125218
|
125219
|
134489
|
134490
|
134926
|
134927
|
137996
|
143898
|
143910
|
143911
|
143912
|
145235