Bugzilla – Attachment 140061 Details for
Bug 31455
Batch modification tool orders found items by itemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31455: Make batchMod sort by order scanned
Bug-31455-Make-batchMod-sort-by-order-scanned.patch (text/plain), 3.95 KB, created by
Joonas Kylmälä
on 2022-09-01 19:47:08 UTC
(
hide
)
Description:
Bug 31455: Make batchMod sort by order scanned
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-09-01 19:47:08 UTC
Size:
3.95 KB
patch
obsolete
>From c53364b5fafaf1577b110230643d4fb8bfb1db61 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 1 Sep 2022 16:55:14 +0000 >Subject: [PATCH] Bug 31455: Make batchMod sort by order scanned >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To test: >1. In batch item deletion and batch item modification add some > barcodes. >2. Notice they are being sorted by item number, not in the order > scanned. >3. Appply patch and restart services. >4. Try scanning items again in both batch item deletion and batch item > modification. >5. The found barcodes should now sort by order scanned. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > Koha/UI/Table/Builder/Items.pm | 5 ++++- > koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc | 3 ++- > koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js | 3 ++- > 3 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/Koha/UI/Table/Builder/Items.pm b/Koha/UI/Table/Builder/Items.pm >index b573f2a3b3..34b3cfcffd 100644 >--- a/Koha/UI/Table/Builder/Items.pm >+++ b/Koha/UI/Table/Builder/Items.pm >@@ -19,6 +19,7 @@ use Modern::Perl; > use List::MoreUtils qw( uniq ); > use C4::Biblio qw( GetMarcStructure GetMarcFromKohaField IsMarcStructureInternal ); > use Koha::Items; >+use List::MoreUtils qw(first_index); > > =head1 NAME > >@@ -71,14 +72,16 @@ Use it with: > > sub build_table { > my ( $self, $params ) = @_; >- >+ my @itemnumbers = @{ $self->{itemnumbers} }; > my $items = Koha::Items->search( { itemnumber => $self->{itemnumbers} } ); > > my @items; > while ( my $item = $items->next ) { > my $item_info = $item->columns_to_str; >+ my $index = first_index { $_ eq $item->itemnumber } @itemnumbers; > $item_info = { > %$item_info, >+ index => $index, > biblio => $item->biblio, > safe_to_delete => $item->safe_to_delete, > holds => $item->biblio->holds->count, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 6ec8a50c8f..237500bf7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -243,6 +243,7 @@ > <table id="itemst"> > <thead> > <tr> >+ <th></th> > [% IF checkboxes_edit OR checkboxes_delete %] > <th></th> > [% END %] >@@ -264,6 +265,7 @@ > [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %] > > <tr> >+ <td>[% item.index + 1 | html %]</td> > [% IF checkboxes_edit %] > [% UNLESS can_be_edited%] > <td class="error">Cannot edit</td> >@@ -333,7 +335,6 @@ > <td>[% item.$attribute | html %]</td> > [% END %] > [% END %] >- > </tr> > [% END # /FOREACH items %] > </tbody> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >index 987bd3537b..4d178d29d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js >@@ -121,7 +121,8 @@ $(document).ready(function () { > $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ >- { "aTargets": [0], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [0, 1], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [0], "bVisible": false }, > { "sType": "anti-the", "aTargets": ["anti-the"] } > ], > "bPaginate": false, >-- >2.30.2
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 31455
:
140052
|
140059
| 140061 |
140062