Lines 61-67
Koha::Item - Koha Item object class
Link Here
|
61 |
=cut |
61 |
=cut |
62 |
|
62 |
|
63 |
sub store { |
63 |
sub store { |
64 |
my ($self, $params) = @_; |
64 |
my $self = shift; |
|
|
65 |
my $params = @_ ? shift : {}; |
65 |
|
66 |
|
66 |
my $log_action = $params->{log_action} // 1; |
67 |
my $log_action = $params->{log_action} // 1; |
67 |
|
68 |
|
Lines 99-105
sub store {
Link Here
|
99 |
$self->cn_sort($cn_sort); |
100 |
$self->cn_sort($cn_sort); |
100 |
} |
101 |
} |
101 |
|
102 |
|
102 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ); |
103 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ) |
|
|
104 |
unless $params->{skip_modzebra_update}; |
103 |
|
105 |
|
104 |
logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
106 |
logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) |
105 |
if $log_action && C4::Context->preference("CataloguingLog"); |
107 |
if $log_action && C4::Context->preference("CataloguingLog"); |
Lines 156-162
sub store {
Link Here
|
156 |
$self->permanent_location( $self->location ); |
158 |
$self->permanent_location( $self->location ); |
157 |
} |
159 |
} |
158 |
|
160 |
|
159 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ); |
161 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ) |
|
|
162 |
unless $params->{skip_modzebra_update}; |
160 |
|
163 |
|
161 |
$self->_after_item_action_hooks({ action => 'modify' }); |
164 |
$self->_after_item_action_hooks({ action => 'modify' }); |
162 |
|
165 |
|
Lines 176-187
sub store {
Link Here
|
176 |
=cut |
179 |
=cut |
177 |
|
180 |
|
178 |
sub delete { |
181 |
sub delete { |
179 |
my ( $self ) = @_; |
182 |
my $self = shift; |
|
|
183 |
my $params = @_ ? shift : {}; |
180 |
|
184 |
|
181 |
# FIXME check the item has no current issues |
185 |
# FIXME check the item has no current issues |
182 |
# i.e. raise the appropriate exception |
186 |
# i.e. raise the appropriate exception |
183 |
|
187 |
|
184 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ); |
188 |
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" ) |
|
|
189 |
unless $params->{skip_modzebra_update}; |
185 |
|
190 |
|
186 |
$self->_after_item_action_hooks({ action => 'delete' }); |
191 |
$self->_after_item_action_hooks({ action => 'delete' }); |
187 |
|
192 |
|
Lines 196-209
sub delete {
Link Here
|
196 |
=cut |
201 |
=cut |
197 |
|
202 |
|
198 |
sub safe_delete { |
203 |
sub safe_delete { |
199 |
my ($self) = @_; |
204 |
my $self = shift; |
|
|
205 |
my $params = @_ ? shift : {}; |
200 |
|
206 |
|
201 |
my $safe_to_delete = $self->safe_to_delete; |
207 |
my $safe_to_delete = $self->safe_to_delete; |
202 |
return $safe_to_delete unless $safe_to_delete eq '1'; |
208 |
return $safe_to_delete unless $safe_to_delete eq '1'; |
203 |
|
209 |
|
204 |
$self->move_to_deleted; |
210 |
$self->move_to_deleted; |
205 |
|
211 |
|
206 |
return $self->delete; |
212 |
return $self->delete($params); |
207 |
} |
213 |
} |
208 |
|
214 |
|
209 |
=head3 safe_to_delete |
215 |
=head3 safe_to_delete |