|
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 642-650
if ($op) {
Link Here
|
| 642 |
# now, build existiing item list |
645 |
# now, build existiing item list |
| 643 |
|
646 |
|
| 644 |
my @items; |
647 |
my @items; |
|
|
648 |
my %warning_messages; |
| 645 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
649 |
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { |
| 646 |
my $i = $item->columns_to_str; |
650 |
my $i = $item->columns_to_str; |
| 647 |
$i->{nomod} = 1 unless $patron->can_edit_items_from($item->homebranch); |
651 |
$i->{nomod} = 1 unless $patron->can_edit_items_from($item->homebranch); |
|
|
652 |
my $i_order = GetOrderFromItemnumber($i->{itemnumber}); |
| 653 |
my $i_serialid = Koha::Serial::Items->search( {itemnumber => $i->{itemnumber}} )->get_column('serialid'); |
| 654 |
|
| 655 |
if ($i_order) { |
| 656 |
$warning_messages{$i->{itemnumber}} = sprintf('There is an order (ordernumber %s) on this item', $i_order->{ordernumber} ); |
| 657 |
} |
| 658 |
if ($i_serialid) { |
| 659 |
$warning_messages{$i->{itemnumber}} = 'A subscription is linked to this item'; |
| 660 |
} |
| 661 |
|
| 662 |
$i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch ); |
| 648 |
push @items, $i; |
663 |
push @items, $i; |
| 649 |
} |
664 |
} |
| 650 |
|
665 |
|
|
Lines 763-768
$template->param(
Link Here
|
| 763 |
barcode => $current_item->{barcode}, |
778 |
barcode => $current_item->{barcode}, |
| 764 |
op => $nextop, |
779 |
op => $nextop, |
| 765 |
popup => scalar $input->param('popup') ? 1: 0, |
780 |
popup => scalar $input->param('popup') ? 1: 0, |
|
|
781 |
warning_messages => \%warning_messages, |
| 766 |
C4::Search::enabled_staff_search_views, |
782 |
C4::Search::enabled_staff_search_views, |
| 767 |
); |
783 |
); |
| 768 |
$template->{'VARS'}->{'searchid'} = $searchid; |
784 |
$template->{'VARS'}->{'searchid'} = $searchid; |