Bugzilla – Attachment 45217 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), 4.05 KB, created by
Héctor Eduardo Castro Avalos
on 2015-11-27 21:00:14 UTC
(
hide
)
Description:
Bug 10468: Adding holds table to summary print
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2015-11-27 21:00:14 UTC
Size:
4.05 KB
patch
obsolete
>From f051e763ea868054e36b180027281a2ec903abd9 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) > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised >--- > .../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..3c2fe04 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 7bed793..d2d3210 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'); >@@ -56,13 +59,17 @@ foreach my $accountline (@$accts) { > } > > my $roadtype = >- C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >+ C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ) // ''; > $roadtype = '' if ( ! $roadtype ); > > our $totalprice = 0; > my $total_format = ''; > $total_format = sprintf( "%.2f", $total ) if ($total); > >+my $holds_rs = Koha::Holds->search( >+ { borrowernumber => $borrowernumber }, >+); >+ > $template->param( > %$data, > >@@ -74,6 +81,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; >@@ -109,4 +118,31 @@ sub build_issue_data { > @{$return} = sort { $a->{date_due} eq $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