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 680-688
if ($op) {
Link Here
|
680 |
# now, build existiing item list |
683 |
# now, build existiing item list |
681 |
|
684 |
|
682 |
my @items; |
685 |
my @items; |
|
|
686 |
my %warning_messages; |
683 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
687 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
684 |
my $i = $item->columns_to_str; |
688 |
my $i = $item->columns_to_str; |
685 |
$i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch ); |
689 |
$i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch ); |
|
|
690 |
my $i_order = GetOrderFromItemnumber( $i->{itemnumber} ); |
691 |
my $i_serialid = Koha::Serial::Items->find( { itemnumber => $i->{itemnumber} }, { prefetch => 'serialid' } ); |
692 |
if ($i_order) { |
693 |
$warning_messages{ $i->{itemnumber} } = |
694 |
sprintf( 'There is an order (ordernumber %s) on this item', $i_order->{ordernumber} ); |
695 |
} |
696 |
if ($i_serialid) { |
697 |
$warning_messages{ $i->{itemnumber} } = 'A subscription is linked to this item'; |
698 |
} |
699 |
$i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch ); |
686 |
push @items, $i; |
700 |
push @items, $i; |
687 |
} |
701 |
} |
688 |
|
702 |
|
Lines 805-812
$template->param(
Link Here
|
805 |
subfields => $subfields, |
819 |
subfields => $subfields, |
806 |
itemnumber => $itemnumber, |
820 |
itemnumber => $itemnumber, |
807 |
barcode => $current_item->{barcode}, |
821 |
barcode => $current_item->{barcode}, |
808 |
op => $nextop, |
822 |
op => $nextop, |
809 |
popup => scalar $input->param('popup') ? 1 : 0, |
823 |
popup => scalar $input->param('popup') ? 1: 0, |
|
|
824 |
warning_messages => \%warning_messages, |
810 |
C4::Search::enabled_staff_search_views, |
825 |
C4::Search::enabled_staff_search_views, |
811 |
); |
826 |
); |
812 |
$template->{'VARS'}->{'searchid'} = $searchid; |
827 |
$template->{'VARS'}->{'searchid'} = $searchid; |