Bugzilla – Attachment 80317 Details for
Bug 21528
Combine all reserves in a biblio hold-group into a single line entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21528: Display reserves in hold_group as single row in template
Bug-21528-Display-reserves-in-holdgroup-as-single-.patch (text/plain), 5.76 KB, created by
Alex Buckley
on 2018-10-10 00:41:52 UTC
(
hide
)
Description:
Bug 21528: Display reserves in hold_group as single row in template
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-10-10 00:41:52 UTC
Size:
5.76 KB
patch
obsolete
>From ef7de2a70f8633b9dd800fe47296e4816583925e Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Thu, 4 Oct 2018 19:49:27 +0000 >Subject: [PATCH] Bug 21528: Display reserves in hold_group as single row in > template > >--- > .../prog/en/modules/reserve/request.tt | 48 ++++++++++++++++++++-- > reserve/request.pl | 32 +++++++++++++++ > 2 files changed, 77 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index c70969b..3e2e09c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -809,7 +809,49 @@ function checkMultiHold() { > <th> </th> > [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] > </tr> >- [% FOREACH reserveloo IN biblioloo.reserveloop %] >+ >+ [% IF (grouped_holds) %] >+ [% FOREACH group_level_hold IN grouped_holds %] >+ <tr> >+ <td></td> >+ <td></td> >+ <td>[% INCLUDE 'patron-title.inc' patron=group_level_hold.patron hide_patron_infos_if_needed=1 %]</td> >+ <td>[% group_level_hold.hold.notes %]</td> >+ <td>[% group_level_hold.hold.date %]</td> >+ <td>[% group_level_hold.hold.expirationdate %]</td> >+ <td> >+ [% IF ( group_level_hold.hold.found ) %] >+ [% IF ( group_level_hold.hold.atdestination ) %] >+ [% IF ( group_level_hold.hold.found ) %] >+ Item waiting at <b> [% group_level_hold.hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% group_level_hold.hold.wbrcode %]" /> since [% group_level_hold.hold.waiting_date | $KohaDates %] >+ [% ELSE %] >+ Waiting to be pulled <input type="hidden" name="pickup" value="[% group_level_hold.hold.wbrcode %]" /> >+ [% END %] >+ [% ELSE %] >+ Item being transferred to <b> [% group_level_hold.hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% group_level_hold.hold.wbrcode %]" /> >+ [% END %] >+ [% ELSE %] >+ [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %] >+ [% Branches.GetName(group_level_hold.hold.branchcode) %] <input type="hidden" name="pickup" value="[% group_level_hold.hold.branchcode %]" /> >+ [% ELSE %] >+ <select name="pickup"> >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => group_level_hold.hold.branchcode ) %] >+ </select> >+ [% END %] >+ [% END %] >+ </td> >+ <td> >+ [% IF group_level_hold.hold.hold_group_id %] >+ <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% group_level_hold.hold.hold_group_id %]">hold group</a>)</div> >+ [% END %] >+ </td> >+ <td></td> >+ <td></td> >+ <td></td> >+ </tr> >+ [% END %] >+ [% ELSE %] >+ [% FOREACH reserveloo IN biblioloo.reserveloop %] > <tr> > <td> > <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" /> >@@ -889,7 +931,7 @@ function checkMultiHold() { > <td> > [% IF ( reserveloo.found ) %] > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> >- [% IF ( reserveloo.barcodenumber ) %] >+ [% IF ( reserveloo.barcodenumber ) %] > [% reserveloo.barcodenumber %] > <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" /> > [% ELSE %] >@@ -959,7 +1001,7 @@ function checkMultiHold() { > [% END # IF SuspendHoldsIntranet %] > > </tr> >- >+ [% END %] > [% END %] <!-- existing reserveloop --> > </table> > [% END %]<!-- /reserveloop --> >diff --git a/reserve/request.pl b/reserve/request.pl >index f876be3..43ae106 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -53,6 +53,7 @@ use Koha::ItemTypes; > use Koha::Libraries; > use Koha::Patrons; > use POSIX qw(strftime); >+use Data::Dumper; > > my $dbh = C4::Context->dbh; > my $input = new CGI; >@@ -635,6 +636,37 @@ foreach my $biblionumber (@biblionumbers) { > push( @reserveloop, \%reserve ); > } > >+ my %reserve_records; >+ for my $reserve ( @reserveloop ) { >+ if ($reserve->{'hold_group_id'}) { >+ # Keep track of which hold_group_id (duplicated field) go with each itemnumber (unique field) >+ $reserve_records{ $reserve->{hold_group_id} }->{ $reserve->{itemnumber} }++; >+ } >+ } >+ >+ my @grouped_parts; >+ for my $hold_group ( sort { $a <=> $b } keys %reserve_records ) { >+ my @tickets = sort { $a <=> $b } keys %{ $reserve_records{ $hold_group } }; >+ my @holds = GetHoldGroupHolds($hold_group); >+ my $hold = $holds[0]; >+ my $patron = Koha::Patrons->find( {borrowernumber => $hold->{borrowernumber}} ); >+ >+ # Merge the ticket ids with each ipn >+ push @grouped_parts, { >+ hold_group_id => $hold_group, >+ itemnumber => join(', ', sort { $a <=> $b } @tickets), >+ hold => $hold, >+ patron => $patron, >+ }; >+ } >+ >+ foreach my $hold (@grouped_parts) { >+ warn Dumper($hold->{hold}); >+ } >+ if (@grouped_parts) { >+ $template->param( grouped_holds => \@grouped_parts ); >+ } >+ > # get the time for the form name... > my $time = time(); > >-- >2.1.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 21528
:
80317
|
80319
|
80376
|
80443
|
88042
|
88124