From: Chris Sharp Date: Fri, 19 Aug 2022 19:58:00 +0000 (-0400) Subject: LP#1963541: Add canceling staff information to hold requests X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=94209e29d7ac91215bb70a292a74cf4dbf879b89;p=working%2FEvergreen.git LP#1963541: Add canceling staff information to hold requests Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 949ed2b1c2..17463123d1 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -6837,6 +6837,8 @@ SELECT usr, + + @@ -6870,6 +6872,8 @@ SELECT usr, + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index d295fa2e72..d432bbed32 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1120,6 +1120,8 @@ sub cancel_hold { $hold->cancel_time('now'); $hold->cancel_cause($cause); $hold->cancel_note($note); + $hold->canceled_by($e->requestor->id); + $hold->canceling_ws($e->requestor->wsid); $e->update_action_hold_request($hold) or return $e->die_event; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm index 1dd595dcc3..48fa9cc5ad 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm @@ -94,7 +94,7 @@ __PACKAGE__->table('action_hold_request'); __PACKAGE__->columns(Primary => 'id'); __PACKAGE__->columns(Essential => qw/request_time capture_time fulfillment_time prev_check_time expire_time requestor usr cancel_cause - hold_type holdable_formats target cancel_time shelf_time + hold_type holdable_formats target cancel_time canceled_by canceling_ws shelf_time phone_notify email_notify sms_notify sms_carrier selection_depth cancel_note pickup_lib current_copy request_lib frozen thaw_date mint_condition fulfillment_staff fulfillment_lib selection_ou cut_in_line diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 69d6b0389c..380cc2e84f 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -465,6 +465,8 @@ CREATE TABLE action.hold_request ( cancel_time TIMESTAMP WITH TIME ZONE, cancel_cause INT REFERENCES action.hold_request_cancel_cause (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED, cancel_note TEXT, + canceled_by INT REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, + canceling_ws INT REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED, target BIGINT NOT NULL, -- see hold_type current_copy BIGINT, -- REFERENCES asset.copy (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED, -- XXX could be an serial.unit now... fulfillment_staff INT REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_cancel_info_to_hold_requests.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_cancel_info_to_hold_requests.sql new file mode 100644 index 0000000000..2039f01a1d --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_cancel_info_to_hold_requests.sql @@ -0,0 +1,13 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +ALTER TABLE action.hold_request +ADD COLUMN canceled_by INT REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, +ADD COLUMN canceling_ws INT REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED; + +CREATE INDEX hold_request_canceled_by_idx ON action.hold_request (canceled_by); +CREATE INDEX hold_request_canceling_ws_idx ON action.hold_request (canceling_ws); + +COMMIT; +