Bugzilla – Attachment 8872 Details for
Bug 3383
Item due reminder digests - cannot display title information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3383 - Item due reminder digests - cannot display title information
Bug-3383---Item-due-reminder-digests---cannot-disp.patch (text/plain), 5.33 KB, created by
Kyle M Hall
on 2012-04-04 14:29:44 UTC
(
hide
)
Description:
Bug 3383 - Item due reminder digests - cannot display title information
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-04-04 14:29:44 UTC
Size:
5.33 KB
patch
obsolete
>From 3b9bcfec1a7a12c11aa0f4eaf845dc5fe28b679d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 4 Apr 2012 09:56:11 -0400 >Subject: [PATCH] Bug 3383 - Item due reminder digests - cannot display title information > >Adds the ability to use branches.* fields in digest notices and >have them be parsed correctly. Also adds a warning to the notices >editor for digests. >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 1 + > misc/cronjobs/advance_notices.pl | 39 ++++++++++++++++++-- > 2 files changed, 36 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index a0c2c37..01cc70f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -319,6 +319,7 @@ $(document).ready(function() { > > </li> > </ol> >+ [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %] > </fieldset> > <fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset> > <input type="hidden" name="searchfield" value="[% searchfield %]" /> >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index de00846..17d0a7d 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -160,7 +160,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields; > $titles .= join("\t",@item_info) . "\n"; > } >- >+ >+ ## Get branch info for borrowers home library. > $letter = parse_letter( { letter_code => $letter_type, > borrowernumber => $upcoming->{'borrowernumber'}, > branchcode => $upcoming->{'branchcode'}, >@@ -191,7 +192,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields; > $titles .= join("\t",@item_info) . "\n"; > } >- >+ >+ ## Get branch info for borrowers home library. > $letter = parse_letter( { letter_code => $letter_type, > borrowernumber => $upcoming->{'borrowernumber'}, > branchcode => $upcoming->{'branchcode'}, >@@ -252,10 +254,15 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) { > my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields; > $titles .= join("\t",@item_info) . "\n"; > } >+ >+ ## Get branch info for borrowers home library. >+ my %branch_info = get_branch_info( $borrowernumber ); >+ > my $letter = parse_letter( { letter_code => $letter_type, > borrowernumber => $borrowernumber, > substitute => { count => $count, >- 'items.content' => $titles >+ 'items.content' => $titles, >+ %branch_info, > } > } ) > or die "no letter of type '$letter_type' found. Please see sample_notices.sql"; >@@ -290,10 +297,15 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$due_digest ) { > my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields; > $titles .= join("\t",@item_info) . "\n"; > } >+ >+ ## Get branch info for borrowers home library. >+ my %branch_info = get_branch_info( $borrowernumber ); >+ > my $letter = parse_letter( { letter_code => $letter_type, > borrowernumber => $borrowernumber, > substitute => { count => $count, >- 'items.content' => $titles >+ 'items.content' => $titles, >+ %branch_info, > } > } ) > or die "no letter of type '$letter_type' found. Please see sample_notices.sql"; >@@ -353,6 +365,25 @@ sub format_date { > return output_pref($dt); > } > >+=head2 get_branch_info >+ >+=cut >+ >+sub get_branch_info { >+ my ( $borrowernumber ) = @_; >+ >+ ## Get branch info for borrowers home library. >+ my $borrower_details = C4::Members::GetMemberDetails( $borrowernumber ); >+ my $borrower_branchcode = $borrower_details->{'branchcode'}; >+ my $branch = C4::Branch::GetBranchDetail( $borrower_branchcode ); >+ my %branch_info; >+ foreach my $key( keys %$branch ) { >+ $branch_info{"branches.$key"} = $branch->{$key}; >+ } >+ >+ return %branch_info; >+} >+ > 1; > > __END__ >-- >1.7.2.5
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 3383
:
7424
|
8872
|
10332
|
10613
|
10888