Lines 22-27
use Modern::Perl;
Link Here
|
22 |
use Carp; |
22 |
use Carp; |
23 |
use List::MoreUtils qw(any); |
23 |
use List::MoreUtils qw(any); |
24 |
use Data::Dumper; |
24 |
use Data::Dumper; |
|
|
25 |
use Try::Tiny; |
25 |
|
26 |
|
26 |
use Koha::Database; |
27 |
use Koha::Database; |
27 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
Lines 38-43
use Koha::IssuingRules;
Link Here
|
38 |
use Koha::Item::Transfer::Limits; |
39 |
use Koha::Item::Transfer::Limits; |
39 |
use Koha::Item::Transfers; |
40 |
use Koha::Item::Transfers; |
40 |
use Koha::Patrons; |
41 |
use Koha::Patrons; |
|
|
42 |
use Koha::Plugins; |
41 |
use Koha::Libraries; |
43 |
use Koha::Libraries; |
42 |
use Koha::StockRotationItem; |
44 |
use Koha::StockRotationItem; |
43 |
use Koha::StockRotationRotas; |
45 |
use Koha::StockRotationRotas; |
Lines 145-151
sub store {
Link Here
|
145 |
|
147 |
|
146 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
148 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
147 |
if $log_action && C4::Context->preference("CataloguingLog"); |
149 |
if $log_action && C4::Context->preference("CataloguingLog"); |
148 |
|
|
|
149 |
} |
150 |
} |
150 |
|
151 |
|
151 |
unless ( $self->dateaccessioned ) { |
152 |
unless ( $self->dateaccessioned ) { |
Lines 648-653
sub to_api_mapping {
Link Here
|
648 |
|
649 |
|
649 |
=head2 Internal methods |
650 |
=head2 Internal methods |
650 |
|
651 |
|
|
|
652 |
=head3 _after_item_action_hooks |
653 |
|
654 |
Helper method that takes care of calling all plugin hooks |
655 |
|
656 |
=cut |
657 |
|
658 |
sub _after_item_action_hooks { |
659 |
my ( $self, $params ) = @_; |
660 |
|
661 |
my $action = $params->{action}; |
662 |
|
663 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
664 |
|
665 |
my @plugins = Koha::Plugins->new->GetPlugins({ |
666 |
method => 'after_item_action', |
667 |
}); |
668 |
|
669 |
if (@plugins) { |
670 |
|
671 |
foreach my $plugin ( @plugins ) { |
672 |
try { |
673 |
$plugin->after_item_action({ action => $action, item => $self, item_id => $self->itemnumber }); |
674 |
} |
675 |
catch { |
676 |
warn "$_"; |
677 |
}; |
678 |
} |
679 |
} |
680 |
} |
681 |
} |
682 |
|
651 |
=head3 _type |
683 |
=head3 _type |
652 |
|
684 |
|
653 |
=cut |
685 |
=cut |
654 |
- |
|
|