From 82640d0ec16b4f4277d22301d1029686b0195636 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 24 Aug 2011 13:57:11 -0400 Subject: [PATCH] Option to set copy creator value to ACQ receiver YAOUS to support updating the asset.copy.creator value to match the staff user that marked the ACQ-copy (acq.lineitem_detail) as received. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../perlmods/lib/OpenILS/Application/Acq/Order.pm | 2 ++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 17 +++++++++++++++ .../XXXX.data.acq-copy-creator-from-receiver.sql | 24 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-copy-creator-from-receiver.sql diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 8dc31ab30a..7313cc1e7b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -527,6 +527,8 @@ sub receive_lineitem_detail { $copy->status(OILS_COPY_STATUS_IN_PROCESS); $copy->edit_date('now'); $copy->editor($e->requestor->id); + $copy->creator($e->requestor->id) if $U->ou_ancestor_setting_value( + $e->requestor->ws_ou, 'acq.copy_creator_uses_receiver', $e); $e->update_asset_copy($copy) or return 0; $mgr->add_lid; 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 44f0f21ee7..5213ff997c 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -9692,3 +9692,20 @@ INSERT INTO authority.thesaurus (code, name, control_set) VALUES ('z', oils_i18n_gettext('z','Other','at','name'), 1), ('|', oils_i18n_gettext('|','No attempt to code','at','name'), 1); +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'acq.copy_creator_uses_receiver', + oils_i18n_gettext( + 'acq.copy_creator_uses_receiver', + 'Acq: Set copy creator as receiver', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'acq.copy_creator_uses_receiver', + 'When receiving a copy in acquisitions, set the copy "creator" to be the staff that received the copy', + 'coust', + 'label' + ), + 'bool' +); + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-copy-creator-from-receiver.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-copy-creator-from-receiver.sql new file mode 100644 index 0000000000..14b22d454b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-copy-creator-from-receiver.sql @@ -0,0 +1,24 @@ +-- Evergreen DB patch XXXX.data.acq-copy-creator-from-receiver.sql +BEGIN; + +-- check whether patch can be applied +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( + 'acq.copy_creator_uses_receiver', + oils_i18n_gettext( + 'acq.copy_creator_uses_receiver', + 'Acq: Set copy creator as receiver', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'acq.copy_creator_uses_receiver', + 'When receiving a copy in acquisitions, set the copy "creator" to be the staff that received the copy', + 'coust', + 'label' + ), + 'bool' +); + +COMMIT; -- 2.11.0