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::CirculationRules;
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 655-660
sub to_api_mapping {
Link Here
|
655 |
|
656 |
|
656 |
=head2 Internal methods |
657 |
=head2 Internal methods |
657 |
|
658 |
|
|
|
659 |
=head3 _after_item_action_hooks |
660 |
|
661 |
Helper method that takes care of calling all plugin hooks |
662 |
|
663 |
=cut |
664 |
|
665 |
sub _after_item_action_hooks { |
666 |
my ( $self, $params ) = @_; |
667 |
|
668 |
my $action = $params->{action}; |
669 |
|
670 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
671 |
|
672 |
my @plugins = Koha::Plugins->new->GetPlugins({ |
673 |
method => 'after_item_action', |
674 |
}); |
675 |
|
676 |
if (@plugins) { |
677 |
|
678 |
foreach my $plugin ( @plugins ) { |
679 |
try { |
680 |
$plugin->after_item_action({ action => $action, item => $self, item_id => $self->itemnumber }); |
681 |
} |
682 |
catch { |
683 |
warn "$_"; |
684 |
}; |
685 |
} |
686 |
} |
687 |
} |
688 |
} |
689 |
|
658 |
=head3 _type |
690 |
=head3 _type |
659 |
|
691 |
|
660 |
=cut |
692 |
=cut |
661 |
- |
|
|