Bugzilla – Attachment 41689 Details for
Bug 10468
Add pending holds to summary print
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10468: Adding holds table to summary print
Bug-10468-Adding-holds-table-to-summary-print.patch (text/plain), 3.89 KB, created by
Aleisha Amohia
on 2015-08-20 06:30:18 UTC
(
hide
)
Description:
Bug 10468: Adding holds table to summary print
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2015-08-20 06:30:18 UTC
Size:
3.89 KB
patch
obsolete
>From 72b24220dd291b5821b031be195a4b1b0e0d7687 Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Thu, 20 Aug 2015 03:34:48 +0000 >Subject: [PATCH] Bug 10468: Adding holds table to summary print > >To test: >1) Add a hold to a patron >2) Go to patron page >3) Click Print Summary >4) Confirm that 'Pending Holds' table displays with correct information under appropriate headings (should be Title, Author, Placed on (reserve date), Expires on (expiration date), and Pick up library) >--- > .../prog/en/modules/members/moremember-print.tt | 23 ++++++++++++ > members/summary-print.pl | 38 +++++++++++++++++++- > 2 files changed, 60 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >index 92526e8..2f744f3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >@@ -67,6 +67,29 @@ > </table> > [% END %] > >+ [% IF ( reserves ) %] >+ <table> >+ <caption>Pending holds</caption> >+ <tr> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Placed on</th> >+ <th>Expires on</th> >+ <th>Pick up location</th> >+ </tr> >+ >+ [% FOREACH reserve IN reserves %] >+ <tr> >+ <td>[% reserve.title %]</td> >+ <td>[% reserve.author %]</td> >+ <td>[% reserve.reservedate | $KohaDates %]</td> >+ <td>[% reserve.expirationdate | $KohaDates %]</td> >+ <td>[% reserve.waiting_at %]</td> >+ </tr> >+ [% END %] >+ </table> >+ [% END %] >+ > [% IF ( accounts && ( totaldue != '0.00' ) ) %] > <table> > <caption>Account fines and payments</caption> >diff --git a/members/summary-print.pl b/members/summary-print.pl >index 4530e14..118fd24 100755 >--- a/members/summary-print.pl >+++ b/members/summary-print.pl >@@ -24,6 +24,9 @@ use C4::Output; > use C4::Members; > use C4::Koha qw( getitemtypeinfo ); > use C4::Circulation qw( GetIssuingCharges ); >+use C4::Reserves; >+use C4::Items; >+use Koha::Holds; > > my $input = CGI->new; > my $borrowernumber = $input->param('borrowernumber'); >@@ -55,9 +58,13 @@ foreach my $accountline (@$accts) { > } > > my $roadtype = >- C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >+ C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ) // ''; > > our $totalprice = 0; >+my $holds_rs = Koha::Holds->search( >+ { borrowernumber => $borrowernumber }, >+); >+ > $template->param( > %$data, > >@@ -69,6 +76,8 @@ $template->param( > > issues => build_issue_data( GetPendingIssues($borrowernumber) ), > totalprice => $totalprice, >+ >+ reserves => build_reserve_data( $holds_rs ), > ); > > output_html_with_http_headers $input, $cookie, $template->output; >@@ -103,4 +112,31 @@ sub build_issue_data { > @{$return} = sort { $a->{date_due} <=> $b->{date_due} } @{$return}; > > return $return; >+ >+} >+ >+sub build_reserve_data { >+ my $reserves = shift; >+ >+ my $return = []; >+ >+ my $today = DateTime->now( time_zone => C4::Context->tz ); >+ $today->truncate( to => 'day' ); >+ >+ while ( my $reserve = $reserves->next() ) { >+ >+ my $row = { >+ title => $reserve->biblio()->title(), >+ author => $reserve->biblio()->author(), >+ reservedate => $reserve->reservedate(), >+ expirationdate => $reserve->expirationdate(), >+ waiting_at => $reserve->branch()->branchname(), >+ }; >+ >+ push( @{$return}, $row ); >+ } >+ >+ @{$return} = sort { $a->{reservedate} <=> $b->{reservedate} } @{$return}; >+ >+ return $return; > } >-- >1.7.10.4
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 10468
:
41689
|
42133
|
45217
|
45250