[% UNLESS ( action ) %]
- [% IF ( notfoundbarcodes ) %]
+ [% IF ( notfoundbarcodes.size ) %]
<div class="dialog alert">
- [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
+ [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
</div>
<table style="margin:auto;">
- <thead>
- <tr>
- <th>Barcode</th>
- </tr>
- </thead>
- <tbody>
- [% FOREACH notfoundbarcode IN notfoundbarcodes %]
- <tr><td>[% notfoundbarcode.barcode |html %]</td></tr>
+ <thead>
+ <tr><th>Barcodes not found</th></tr>
+ </thead>
+ <tbody>
+ [% FOREACH notfoundbarcode IN notfoundbarcodes %]
+ <tr><td>[% notfoundbarcode |html %]</td></td>
+ [% END %]
+ </tbody>
+ </table>
+ [% IF ( item_loop ) %]
+ [% UNLESS ( too_many_items ) %]
+ <h4>The following barcodes were found: </h4>
[% END %]
- </tbody>
+ [% END %]
+ [% END %] <!-- /notfoundbarcodes -->
+ [% IF ( notfounditemnumbers.size ) %]
+ <div class="dialog alert">
+ [% IF ( itemresults ) %]<p>Warning, the following itemnumbers were not found:</p>[% ELSE %]<p>Warning: no itemnumbers were found</p>[% END %]
+ </div>
+ <table style="margin:auto;">
+ <thead>
+ <tr><th>Itemnumbers not found</th></tr>
+ </thead>
+ <tbody>
+ [% FOREACH notfounditemnumber IN notfounditemnumbers %]
+ <tr><td>[% notfounditemnumber |html %]</td></td>
+ [% END %]
+ </tbody>
</table>
- [% UNLESS ( too_many_items ) %]
- [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
+ [% IF ( item_loop ) %]
+ [% UNLESS ( too_many_items ) %]
+ <h4>The following itemnumbers were found: </h4>
+ [% END %]
[% END %]
- [% END %]
+ [% END %] <!-- /notfounditemnumbers -->
+
+
<form name="f" action="batchMod.pl" method="post">
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
- [% IF ( notfoundbarcodes ) %]
- <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
- <table style="margin:auto;">
- <thead>
- <tr><th>Barcodes not found</th></tr>
- </thead>
- <tbody>
- [% FOREACH notfoundbarcode IN notfoundbarcodes %]
- <tr><td>[% notfoundbarcode.barcode |html %]</td></td>
+ [% IF ( notfoundbarcodes.size ) %]
+ <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
+ <table style="margin:auto;">
+ <thead>
+ <tr><th>Barcodes not found</th></tr>
+ </thead>
+ <tbody>
+ [% FOREACH notfoundbarcode IN notfoundbarcodes %]
+ <tr><td>[% notfoundbarcode |html %]</td></td>
+ [% END %]
+ </tbody>
+ </table>
+ [% IF ( item_loop ) %]
+ [% UNLESS ( too_many_items ) %]
+ <h4>The following barcodes were found: </h4>
+ [% END %]
[% END %]
- </tbody>
- </table>
- [% IF ( item_loop ) %]
- [% UNLESS ( too_many_items ) %]
- <h4>The following barcodes were found: </h4>
- [% END %]
- [% END %]
- [% END %] <!-- /notfoundbarcodes -->
+ [% END %] <!-- /notfoundbarcodes -->
+ [% IF ( notfounditemnumbers.size ) %]
+ <div class="dialog alert"><p>Warning, the following itemnumbers were not found:</p></div>
+ <table style="margin:auto;">
+ <thead>
+ <tr><th>Itemnumbers not found</th></tr>
+ </thead>
+ <tbody>
+ [% FOREACH notfounditemnumber IN notfounditemnumbers %]
+ <tr><td>[% notfounditemnumber |html %]</td></td>
+ [% END %]
+ </tbody>
+ </table>
+ [% IF ( item_loop ) %]
+ [% UNLESS ( too_many_items ) %]
+ <h4>The following itemnumbers were found: </h4>
+ [% END %]
+ [% END %]
+ [% END %] <!-- /notfounditemnumbers -->
+
+
<form name="f" action="batchMod.pl" method="post">
<input type="hidden" name="op" value="[% op %]" />
if ($op eq "show"){
my $filefh = $input->upload('uploadfile');
my $filecontent = $input->param('filecontent');
- my @notfoundbarcodes;
+ my ( @notfoundbarcodes, @notfounditemnumbers);
my @contentlist;
if ($filefh){
}
}
elsif ( $filecontent eq 'itemid_file') {
- @itemnumbers = @contentlist;
+ @itemnumbers = Koha::Items->search({ itemnumber => \@contentlist })->get_column('itemnumber');
+ my %exists = map {$_=>1} @itemnumbers;
+ @notfounditemnumbers = grep { !$exists{$_} } @contentlist;
}
} else {
if (defined $biblionumber){
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
- $template->param(item => \@loop_data);
- if (@notfoundbarcodes) {
- my @notfoundbarcodesloop = map{{barcode=>$_}}@notfoundbarcodes;
- $template->param(notfoundbarcodes => \@notfoundbarcodesloop);
- }
+ $template->param(
+ item => \@loop_data,
+ notfoundbarcodes => \@notfoundbarcodes,
+ notfounditemnumbers => \@notfounditemnumbers
+ );
$nextop="action"
} # -- End action="show"