Bugzilla – Attachment 80376 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: Single line for hold groups in intranet side
Bug-21528-Single-line-for-hold-groups-in-intranet-.patch (text/plain), 6.73 KB, created by
Alex Buckley
on 2018-10-11 05:23:00 UTC
(
hide
)
Description:
Bug 21528: Single line for hold groups in intranet side
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-10-11 05:23:00 UTC
Size:
6.73 KB
patch
obsolete
>From bed84b2a4856cd29093345835b716669883a920f Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Wed, 10 Oct 2018 10:05:33 +0000 >Subject: [PATCH] Bug 21528: Single line for hold groups in intranet side > >Sponsored-By: Brimbank Library, Australia >--- > .../prog/en/modules/reserve/request.tt | 46 ++++++++++++++++++++-- > reserve/request.pl | 38 +++++++++++++++++- > 2 files changed, 78 insertions(+), 6 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..a2304f3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -809,6 +809,48 @@ function checkMultiHold() { > <th> </th> > [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] > </tr> >+ [% IF (grouped_holds) %] >+ [% FOREACH group_level_hold IN grouped_holds %] >+ <tr> >+ <td>Group hold: <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% group_level_hold.hold.hold_group_id %]">hold group</a></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.reservenotes %]</td> >+ <td>[% group_level_hold.hold.reservedate | $KohaDates %]</td> >+ <td>[% group_level_hold.hold.expirationdate | $KohaDates %]</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 %] >+ [% END %] >+ > [% FOREACH reserveloo IN biblioloo.reserveloop %] > <tr> > <td> >@@ -917,9 +959,6 @@ function checkMultiHold() { > <input type="hidden" name="itemnumber" value="" /> > [% END %] > [% END %] >- [% IF reserveloo.hold_group_id %] >- <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% reserveloo.hold_group_id %]">hold group</a>)</div> >- [% END %] > </td> > > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >@@ -959,7 +998,6 @@ function checkMultiHold() { > [% END # IF SuspendHoldsIntranet %] > > </tr> >- > [% END %] <!-- existing reserveloop --> > </table> > [% END %]<!-- /reserveloop --> >diff --git a/reserve/request.pl b/reserve/request.pl >index 4cf6c07..c848dcd 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -42,6 +42,7 @@ use Koha::DateUtils; > use C4::Utils::DataTables::Members; > use C4::Members; > use C4::Search; # enabled_staff_search_views >+use Data::Dumper; > > use Koha::Biblios; > use Koha::DateUtils; >@@ -568,6 +569,7 @@ foreach my $biblionumber (@biblionumbers) { > } @reserves > ) > { >+ > my $priority = $res->priority(); > my %reserve; > my @optionloop; >@@ -580,7 +582,6 @@ foreach my $biblionumber (@biblionumbers) { > } > ); > } >- > if ( $res->is_found() ) { > $reserve{'holdingbranch'} = $res->item()->holdingbranch(); > $reserve{'biblionumber'} = $res->item()->biblionumber(); >@@ -631,10 +632,43 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{itemtype} = $res->itemtype(); > $reserve{branchcode} = $res->branchcode(); > $reserve{'hold_group_id'} = $res->hold_group_id; >- > push( @reserveloop, \%reserve ); > } > >+ my %reserve_records; >+ my $count = 0; >+ foreach my $reserve ( @reserves ) { >+ warn $reserve->reserve_id; >+ if ($reserve->hold_group_id) { >+ # Keep track of which hold_group_id (duplicated field) go with each reserve_id (unique field) >+ $reserve_records{ $reserve->hold_group_id }->{ $reserve->reserve_id }++; >+ warn $reserve->reserve_id; >+ @reserveloop = grep { $_->{reserve_id} != $reserve->reserve_id } @reserveloop; >+ }else { >+ warn $reserve->reserve_id; >+ warn $reserve->hold_group_id; >+ } >+ } >+ my @grouped_parts; >+ for my $hold_group ( sort { $a <=> $b } keys %reserve_records ) { >+ my @reserveids = 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 itemnumbers with each hold_group_id >+ push @grouped_parts, { >+ hold_group_id => $hold_group, >+ reserve_id => join(', ', sort { $a <=> $b } @reserveids), >+ 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