From 4a906f3b2776cfd97686b14b33a9051f03e9a70d Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 12 Nov 2009 18:07:05 +0000 Subject: [PATCH] instead of an explicit put-copy-into-missing status operation when an item is marked claims returned, allow for a configurable status git-svn-id: svn://svn.open-ils.org/ILS/trunk@14883 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Circ.pm | 16 +++++++--------- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 9 +++++++++ .../0078.data.claims_return_copy_status.sql | 16 ++++++++++++++++ 4 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0078.data.claims_return_copy_status.sql diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index a1e1cf8f70..df95ffd5ab 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -356,18 +356,16 @@ sub set_circ_claims_returned { } $e->update_action_circulation($circ) or return $e->die_event; - $e->commit; - - # see if we need to also mark the copy as missing - if($U->ou_ancestor_setting_value($circ->circ_lib, 'circ.claim_return.mark_missing')) { - return $apputils->simplereq( - 'open-ils.circ', - 'open-ils.circ.mark_item_missing', - $auth, $copy->id - ); + # see if there is a configured post-claims-return copy status + if(my $stat = $U->ou_ancestor_setting_value($circ->circ_lib, 'circ.claim_return.copy_status')) { + $copy->status($stat); + $copy->edit_date('now'); + $copy->editor($e->requestor->id); + $e->update_asset_copy($copy) or return $e->die_event; } + $e->commit; return 1; } diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 4f1b79a6bb..8d3a3b4cf1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0077'); -- atz +INSERT INTO config.upgrade_log (version) VALUES ('0078'); -- berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index c1e8e03495..c4da7cf82b 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -2383,3 +2383,12 @@ INSERT INTO action_trigger.environment (event_def, path) VALUES INSERT INTO action_trigger.reactor (module,description) VALUES ('ApplyPatronPenalty','Applies the conifigured penalty to a patron. Required named environment variables are "user", which refers to the user object, and "context_org", which refers to the org_unit object that acts as the focus for the penalty.'); +INSERT INTO config.org_unit_setting_type (name, label, description, datatype, fm_class) + VALUES ( + 'circ.claim_return.copy_status', + 'Claim Return Copy Status', + 'Claims returned copies are put into this status. Default is to leave the copy in the Checked Out status' + 'link', + 'ccs', + ); + diff --git a/Open-ILS/src/sql/Pg/upgrade/0078.data.claims_return_copy_status.sql b/Open-ILS/src/sql/Pg/upgrade/0078.data.claims_return_copy_status.sql new file mode 100644 index 0000000000..1efcfb3dc0 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0078.data.claims_return_copy_status.sql @@ -0,0 +1,16 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0078'); + +UPDATE config.org_unit_setting_type + SET + name = 'circ.claim_return.copy_status', + fm_class = 'ccs', + datatype = 'link', + label = 'Claim Return Copy Status', + description = 'Claims returned copies are put into this status. Default is to leave the copy in the Checked Out status' + WHERE + name = 'circ.claim_return.mark_missing'; + +COMMIT; + -- 2.43.2