Bugzilla – Attachment 10332 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]
[SIGNED-OFF] Bug 3383 - Item due reminder digests - cannot display title information
SIGNED-OFF-Bug-3383---Item-due-reminder-digests---.patch (text/plain), 5.58 KB, created by
Katrin Fischer
on 2012-06-17 14:40:41 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 3383 - Item due reminder digests - cannot display title information
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-06-17 14:40:41 UTC
Size:
5.58 KB
patch
obsolete
>From f429d0dda14ecfae6e72a0a18b002b7b61f4a04b 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] [SIGNED-OFF] 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. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >I like the idea to show a warning, but I would perhaps move >it under the message body label to be more obvious. > >Patch works nicely, branch data of my user's home library >is displayed in the notice. >--- > .../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 374b2f1..c156e01 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 e89b8ae..fac95db 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.9.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