@@ -, +, @@
template
---
.../intranet-tmpl/prog/en/includes/holds_table.inc | 46 ++++++++++++++++++++--
reserve/request.pl | 25 ++++++++++++
2 files changed, 68 insertions(+), 3 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
@@ -20,7 +20,48 @@
[% IF SuspendHoldsIntranet %]
| [% END %]
- [% FOREACH hold IN holds %]
+ [% IF (grouped_holds) %]
+ [% FOREACH group_level_hold IN grouped_holds %]
+
+ |
+ |
+ [% INCLUDE 'patron-title.inc' patron=group_level_hold.patron hide_patron_infos_if_needed=1 %] |
+ [% group_level_hold.hold.notes %] |
+ [% group_level_hold.hold.date %] |
+ [% group_level_hold.hold.expirationdate %] |
+
+ [% IF ( group_level_hold.hold.found ) %]
+ [% IF ( group_level_hold.hold.atdestination ) %]
+ [% IF ( group_level_hold.hold.found ) %]
+ Item waiting at [% group_level_hold.hold.wbrname %] since [% group_level_hold.hold.waiting_date | $KohaDates %]
+ [% ELSE %]
+ Waiting to be pulled
+ [% END %]
+ [% ELSE %]
+ Item being transferred to [% group_level_hold.hold.wbrname %]
+ [% END %]
+ [% ELSE %]
+ [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
+ [% Branches.GetName(group_level_hold.hold.branchcode) %]
+ [% ELSE %]
+
+ [% END %]
+ [% END %]
+ |
+
+ [% IF group_level_hold.hold.hold_group_id %]
+
+ [% END %]
+ |
+ |
+ |
+ |
+
+ [% END %]
+ [% ELSE %]
+ [% FOREACH hold IN holds %]
@@ -197,6 +238,5 @@
[% END # IF SuspendHoldsIntranet %]
|
-
- [% END %]
+ [% END %]
--- a/reserve/request.pl
+++ a/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();
--