copy
copy_id
copy_barcode
+ new_copy_alerts
user_copy_alerts
system_copy_alerts
next_copy_status
if($self->copy) {
my $alerts = $e->search_asset_copy_alert([
- {copy => $self->copy->id, ack_time => undef}
- {flesh => 1, flesh_fields => { ccat => [ qw/ alert_type / ] }}
+ {copy => $self->copy->id, ack_time => undef},
+ {flesh => 1, flesh_fields => { aca => [ qw/ alert_type / ] }}
]);
if (ref $alerts eq "ARRAY") {
- $logger->info("circulator: found " . scalar(@$alerts) . " alerts for copy" .
+ $logger->info("circulator: found " . scalar(@$alerts) . " alerts for copy " .
$self->copy->id);
$self->user_copy_alerts($alerts);
}
sub filter_user_copy_alerts {
my $self = shift;
+ my $e = $self->editor;
+
if(my $alerts = $self->user_copy_alerts) {
my $suppress_orgs = $U->get_org_descendants($self->circ_lib);
# filter on "only at circ lib"
if (defined $a->alert_type->at_circ) {
- my $copy_circ_lib = (ref $self->copy->circ_lib) ?
+ my $copy_circ_lib = (ref $self->copy->circ_lib) ?
$self->copy->circ_lib->id : $self->copy->circ_lib;
my $orgs = $U->get_org_descendants($copy_circ_lib);
# filter on "only at owning lib"
if (defined $a->alert_type->at_owning) {
- my $copy_owning_lib = (ref $self->volume->owning_lib) ?
+ my $copy_owning_lib = (ref $self->volume->owning_lib) ?
$self->volume->owning_lib->id : $self->volume->owning_lib;
my $orgs = $U->get_org_descendants($copy_owning_lib);
- if ($U->is_true($a-->alert_type>invert_location)) {
+ if ($U->is_true($a->alert_type->invert_location)) {
next if (grep {$_ == $copy_owning_lib} @$orgs);
} else {
next unless (grep {$_ == $copy_owning_lib} @$orgs);
my $alert_orgs = $U->get_org_ancestors($self->circ_lib);
my $alert_types = $e->search_config_copy_alert_type({
- active => 't'
+ active => 't',
scope_org => $alert_orgs,
event => $event,
state => $self->copy_state,
foreach my $a (@$alert_types) {
# filter on "only at circ lib"
if (defined $a->at_circ) {
- my $copy_circ_lib = (ref $self->copy->circ_lib) ?
+ my $copy_circ_lib = (ref $self->copy->circ_lib) ?
$self->copy->circ_lib->id : $self->copy->circ_lib;
my $orgs = $U->get_org_descendants($copy_circ_lib);
# filter on "only at owning lib"
if (defined $a->at_owning) {
- my $copy_owning_lib = (ref $self->volume->owning_lib) ?
+ my $copy_owning_lib = (ref $self->volume->owning_lib) ?
$self->volume->owning_lib->id : $self->volume->owning_lib;
my $orgs = $U->get_org_descendants($copy_owning_lib);
foreach my $t (@final_types) {
$t->next_status($U->unique_unnested_numbers($t->next_status));
- my $alert = new Fieldmapper::asset::copy_alert;
+ my $alert = new Fieldmapper::asset::copy_alert ();
$alert->alert_type($t->id);
$alert->copy($self->copy->id);
$alert->temp(1);
if ($self->new_copy_alerts) {
my @alerts;
- push @alerts, @{$self->user_copy_alerts}) # we have preexisting alerts
+ push @alerts, @{$self->user_copy_alerts} # we have preexisting alerts
if ($self->user_copy_alerts && @{$self->user_copy_alerts});
- push @alerts, @{$self->system_copy_alerts}) # we have new dynamic alerts
+ push @alerts, @{$self->system_copy_alerts} # we have new dynamic alerts
if ($self->system_copy_alerts && @{$self->system_copy_alerts});
if (@alerts) {