Bugzilla – Attachment 125207 Details for
Bug 29099
Add support for item bundles in the inventory tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29099: Add bundle support to inventory tool
Bug-29099-Add-bundle-support-to-inventory-tool.patch (text/plain), 5.23 KB, created by
Martin Renvoize (ashimema)
on 2021-09-23 14:51:46 UTC
(
hide
)
Description:
Bug 29099: Add bundle support to inventory tool
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-23 14:51:46 UTC
Size:
5.23 KB
patch
obsolete
>From b4eacb3407ee1e52bccf4443420d76c26c7fafdf Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 23 Sep 2021 15:51:06 +0100 >Subject: [PATCH] Bug 29099: Add bundle support to inventory tool > >--- > C4/Items.pm | 6 ++++++ > .../prog/en/modules/tools/inventory.tt | 20 ++++++++++++++++++- > tools/inventory.pl | 10 ++++++++++ > 3 files changed, 35 insertions(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 7f83736ace6..fe5daee262d 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -525,6 +525,7 @@ sub GetItemsForInventory { > my $minlocation = $parameters->{'minlocation'} // ''; > my $maxlocation = $parameters->{'maxlocation'} // ''; > my $class_source = $parameters->{'class_source'} // C4::Context->preference('DefaultClassificationSource'); >+ my $items_bundle = $parameters->{'items_bundle'} // ''; > my $location = $parameters->{'location'} // ''; > my $itemtype = $parameters->{'itemtype'} // ''; > my $ignoreissued = $parameters->{'ignoreissued'} // ''; >@@ -571,6 +572,11 @@ sub GetItemsForInventory { > push @bind_params, $max_cnsort; > } > >+ if ($items_bundle) { >+ push @where_strings, 'items.itemnumber IN (SELECT itemnumber FROM items_bundle_item WHERE items_bundle_id = ?)'; >+ push @bind_params, $items_bundle; >+ } >+ > if ($datelastseen) { > $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 }); > push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)'; >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 8edc3739b4d..2a929d76c58 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -133,6 +133,17 @@ > [% END %] > </select> > </li> >+ [% IF items_bundles.size > 0 %] >+ <li> >+ <label for="items_bundle">Items bundle:</label> >+ <select id="items_bundle" name="items_bundle"> >+ <option value=""></option> >+ [% FOREACH items_bundle IN items_bundles %] >+ <option value="[% items_bundle.items_bundle_id | html %]">[% items_bundle.biblionumber.title | html %]</option> >+ [% END %] >+ </select> >+ </li> >+ [% END %] > </ol> > </fieldset> > >@@ -348,7 +359,8 @@ > $('#locationloop').val() || > $('#minlocation').val() || > $('#maxlocation').val() || >- $('#statuses input:checked').length >+ $('#statuses input:checked').length || >+ $('#items_bundle').val() > ) ) { > return confirm( > _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" + >@@ -488,6 +500,12 @@ > }); > }); > </script> >+ [% INCLUDE 'select2.inc' %] >+ <script> >+ $(document).ready(function () { >+ $('#items_bundle').select2(); >+ }); >+ </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 5eac6e4e743..b10c2ddaccf 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -47,6 +47,7 @@ my $minlocation=$input->param('minlocation') || ''; > my $maxlocation=$input->param('maxlocation'); > my $class_source=$input->param('class_source'); > $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); >+my $items_bundle = $input->param('items_bundle'); > my $location=$input->param('location') || ''; > my $ignoreissued=$input->param('ignoreissued'); > my $ignore_waiting_holds = $input->param('ignore_waiting_holds'); >@@ -66,6 +67,12 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >+my $schema = Koha::Database->new()->schema(); >+my $items_bundle_rs = $schema->resultset('ItemsBundle'); >+my @items_bundles = $items_bundle_rs->search(undef, { >+ order_by => { -asc => ['biblionumber.title'] }, >+ join => ['biblionumber'], >+}); > my @authorised_value_list; > my $authorisedvalue_categories = ''; > >@@ -134,6 +141,7 @@ foreach my $itemtype ( @itemtypes ) { > > $template->param( > authorised_values => \@authorised_value_list, >+ items_bundles => \@items_bundles, > today => dt_from_string, > minlocation => $minlocation, > maxlocation => $maxlocation, >@@ -249,6 +257,7 @@ if ( $op && ( !$uploadbarcodes || $compareinv2barcd )) { > minlocation => $minlocation, > maxlocation => $maxlocation, > class_source => $class_source, >+ items_bundle => $items_bundle, > location => $location, > ignoreissued => $ignoreissued, > datelastseen => $datelastseen, >@@ -267,6 +276,7 @@ if( @scanned_items ) { > maxlocation => $maxlocation, > class_source => $class_source, > location => $location, >+ items_bundle => $items_bundle, > ignoreissued => undef, > datelastseen => undef, > branchcode => $branchcode, >-- >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 29099
:
125207
|
140898
|
146009
|
148550
|
148555
|
148556
|
176237
|
176238
|
176239