Bugzilla – Attachment 80319 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), 4.95 KB, created by
Alex Buckley
on 2018-10-10 01:39:43 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 01:39:43 UTC
Size:
4.95 KB
patch
obsolete
>From 8e0739a56e11db37e97f1dfe12098d872d81719c Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 9 Oct 2018 17:11:35 +0000 >Subject: [PATCH] Bug 21528: Display reserves in hold_group as single row in > template > >Sponsored-By: Brimbank library, Australia >--- > .../intranet-tmpl/prog/en/includes/holds_table.inc | 46 ++++++++++++++++++++-- > reserve/request.pl | 25 ++++++++++++ > 2 files changed, 68 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 9751001..b7b2656 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -20,7 +20,48 @@ > [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] > </tr> > >- [% FOREACH hold IN holds %] >+ [% 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 hold IN holds %] > <tr> > <td> > <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> >@@ -197,6 +238,5 @@ > [% END # IF SuspendHoldsIntranet %] > > </tr> >- >- [% END %] >+ [% END %] > </table> >diff --git a/reserve/request.pl b/reserve/request.pl >index 053f097..042eadd 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -596,6 +596,31 @@ 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, >+ }; >+ } >+ 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