Bugzilla – Attachment 176237 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.50 KB, created by
Martin Renvoize (ashimema)
on 2025-01-08 14:23:29 UTC
(
hide
)
Description:
Bug 29099: Add bundle support to inventory tool
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-01-08 14:23:29 UTC
Size:
5.50 KB
patch
obsolete
>From f1f8e7554caf0fdcb52cb2b4f2bc37bdbda95eaa 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 920b6c77f3d..71a60772197 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -572,6 +572,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'} // ''; >@@ -625,6 +626,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) { > push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)'; > push @bind_params, $datelastseen; >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 fb4eef59df7..6a9cfe79b30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -174,6 +174,17 @@ > </select> > </li> > </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> > >@@ -416,7 +427,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" + >@@ -557,6 +569,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 1c941835964..301d0399377 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -49,6 +49,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'); >@@ -69,6 +70,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 = ''; > >@@ -140,6 +147,7 @@ foreach my $itemtype ( @itemtypes ) { > > $template->param( > authorised_values => \@authorised_value_list, >+ items_bundles => \@items_bundles, > today => dt_from_string, > minlocation => $minlocation, > maxlocation => $maxlocation, >@@ -257,6 +265,7 @@ if ( $op eq 'cud-inventory' && ( !$uploadbarcodes || $compareinv2barcd )) { > minlocation => $minlocation, > maxlocation => $maxlocation, > class_source => $class_source, >+ items_bundle => $items_bundle, > location => $location, > ignoreissued => $ignoreissued, > datelastseen => $datelastseen, >@@ -277,6 +286,7 @@ if( @scanned_items ) { > maxlocation => $maxlocation, > class_source => $class_source, > location => $location, >+ items_bundle => $items_bundle, > ignoreissued => undef, > datelastseen => undef, > branchcode => $branchcode, >-- >2.47.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