name => $penalty_name
});
- if (not $penalty_ou) {
+ return $editor->die_event unless $penalty and @$penalty;
+ $penalty = $penalty->[0];
+
+ if ($penalty_ou) {
+ $penalty_ou = $U->org_unit_ancestor_at_depth(
+ $penalty_ou, $penalty->org_depth)
+ if defined $penalty->org_depth;
+
+ } else {
# Fallback to using top of org tree if no penalty_ou provided. This
# possibly makes sense in most cases anyway.
$penalty_ou = $results->[0]->{"id"};
}
- return $editor->die_event unless $penalty and @$penalty;
- $penalty = $penalty->[0];
-
my $last_xact_id_map = {};
my $clear_meth = "clear_$contact_type";
INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (28,'STAFF_R','Alerting block on Renew','RENEW', TRUE);
INSERT INTO config.standing_penalty (id,name,label) VALUES (29,'INVALID_PATRON_ADDRESS','Patron has an invalid address');
INSERT INTO config.standing_penalty (id,name,label) VALUES (30,'PATRON_IN_COLLECTIONS','Patron has been referred to a collections agency');
-INSERT INTO config.standing_penalty (id, name, label, staff_alert) VALUES
+INSERT INTO config.standing_penalty (id, name, label, staff_alert, org_depth) VALUES
(
31,
'INVALID_PATRON_EMAIL_ADDRESS',
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
32,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
33,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
34,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
);
SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-INSERT INTO config.standing_penalty (id, name, label, staff_alert) VALUES
+INSERT INTO config.standing_penalty (id, name, label, staff_alert, org_depth) VALUES
(
31,
'INVALID_PATRON_EMAIL_ADDRESS',
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
32,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
33,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
),
(
34,
'csp',
'label'
),
- TRUE
+ TRUE,
+ 0
);
fieldmapper.standardRequest(
["open-ils.actor", "open-ils.actor.invalidate." + field], {
"async": true,
- "params": [openils.User.authtoken, patron.id()],
+ "params": [openils.User.authtoken, patron.id(), null, patron.home_ou()],
"oncomplete": function(r) {
progressDialog.hide();
// alerts on non-success event