[open-ils-commits] [GIT] Evergreen ILS branch rel_2_9 updated. 1b02296838fa19ef697d62a1a967ca4c61efab59
Evergreen Git
git at git.evergreen-ils.org
Fri Nov 13 16:16:19 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_9 has been updated
via 1b02296838fa19ef697d62a1a967ca4c61efab59 (commit)
via 373762f2f94d4e0a1c6841effb395109f6c59778 (commit)
via fea0db8bb05d01d69c636b417ce02711e097b219 (commit)
from 588ee974221977899ce3ef84a9d3f8bafde6c4c2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1b02296838fa19ef697d62a1a967ca4c61efab59
Author: Jason Stephenson <jstephenson at mvlc.org>
Date: Fri Nov 13 16:12:46 2015 -0500
LP#1513554 - Stamping Upgrade Script
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 3a009ea..31f73c4 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0948', :eg_version); -- miker/gmcharlt/remington/bshum
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0949', :eg_version); -- csharp/kmlussier/dyrcona
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql b/Open-ILS/src/sql/Pg/upgrade/0949.schema.no_delete_acq_cancel_reasons.sql
similarity index 90%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql
rename to Open-ILS/src/sql/Pg/upgrade/0949.schema.no_delete_acq_cancel_reasons.sql
index 54581fc..eeceaf7 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0949.schema.no_delete_acq_cancel_reasons.sql
@@ -1,6 +1,6 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0949', :eg_version);
CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$
BEGIN
commit 373762f2f94d4e0a1c6841effb395109f6c59778
Author: Kathy Lussier <klussier at masslnc.org>
Date: Sun Nov 8 09:47:58 2015 -0500
LP#1513554 - Doc update for cancel reason selection
Adding an update to the docs to inform users that default cancel reasons
cannot be selected.
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/docs/admin/acquisitions_admin.txt b/docs/admin/acquisitions_admin.txt
index 89b0669..a741a04 100644
--- a/docs/admin/acquisitions_admin.txt
+++ b/docs/admin/acquisitions_admin.txt
@@ -38,7 +38,7 @@ in the acquisitions module
* Temporary call number prefix - Temporary call number prefix for items that are
created in the acquisitions module
-Cancel/Suspend reasons
+Cancel/Delay reasons
~~~~~~~~~~~~~~~~~~~~~~
indexterm:[acquisitions,purchase order,cancellation]
@@ -48,12 +48,12 @@ The Cancel reasons link enables you to predefine the reasons for which a line
item or a PO can be cancelled. A default list of reasons appears, but you can
add custom reasons to this list. Applying the cancel reason will prevent the
item from appearing in a claims list and will allow you to cancel debits
-associated with the purchase. Cancel reasons also enable you to suspend or delay
+associated with the purchase. Cancel reasons also enable you to delay
a purchase. For example, you could create a cancel reason of 'back ordered,' and
you could choose to keep the debits associated with the purchase.
-Create a cancel/suspend reason
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Create a cancel/delay reason
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
. To add a new cancel reason, click _Administration -> Server Administration ->
Acquisitions -> Cancel reasons_.
@@ -70,13 +70,27 @@ Units.)
cancel reason on an item or a PO.
. Create a description of the cancel reason. This is a free text field and can
-be comprised of any text of your choosing.
+comprise any text of your choosing.
. If you want to retain the debits associated with the cancelled purchase, click
the box adjacent to Keep Debits->
. Click _Save_.
+Delete a custom cancel/delay reason
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can delete custom cancel reason.
+
+. Select the checkbox for the custom cancel reason that should be deleted.
+
+. Click the _Delete Selected_ button.
+
+[TIP]
+You cannot select the checkbox for any of the default cancel reasons because the
+system expects those reasons to be available to handle EDI order responses.
+
+
Claiming
~~~~~~~~
commit fea0db8bb05d01d69c636b417ce02711e097b219
Author: Chris Sharp <csharp at georgialibraries.org>
Date: Thu Nov 5 13:30:51 2015 -0500
LP#1513554 - Prevent deletion of reserved rows.
It was previously possible to delete reserved rows in
the acq.cancel_reasons table via the UI. We take a belt
and suspenders approach here:
1) Grey out the checkboxes beside cancel reasons with an
ID lower than 2000.
2) Create a trigger on the acq.cancel_reason table that
prevents deletion of rows with an ID lower than 2000.
The trigger executes a new generally available function
for use in similar situations in the future.
Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/Open-ILS/src/sql/Pg/000.functions.general.sql b/Open-ILS/src/sql/Pg/000.functions.general.sql
index d62bd70..0cfa909 100644
--- a/Open-ILS/src/sql/Pg/000.functions.general.sql
+++ b/Open-ILS/src/sql/Pg/000.functions.general.sql
@@ -76,4 +76,13 @@ $$ LANGUAGE PLPERLU;
COMMENT ON FUNCTION evergreen.could_be_serial_holding_code(TEXT) IS
'Return true if parameter is valid JSON representing an array that at minimum doesn''t make MARC::Field balk and only has subfield labels exactly one character long. Otherwise false.';
+CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$
+BEGIN
+IF OLD.id < TG_ARGV[0]::INT THEN
+ RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id;
+END IF;
+END
+$protect_reserved$
+LANGUAGE plpgsql;
+
COMMIT;
diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql
index 3405ad2..0359ed7 100644
--- a/Open-ILS/src/sql/Pg/200.schema.acq.sql
+++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql
@@ -358,6 +358,11 @@ CREATE TABLE acq.cancel_reason (
SELECT SETVAL('acq.cancel_reason_id_seq'::TEXT, 2000);
+DROP TRIGGER IF EXISTS acq_no_deleted_reserved_cancel_reasons ON acq.cancel_reason;
+
+CREATE TRIGGER acq_no_deleted_reserved_cancel_reasons BEFORE DELETE ON acq.cancel_reason
+ FOR EACH ROW EXECUTE PROCEDURE evergreen.protect_reserved_rows_from_delete(2000);
+
CREATE TABLE acq.purchase_order (
id SERIAL PRIMARY KEY,
owner INT NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
diff --git a/Open-ILS/src/sql/Pg/t/lp1513554_do_not_delete_reserved_cancel_reasons.pg b/Open-ILS/src/sql/Pg/t/lp1513554_do_not_delete_reserved_cancel_reasons.pg
new file mode 100644
index 0000000..8042860
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/lp1513554_do_not_delete_reserved_cancel_reasons.pg
@@ -0,0 +1,13 @@
+BEGIN;
+
+SELECT plan(1);
+
+SELECT throws_ok(
+ 'delete from acq.cancel_reason where id = 1',
+ 'P0001',
+ 'Cannot delete row with reserved ID 1'
+);
+
+SELECT * FROM finish();
+
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql
new file mode 100644
index 0000000..54581fc
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.no_delete_acq_cancel_reasons.sql
@@ -0,0 +1,21 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION evergreen.protect_reserved_rows_from_delete() RETURNS trigger AS $protect_reserved$
+BEGIN
+IF OLD.id < TG_ARGV[0]::INT THEN
+ RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id;
+END IF;
+END
+$protect_reserved$
+LANGUAGE plpgsql;
+
+DROP TRIGGER IF EXISTS acq_no_deleted_reserved_cancel_reasons ON acq.cancel_reason;
+
+CREATE TRIGGER acq_no_deleted_reserved_cancel_reasons BEFORE DELETE ON acq.cancel_reason
+ FOR EACH ROW EXECUTE PROCEDURE evergreen.protect_reserved_rows_from_delete(2000);
+
+ALTER TABLE acq.cancel_reason ENABLE TRIGGER acq_no_deleted_reserved_cancel_reasons;
+
+COMMIT;
diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js b/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js
index 6cd329f..86d8c61 100644
--- a/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js
+++ b/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js
@@ -19,6 +19,11 @@ function setup() {
);
};
+ crGrid.disableSelectorForRow = function(rowIdx) {
+ var item = crGrid.getItem(rowIdx);
+ return (crGrid.store.getValue(item, 'id') < 2000);
+ }
+
new openils.User().buildPermOrgSelector(
'ADMIN_ACQ_CANCEL_CAUSE', contextOrgSelector, null, connect);
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/000.functions.general.sql | 9 +++++++
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/200.schema.acq.sql | 5 ++++
...513554_do_not_delete_reserved_cancel_reasons.pg | 13 ++++++++++
.../0949.schema.no_delete_acq_cancel_reasons.sql | 21 +++++++++++++++++
.../ui/default/conify/global/acq/cancel_reason.js | 5 ++++
docs/admin/acquisitions_admin.txt | 24 +++++++++++++++----
7 files changed, 73 insertions(+), 6 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/t/lp1513554_do_not_delete_reserved_cancel_reasons.pg
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0949.schema.no_delete_acq_cancel_reasons.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list