@@ -, +, @@ location to view_holdsqueue.pl "### items found for All libraries and item type:(Books)" --- C4/HoldsQueue.pm | 23 ++++++++++++---- circ/view_holdsqueue.pl | 13 ++++++++-- .../prog/en/includes/html_helpers.inc | 10 +++++++ .../prog/en/modules/circ/view_holdsqueue.tt | 26 ++++++++++++++++++- 4 files changed, 64 insertions(+), 8 deletions(-) --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -122,14 +122,14 @@ sub UpdateTransportCostMatrix { =head2 GetHoldsQueueItems - GetHoldsQueueItems($branch); + GetHoldsQueueItems({ branchlimit => $branch, itemtypeslimit => $itype, ccodeslimit => $ccode, locationslimit => $location ); Returns hold queue for a holding branch. If branch is omitted, then whole queue is returned =cut sub GetHoldsQueueItems { - my ($branchlimit) = @_; + my $params = shift; my $dbh = C4::Context->dbh; my @bind_params = (); @@ -143,10 +143,23 @@ sub GetHoldsQueueItems { JOIN biblio USING (biblionumber) LEFT JOIN biblioitems USING (biblionumber) LEFT JOIN items USING ( itemnumber) + WHERE 1=1 /; - if ($branchlimit) { - $query .=" WHERE tmp_holdsqueue.holdingbranch = ?"; - push @bind_params, $branchlimit; + if ($params->{branchlimit}) { + $query .="AND tmp_holdsqueue.holdingbranch = ? "; + push @bind_params, $params->{branchlimit}; + } + if( $params->{itemtypeslimit} ) { + $query .=" AND items.itype = ? "; + push @bind_params, $params->{itemtypeslimit}; + } + if( $params->{ccodeslimit} ) { + $query .=" AND items.ccode = ? "; + push @bind_params, $params->{ccodeslimit}; + } + if( $params->{locationslimit} ) { + $query .=" AND items.location = ? "; + push @bind_params, $params->{locationslimit}; } $query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate"; my $sth = $dbh->prepare($query); --- a/circ/view_holdsqueue.pl +++ a/circ/view_holdsqueue.pl @@ -44,15 +44,24 @@ my $params = $query->Vars; my $run_report = $params->{'run_report'}; my $branchlimit = $params->{'branchlimit'}; my $itemtypeslimit = $params->{'itemtypeslimit'}; +my $ccodeslimit = $params->{'ccodeslimit'}; +my $locationslimit = $params->{'locationslimit'}; if ( $run_report ) { - # XXX GetHoldsQueueItems() does not support $itemtypeslimit! - my $items = GetHoldsQueueItems($branchlimit, $itemtypeslimit); + my $items = GetHoldsQueueItems({ + branchlimt => $branchlimit, + itemtypeslimit => $itemtypeslimit, + ccodeslimit => $ccodeslimit, + locationslimit => $locationslimit + }); for my $item ( @$items ) { $item->{patron} = Koha::Patrons->find( $item->{borrowernumber} ); } $template->param( branchlimit => $branchlimit, + itemtypeslimit => $itemtypeslimit, + ccodeslimit => $ccodeslimit, + locationslimit => $locationslimit, total => scalar @$items, itemsloop => $items, run_report => $run_report, --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -47,6 +47,16 @@ [% END %] [% END %] +[% BLOCK options_for_authorised_values %] + [% FOREACH av IN authorised_values %] + [% IF av.authorised_value == selected_av %] + + [% ELSE %] + + [% END %] + [% END %] +[% END %] + [% BLOCK options_for_item_types %] [% FOREACH itemtype IN itemtypes %] [% IF itemtype.itemtype == selected_itemtype %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -65,6 +65,9 @@ [% IF ( total ) %]
[% total | html %] items found for [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]All libraries[% END %] + [% IF ( itemtypeslimit ) %] and item type:([% ItemTypes.GetDescription( itemtypeslimit ) | html %])[% END %] + [% IF ( ccodeslimit ) %] and collection code:([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode' authorised_value = ccodeslimit ) | html %])[% END %] + [% IF ( locationslimit ) %] and shelving location:([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location' authorised_value = locationslimit ) | html %])[% END %]
[% ELSE %]
No items found.
@@ -200,7 +203,7 @@ [% END %] [% UNLESS ( total ) %] -
+
  1. @@ -210,6 +213,27 @@ [% PROCESS options_for_libraries libraries => Branches.all( only_from_group => 1 ) %]
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
  7. + + +
--