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 36-41
use Koha::IssuingRules;
Link Here
|
36 |
use Koha::Item::Transfer::Limits; |
37 |
use Koha::Item::Transfer::Limits; |
37 |
use Koha::Item::Transfers; |
38 |
use Koha::Item::Transfers; |
38 |
use Koha::Patrons; |
39 |
use Koha::Patrons; |
|
|
40 |
use Koha::Plugins; |
39 |
use Koha::Libraries; |
41 |
use Koha::Libraries; |
40 |
use Koha::StockRotationItem; |
42 |
use Koha::StockRotationItem; |
41 |
use Koha::StockRotationRotas; |
43 |
use Koha::StockRotationRotas; |
Lines 143-149
sub store {
Link Here
|
143 |
|
145 |
|
144 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
146 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
145 |
if $log_action && C4::Context->preference("CataloguingLog"); |
147 |
if $log_action && C4::Context->preference("CataloguingLog"); |
146 |
|
|
|
147 |
} |
148 |
} |
148 |
|
149 |
|
149 |
unless ( $self->dateaccessioned ) { |
150 |
unless ( $self->dateaccessioned ) { |
Lines 592-597
sub to_api_mapping {
Link Here
|
592 |
|
593 |
|
593 |
=head2 Internal methods |
594 |
=head2 Internal methods |
594 |
|
595 |
|
|
|
596 |
=head3 _after_item_action_hooks |
597 |
|
598 |
Helper method that takes care of calling all plugin hooks |
599 |
|
600 |
=cut |
601 |
|
602 |
sub _after_item_action_hooks { |
603 |
my ( $self, $params ) = @_; |
604 |
|
605 |
my $action = $params->{action}; |
606 |
|
607 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
608 |
|
609 |
my @plugins = Koha::Plugins->new->GetPlugins({ |
610 |
method => 'after_item_action', |
611 |
}); |
612 |
|
613 |
if (@plugins) { |
614 |
|
615 |
foreach my $plugin ( @plugins ) { |
616 |
try { |
617 |
$plugin->after_item_action({ action => $action, item => $self, item_id => $self->itemnumber }); |
618 |
} |
619 |
catch { |
620 |
warn "$_"; |
621 |
}; |
622 |
} |
623 |
} |
624 |
} |
625 |
} |
626 |
|
595 |
=head3 _type |
627 |
=head3 _type |
596 |
|
628 |
|
597 |
=cut |
629 |
=cut |
598 |
- |
|
|