|
Lines 227-232
Allows to modify existing subfield's values using a regular expression
Link Here
|
| 227 |
|
227 |
|
| 228 |
Set the passed boolean value to items.exclude_from_local_holds_priority |
228 |
Set the passed boolean value to items.exclude_from_local_holds_priority |
| 229 |
|
229 |
|
|
|
230 |
=item mark_items_returned |
| 231 |
|
| 232 |
Move issues on these items to the old issues table, do not mark items found or adjust statuses or fines |
| 233 |
|
| 230 |
=item callback |
234 |
=item callback |
| 231 |
|
235 |
|
| 232 |
Callback function to call after an item has been modified |
236 |
Callback function to call after an item has been modified |
|
Lines 241-246
sub batch_update {
Link Here
|
| 241 |
my $regex_mod = $params->{regex_mod} || {}; |
245 |
my $regex_mod = $params->{regex_mod} || {}; |
| 242 |
my $new_values = $params->{new_values} || {}; |
246 |
my $new_values = $params->{new_values} || {}; |
| 243 |
my $exclude_from_local_holds_priority = $params->{exclude_from_local_holds_priority}; |
247 |
my $exclude_from_local_holds_priority = $params->{exclude_from_local_holds_priority}; |
|
|
248 |
my $mark_items_returned = $params->{mark_items_returned}; |
| 244 |
my $callback = $params->{callback}; |
249 |
my $callback = $params->{callback}; |
| 245 |
|
250 |
|
| 246 |
my (@modified_itemnumbers, $modified_fields); |
251 |
my (@modified_itemnumbers, $modified_fields); |
|
Lines 250-255
sub batch_update {
Link Here
|
| 250 |
|
255 |
|
| 251 |
try {$schema->txn_do(sub { |
256 |
try {$schema->txn_do(sub { |
| 252 |
my $modified_holds_priority = 0; |
257 |
my $modified_holds_priority = 0; |
|
|
258 |
my $item_returned = 0; |
| 253 |
if ( defined $exclude_from_local_holds_priority ) { |
259 |
if ( defined $exclude_from_local_holds_priority ) { |
| 254 |
if(!defined $item->exclude_from_local_holds_priority || $item->exclude_from_local_holds_priority != $exclude_from_local_holds_priority) { |
260 |
if(!defined $item->exclude_from_local_holds_priority || $item->exclude_from_local_holds_priority != $exclude_from_local_holds_priority) { |
| 255 |
$item->exclude_from_local_holds_priority($exclude_from_local_holds_priority)->store; |
261 |
$item->exclude_from_local_holds_priority($exclude_from_local_holds_priority)->store; |
|
Lines 336-344
sub batch_update {
Link Here
|
| 336 |
) if $item->itemlost |
342 |
) if $item->itemlost |
| 337 |
and not $itemlost_pre; |
343 |
and not $itemlost_pre; |
| 338 |
} |
344 |
} |
|
|
345 |
if ( $mark_items_returned ){ |
| 346 |
my $issue = $item->checkout; |
| 347 |
if( $issue ){ |
| 348 |
$item_returned = 1; |
| 349 |
C4::Circulation::MarkIssueReturned( |
| 350 |
$issue->borrowernumber, |
| 351 |
$item->itemnumber, |
| 352 |
undef, |
| 353 |
$issue->patron->privacy, |
| 354 |
{ |
| 355 |
skip_record_index => 1, |
| 356 |
skip_holds_queue => 1, |
| 357 |
} |
| 358 |
); |
| 359 |
} |
| 360 |
} |
| 339 |
|
361 |
|
| 340 |
push @modified_itemnumbers, $item->itemnumber if $modified || $modified_holds_priority; |
362 |
push @modified_itemnumbers, $item->itemnumber if $modified || $modified_holds_priority || $item_returned; |
| 341 |
$modified_fields += $modified + $modified_holds_priority; |
363 |
$modified_fields += $modified + $modified_holds_priority + $item_returned; |
| 342 |
})} |
364 |
})} |
| 343 |
catch { |
365 |
catch { |
| 344 |
warn $_ |
366 |
warn $_ |