flesh_fields => {acp => ['call_number','parts','floating'], acn => ['record']}
};
+# table of cases where suppressing a system-generated copy alerts
+# should generate an override of an old-style event
+my %COPY_ALERT_OVERRIDES = (
+ "CLAIMSRETURNED\tCHECKOUT" => 'CIRC_CLAIMS_RETURNED',
+);
+
sub initialize {}
__PACKAGE__->register_method(
new_copy_alerts
user_copy_alerts
system_copy_alerts
+ overrides_per_copy_alerts
next_copy_status
copy_state
patron
}
my @alerts;
+
+ # keep track of conditions corresponding to suppressed
+ # system alerts, as these may be used to overridee
+ # certain old-style-events
+ my %auto_override_conditions = ();
foreach my $t (@final_types) {
$t->next_status([$U->unique_unnested_numbers($t->next_status)])
if ($t->next_status);
$alert->alert_type($t->clone);
push(@{$self->next_copy_status}, @{$t->next_status}) if ($t->next_status);
+ if (grep {$_->alert_type == $t->id} @$suppressions) {
+ $auto_override_conditions{join("\t", $t->state, $t->event)} = 1;
+ }
push(@alerts, $alert) unless (grep {$_->alert_type == $t->id} @$suppressions);
}
$self->system_copy_alerts(\@alerts);
+ $self->overrides_per_copy_alerts(\%auto_override_conditions);
+}
+
+sub add_overrides_from_system_copy_alerts {
+ my $self = shift;
+
+ foreach my $condition (keys %{$self->overrides_per_copy_alerts()}) {
+ if (exists $COPY_ALERT_OVERRIDES{$condition}) {
+ $self->override(1);
+ push @{$self->override_args->{events}}, $COPY_ALERT_OVERRIDES{$condition};
+ }
+ }
}
sub mk_env {
);
$self->generate_system_copy_alerts;
+ $self->add_overrides_from_system_copy_alerts;
$self->collect_user_copy_alerts;
$self->filter_user_copy_alerts;