Bugzilla – Attachment 7424 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]
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.
0001-Bug-3383-Item-due-reminder-digests-Allow-use-of-bran.patch (text/plain), 4.05 KB, created by
Kyle M Hall
on 2012-02-02 18:36:28 UTC
(
hide
)
Description:
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.
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-02-02 18:36:28 UTC
Size:
4.05 KB
patch
obsolete
>From b7814ad32cb861f6d3348f8ae8e84b1e2e9850b5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 2 Feb 2012 12:47:58 -0500 >Subject: [PATCH] Bug 3383 - Item due reminder digests - Allow use of branches fields in message body. > >This commit solves one problem related to Bug 3383. The branches fields are >available to insert into the message body, but they are not parsed by >advance_notices.pl. This commit causes advance_notices.pl to parse >those fields, and also adds a warning to letter.pl to alert users >that those fields will refer to the borrower's home library. >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 1 + > misc/cronjobs/advance_notices.pl | 32 ++++++++++++++++++- > 2 files changed, 31 insertions(+), 2 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 063236e..87c8a6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -250,6 +250,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" /></fieldset> > </form> >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 1fa358f..5ec0fec 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -259,10 +259,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 ); >+ > $letter = parse_letter( { letter => $letter, > borrowernumber => $borrowernumber, > substitute => { count => $count, >- 'items.content' => $titles >+ 'items.content' => $titles, >+ %branch_info, > } > } ); > if ($nomail) { >@@ -298,10 +303,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 ); >+ > $letter = parse_letter( { letter => $letter, > borrowernumber => $borrowernumber, > substitute => { count => $count, >- 'items.content' => $titles >+ 'items.content' => $titles, >+ %branch_info, > } > } ); > >@@ -359,6 +369,24 @@ sub parse_letter { > return $params->{'letter'}; > } > >+=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