@@ -, +, @@ --- 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(-) --- a/Koha/UI/Table/Builder/Items.pm +++ a/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, --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -243,6 +243,7 @@ + [% IF checkboxes_edit OR checkboxes_delete %] [% END %] @@ -264,6 +265,7 @@ [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %] + [% IF checkboxes_edit %] [% UNLESS can_be_edited%] @@ -333,7 +335,6 @@ [% END %] [% END %] - [% END # /FOREACH items %] --- a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js +++ a/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, --
[% item.index + 1 | html %]Cannot edit[% item.$attribute | html %]