Bugzilla – Attachment 116512 Details for
Bug 4037
Inventory tool missing item type filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4037: Correctly join the itemtypes array
Bug-4037-Correctly-join-the-itemtypes-array.patch (text/plain), 2.86 KB, created by
Jonathan Druart
on 2021-02-08 15:07:20 UTC
(
hide
)
Description:
Bug 4037: Correctly join the itemtypes array
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-02-08 15:07:20 UTC
Size:
2.86 KB
patch
obsolete
>From 2324b0a4aefc93e5eda04bf015dc2a42f61f8126 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 8 Feb 2021 16:07:03 +0100 >Subject: [PATCH] Bug 4037: Correctly join the itemtypes array > >--- > C4/Items.pm | 13 +++++-------- > .../prog/en/modules/tools/inventory.tt | 4 ---- > 2 files changed, 5 insertions(+), 12 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index e5b478316c..48aed7b195 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -489,7 +489,7 @@ lists of authorized values for certain item fields. > offset => $offset, > size => $size, > statushash => $statushash, >- itemtypes => @itemsarray, >+ itemtypes => \@itemsarray, > } ); > > Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. >@@ -522,7 +522,7 @@ sub GetItemsForInventory { > my $size = $parameters->{'size'} // ''; > my $statushash = $parameters->{'statushash'} // ''; > my $ignore_waiting_holds = $parameters->{'ignore_waiting_holds'} // ''; >- my $items = $parameters->{'itemtypes'} // ''; >+ my $itemtypes = $parameters->{'itemtypes'} || []; > > my $dbh = C4::Context->dbh; > my ( @bind_params, @where_strings ); >@@ -592,12 +592,9 @@ sub GetItemsForInventory { > push( @where_strings, q{(reserves.found != 'W' OR reserves.found IS NULL)} ); > } > >- if ( $items and @{$items} > 0 ){ >- my $joinedvals; >- for my $itemtype (@{$items}){ >- $joinedvals = join(',', @{$items}); >- } >- push @where_strings, "( biblioitems.itemtype IN (" . $joinedvals . ") OR items.itype IN (" . $joinedvals . ") )"; >+ if ( @$itemtypes ) { >+ my $itemtypes_str = join ', ', @$itemtypes; >+ push @where_strings, "( biblioitems.itemtype IN (" . $itemtypes_str . ") OR items.itype IN (" . $itemtypes_str . ") )"; > } > > if ( @where_strings ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >index 4faa432eda..d7c2343cb8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -167,10 +167,6 @@ > <input id="itemtype-[% itemtype.itemtype | html %]" class="branch_select" type="checkbox" name="itemtype-[% itemtype.itemtype | html %]" value="[% itemtype.itemtype | html %]" /> > <label for="itemtype-[% itemtype.itemtype | html %]">[% itemtype.description | html %]</label> > </div> >- [% IF loop.count() % 4 == 0 && !loop.last() %] >- </div> >- <div class="branchgridrow"> >- [% END %] > [% END %] > </div> > </div> >-- >2.20.1
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 4037
:
115230
|
115231
|
116414
|
116415
|
116512
|
116513
|
116514
|
116522
|
116523