Lines 89-96
sub store {
Link Here
|
89 |
$self->itype($self->biblio->biblioitem->itemtype); |
89 |
$self->itype($self->biblio->biblioitem->itemtype); |
90 |
} |
90 |
} |
91 |
|
91 |
|
92 |
my $today = dt_from_string; |
92 |
my $today = dt_from_string; |
93 |
my $plugin_action = 'create'; |
93 |
my $action = 'create'; |
94 |
|
94 |
|
95 |
unless ( $self->in_storage ) { #AddItem |
95 |
unless ( $self->in_storage ) { #AddItem |
96 |
unless ( $self->permanent_location ) { |
96 |
unless ( $self->permanent_location ) { |
Lines 114-125
sub store {
Link Here
|
114 |
$self->cn_sort($cn_sort); |
114 |
$self->cn_sort($cn_sort); |
115 |
} |
115 |
} |
116 |
|
116 |
|
117 |
logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
|
|
118 |
if $log_action && C4::Context->preference("CataloguingLog"); |
119 |
|
120 |
} else { # ModItem |
117 |
} else { # ModItem |
121 |
|
118 |
|
122 |
$plugin_action = 'modify'; |
119 |
$action = 'modify'; |
123 |
|
120 |
|
124 |
my %updated_columns = $self->_result->get_dirty_columns; |
121 |
my %updated_columns = $self->_result->get_dirty_columns; |
125 |
return $self->SUPER::store unless %updated_columns; |
122 |
return $self->SUPER::store unless %updated_columns; |
Lines 186-193
sub store {
Link Here
|
186 |
$self->_set_found_trigger($pre_mod_item); |
183 |
$self->_set_found_trigger($pre_mod_item); |
187 |
} |
184 |
} |
188 |
|
185 |
|
189 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
|
|
190 |
if $log_action && C4::Context->preference("CataloguingLog"); |
191 |
} |
186 |
} |
192 |
|
187 |
|
193 |
unless ( $self->dateaccessioned ) { |
188 |
unless ( $self->dateaccessioned ) { |
Lines 195-204
sub store {
Link Here
|
195 |
} |
190 |
} |
196 |
|
191 |
|
197 |
my $result = $self->SUPER::store; |
192 |
my $result = $self->SUPER::store; |
|
|
193 |
if ( $log_action && C4::Context->preference("CataloguingLog") ) { |
194 |
$action eq 'create' |
195 |
? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
196 |
: logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper( $self->unblessed ) ); |
197 |
} |
198 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
198 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
199 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
199 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
200 |
unless $params->{skip_record_index}; |
200 |
unless $params->{skip_record_index}; |
201 |
$self->get_from_storage->_after_item_action_hooks({ action => $plugin_action }); |
201 |
$self->get_from_storage->_after_item_action_hooks({ action => $action }); |
202 |
|
202 |
|
203 |
return $result; |
203 |
return $result; |
204 |
} |
204 |
} |