}
my $method = 'open-ils.circ.holds.test_and_create.batch';
- $method .= '.override' if $cgi->param('override');
+
+ if ($cgi->param('override')) {
+ $method .= '.override';
+
+ } elsif (!$ctx->{is_staff}) {
+
+ $method .= '.override' if $self->ctx->{get_org_setting}->(
+ $e->requestor->home_ou, "opac.patron.auto_overide_hold_events");
+ }
my @create_targets = map {$_->{target_id}} (grep { !$_->{hold_failed} } @hold_data);
'gui'
);
+INSERT into config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES (
+ 'opac.patron.auto_overide_hold_events',
+ 'opac',
+ oils_i18n_gettext(
+ 'opac.patron.auto_overide_hold_events',
+ 'Auto-Override Permitted Hold Blocks (Patrons)',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'opac.patron.auto_overide_hold_events',
+ 'When a patron places a hold that fails and the patron has the correct permission ' ||
+ 'to override the hold, automatically override the hold without presenting a message ' ||
+ 'to the patron and requiring that the patron make a decision to override',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ );
--- /dev/null
+
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES (
+ 'opac.patron.auto_overide_hold_events',
+ 'opac',
+ oils_i18n_gettext(
+ 'opac.patron.auto_overide_hold_events',
+ 'Auto-Override Permitted Hold Blocks (Patrons)',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'opac.patron.auto_overide_hold_events',
+ 'When a patron places a hold that fails and the patron has the correct permission ' ||
+ 'to override the hold, automatically override the hold without presenting a message ' ||
+ 'to the patron and requiring that the patron make a decision to override',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ );
+
+COMMIT;