|
Lines 87-93
sub store {
Link Here
|
| 87 |
$self->itype($self->biblio->biblioitem->itemtype); |
87 |
$self->itype($self->biblio->biblioitem->itemtype); |
| 88 |
} |
88 |
} |
| 89 |
|
89 |
|
| 90 |
my $today = dt_from_string; |
90 |
my $today = dt_from_string; |
|
|
91 |
my $action = 'create'; |
| 92 |
|
| 91 |
unless ( $self->in_storage ) { #AddItem |
93 |
unless ( $self->in_storage ) { #AddItem |
| 92 |
unless ( $self->permanent_location ) { |
94 |
unless ( $self->permanent_location ) { |
| 93 |
$self->permanent_location($self->location); |
95 |
$self->permanent_location($self->location); |
|
Lines 110-122
sub store {
Link Here
|
| 110 |
$self->cn_sort($cn_sort); |
112 |
$self->cn_sort($cn_sort); |
| 111 |
} |
113 |
} |
| 112 |
|
114 |
|
| 113 |
logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
|
|
| 114 |
if $log_action && C4::Context->preference("CataloguingLog"); |
| 115 |
|
| 116 |
$self->_after_item_action_hooks({ action => 'create' }); |
| 117 |
|
| 118 |
} else { # ModItem |
115 |
} else { # ModItem |
| 119 |
|
116 |
|
|
|
117 |
$action = 'modify'; |
| 118 |
|
| 120 |
{ # Update *_on fields if needed |
119 |
{ # Update *_on fields if needed |
| 121 |
# Why not for AddItem as well? |
120 |
# Why not for AddItem as well? |
| 122 |
my @fields = qw( itemlost withdrawn damaged ); |
121 |
my @fields = qw( itemlost withdrawn damaged ); |
|
Lines 167-174
sub store {
Link Here
|
| 167 |
|
166 |
|
| 168 |
$self->_after_item_action_hooks({ action => 'modify' }); |
167 |
$self->_after_item_action_hooks({ action => 'modify' }); |
| 169 |
|
168 |
|
| 170 |
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) ) |
|
|
| 171 |
if $log_action && C4::Context->preference("CataloguingLog"); |
| 172 |
} |
169 |
} |
| 173 |
|
170 |
|
| 174 |
unless ( $self->dateaccessioned ) { |
171 |
unless ( $self->dateaccessioned ) { |
|
Lines 176-181
sub store {
Link Here
|
| 176 |
} |
173 |
} |
| 177 |
|
174 |
|
| 178 |
my $result = $self->SUPER::store; |
175 |
my $result = $self->SUPER::store; |
|
|
176 |
if ( $log_action && C4::Context->preference("CataloguingLog") ) { |
| 177 |
$action eq 'create' |
| 178 |
? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
| 179 |
: logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper( $self->unblessed ) ); |
| 180 |
} |
| 179 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
181 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
| 180 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
182 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
| 181 |
unless $params->{skip_record_index}; |
183 |
unless $params->{skip_record_index}; |