use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Const qw/:const/;
use OpenILS::Application::AppUtils;
+use OpenILS::Utils::HoldTargeter;
use DateTime;
my $U = "OpenILS::Application::AppUtils";
next if ($_->{hold_type} eq 'P');
}
# So much for easy stuff, attempt a retarget!
- my $tresult = $U->storagereq('open-ils.storage.action.hold_request.copy_targeter', undef, $_->{id}, $self->copy->id);
+ my $tresult = OpenILS::Utils::HoldTargeter->new->target(
+ hold => $_->{id},
+ find_copy => $self->copy->id
+ );
if(ref $tresult eq "ARRAY" and scalar @$tresult) {
last if(exists $tresult->[0]->{found_copy} and $tresult->[0]->{found_copy});
}
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Utils::CStoreEditor q/:funcs/;
use OpenILS::Utils::PermitHold;
+use OpenILS::Utils::HoldTargeter;
use OpenSRF::Utils::SettingsClient;
use OpenILS::Const qw/:const/;
use OpenILS::Application::Circ::Transit;
$conn->respond_complete($hold->id);
- $U->storagereq(
- 'open-ils.storage.action.hold_request.copy_targeter',
- undef, $hold->id ) unless $U->is_true($hold->frozen);
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold->id)
+ unless $U->is_true($hold->frozen);
return undef;
}
$e->update_action_hold_request($hold) or return $e->die_event;
$e->commit;
- $U->storagereq('open-ils.storage.action.hold_request.copy_targeter', undef, $hold_id);
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold_id)
return 1;
}
if(!$U->is_true($hold->frozen) && $U->is_true($orig_hold->frozen)) {
$logger->info("Running targeter on activated hold ".$hold->id);
- $U->storagereq( 'open-ils.storage.action.hold_request.copy_targeter', undef, $hold->id );
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold->id)
}
# a change to mint-condition changes the set of potential copies, so retarget the hold;
if($U->is_true($hold->mint_condition) and !$U->is_true($orig_hold->mint_condition)) {
_reset_hold($self, $e->requestor, $hold)
} elsif($need_retarget && !defined $hold->capture_time()) { # If needed, retarget the hold due to changes
- $U->storagereq(
- 'open-ils.storage.action.hold_request.copy_targeter', undef, $hold->id );
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold->id)
}
return $hold->id;
} else {
if($U->is_true($orig_hold->frozen)) {
$logger->info("Running targeter on activated hold ".$hold->id);
- $U->storagereq( 'open-ils.storage.action.hold_request.copy_targeter', undef, $hold->id );
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold->id)
}
}
}
$e->update_action_hold_request($hold) or return $e->die_event;
$e->commit;
- $U->storagereq(
- 'open-ils.storage.action.hold_request.copy_targeter', undef, $hold->id );
+ OpenILS::Utils::HoldTargeter->new->target(hold => $hold->id)
return undef;
}