Lines 32-37
use C4::Context;
Link Here
|
32 |
use C4::Members; |
32 |
use C4::Members; |
33 |
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); |
33 |
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); |
34 |
use C4::Search qw( enabled_staff_search_views ); |
34 |
use C4::Search qw( enabled_staff_search_views ); |
|
|
35 |
use C4::Acquisition qw( GetOrderFromItemnumber ); |
35 |
use Koha::Biblios; |
36 |
use Koha::Biblios; |
36 |
use Koha::Item::Templates; |
37 |
use Koha::Item::Templates; |
37 |
use Koha::ItemTypes; |
38 |
use Koha::ItemTypes; |
Lines 42-47
use Koha::Patrons;
Link Here
|
42 |
use Koha::SearchEngine::Indexer; |
43 |
use Koha::SearchEngine::Indexer; |
43 |
use Koha::UI::Form::Builder::Item; |
44 |
use Koha::UI::Form::Builder::Item; |
44 |
use Koha::Result::Boolean; |
45 |
use Koha::Result::Boolean; |
|
|
46 |
use Koha::Serial::Items; |
47 |
use Koha::Subscriptions; |
45 |
|
48 |
|
46 |
use Encode qw( encode_utf8 ); |
49 |
use Encode qw( encode_utf8 ); |
47 |
use List::MoreUtils qw( any uniq ); |
50 |
use List::MoreUtils qw( any uniq ); |
Lines 633-640
if ($op) {
Link Here
|
633 |
# now, build existiing item list |
636 |
# now, build existiing item list |
634 |
|
637 |
|
635 |
my @items; |
638 |
my @items; |
|
|
639 |
my %warning_messages; |
636 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
640 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
637 |
my $i = $item->columns_to_str; |
641 |
my $i = $item->columns_to_str; |
|
|
642 |
my $i_order = GetOrderFromItemnumber($i->{itemnumber}); |
643 |
my $i_serialid = Koha::Serial::Items->search( {itemnumber => $i->{itemnumber}} )->get_column('serialid'); |
644 |
|
645 |
if ($i_order) { |
646 |
$warning_messages{$i->{itemnumber}} = sprintf('There is an order (ordernumber %s) on this item', $i_order->{ordernumber} ); |
647 |
} |
648 |
if ($i_serialid) { |
649 |
$warning_messages{$i->{itemnumber}} = 'A subscription is linked to this item'; |
650 |
} |
651 |
|
638 |
$i->{nomod} = 1 unless $patron->can_edit_item($item); |
652 |
$i->{nomod} = 1 unless $patron->can_edit_item($item); |
639 |
push @items, $i; |
653 |
push @items, $i; |
640 |
} |
654 |
} |
Lines 754-759
$template->param(
Link Here
|
754 |
barcode => $current_item->{barcode}, |
768 |
barcode => $current_item->{barcode}, |
755 |
op => $nextop, |
769 |
op => $nextop, |
756 |
popup => scalar $input->param('popup') ? 1: 0, |
770 |
popup => scalar $input->param('popup') ? 1: 0, |
|
|
771 |
warning_messages => \%warning_messages, |
757 |
C4::Search::enabled_staff_search_views, |
772 |
C4::Search::enabled_staff_search_views, |
758 |
); |
773 |
); |
759 |
$template->{'VARS'}->{'searchid'} = $searchid; |
774 |
$template->{'VARS'}->{'searchid'} = $searchid; |