[open-ils-commits] [GIT] Evergreen ILS branch master updated. 825f4aaf8e407a42ddd30ce558303696aa7ecd47
Evergreen Git
git at git.evergreen-ils.org
Tue May 2 21:52:01 EDT 2017
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, master has been updated
via 825f4aaf8e407a42ddd30ce558303696aa7ecd47 (commit)
via 1d80a0b790bfb573a5b78bd0ab6d98dc4e5dd5c4 (commit)
via 8228c2165fab8d06a8585723952d470d5b096e19 (commit)
from 774bdcf2e719367626107a9de7f11fc3c2e893cc (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 825f4aaf8e407a42ddd30ce558303696aa7ecd47
Author: Ben Shum <ben at evergreener.net>
Date: Tue May 2 21:51:13 2017 -0400
LP#1427392: Stamping upgrade script for hard due date value fix
Signed-off-by: Ben Shum <ben at evergreener.net>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index c74e223..2655c17 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -90,7 +90,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 ('1035', :eg_version); -- dyrcona/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1036', :eg_version); -- mmorgan/bshum
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql b/Open-ILS/src/sql/Pg/upgrade/1036.function.config_update_hard_due_dates_ceiling_date_fix.sql
similarity index 93%
rename from Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql
rename to Open-ILS/src/sql/Pg/upgrade/1036.function.config_update_hard_due_dates_ceiling_date_fix.sql
index 33ec9e3..e9f45c2 100644
--- a/Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1036.function.config_update_hard_due_dates_ceiling_date_fix.sql
@@ -1,5 +1,7 @@
BEGIN;
+SELECT evergreen.upgrade_deps_block_check('1036', :eg_version);
+
CREATE OR REPLACE FUNCTION config.update_hard_due_dates () RETURNS INT AS $func$
DECLARE
temp_value config.hard_due_date_values%ROWTYPE;
commit 1d80a0b790bfb573a5b78bd0ab6d98dc4e5dd5c4
Author: Michele Morgan <mmorgan at noblenet.org>
Date: Tue May 2 09:17:55 2017 -0400
LP#1427392: Add release note for hard due date values fix
Signed-off-by: Michele Morgan <mmorgan at noblenet.org>
Signed-off-by: Ben Shum <ben at evergreener.net>
diff --git a/docs/RELEASE_NOTES_NEXT/circulation/hard_due_date_value_fixes.adoc b/docs/RELEASE_NOTES_NEXT/circulation/hard_due_date_value_fixes.adoc
new file mode 100644
index 0000000..0770020
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/circulation/hard_due_date_value_fixes.adoc
@@ -0,0 +1,6 @@
+Enhancements to Hard Due Date Functionality
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+It will now be possible to delete Hard Due Date Values for dates that have
+passed. Also, the Hard Due Date updater will no longer change Ceiling Dates
+to a past date. This allows editing Ceiling Dates directly in a Hard Due Date
+as well as scheduling Ceiling Date changes via Hard Due Date Values.
commit 8228c2165fab8d06a8585723952d470d5b096e19
Author: Michele Morgan <mmorgan at noblenet.org>
Date: Wed Mar 15 16:31:06 2017 -0400
LP#1427392 - Allow deletion of Hard Due Date Values.
Also, don't update hard due dates to ceiling dates that have passed.
Fixes two related issues with hard due dates.
- Exposes the selector in the Hard Due Date Values interface so past
entries that are no longer valid can be deleted via the client.
- Prevents the current ceiling date from being updated to a past date
based on an old hard due date value.
Testing plan:
To reproduce the issue:
- Create a Hard Due Date with a Current Ceiling Date in the future
- Create an associated Hard Due Date Value with an active date earlier
than the current date and a ceiling date earlier than the current date.
- Run the hard due date updater
Note that:
- The Current Ceiling Date is updated to an earlier date based on
the Hard Due Date Value entry.
- It is not possible to select and delete the Hard Due Date Value
entry.
Apply the patch and retest
Note that:
- The Current Ceiling Date has not been updated to the past date.
- Past Hard Due Date Values can now be selected and deleted.
Signed-off-by: Michele Morgan <mmorgan at noblenet.org>
Signed-off-by: Ben Shum <ben at evergreener.net>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 97ef039..c74e223 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -340,7 +340,8 @@ BEGIN
UPDATE config.hard_due_date
SET ceiling_date = temp_value.ceiling_date
WHERE id = temp_value.hard_due_date
- AND ceiling_date <> temp_value.ceiling_date; -- Time is equal if we've already updated the chdd
+ AND ceiling_date <> temp_value.ceiling_date -- Time is equal if we've already updated the chdd
+ AND temp_value.ceiling_date >= NOW(); -- Don't update ceiling dates to the past
IF FOUND THEN
updated := updated + 1;
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql
new file mode 100644
index 0000000..33ec9e3
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.function.config_update_hard_due_dates_ceiling_date_fix.sql
@@ -0,0 +1,29 @@
+BEGIN;
+
+CREATE OR REPLACE FUNCTION config.update_hard_due_dates () RETURNS INT AS $func$
+DECLARE
+ temp_value config.hard_due_date_values%ROWTYPE;
+ updated INT := 0;
+BEGIN
+ FOR temp_value IN
+ SELECT DISTINCT ON (hard_due_date) *
+ FROM config.hard_due_date_values
+ WHERE active_date <= NOW() -- We've passed (or are at) the rollover time
+ ORDER BY hard_due_date, active_date DESC -- Latest (nearest to us) active time
+ LOOP
+ UPDATE config.hard_due_date
+ SET ceiling_date = temp_value.ceiling_date
+ WHERE id = temp_value.hard_due_date
+ AND ceiling_date <> temp_value.ceiling_date -- Time is equal if we've already updated the chdd
+ AND temp_value.ceiling_date >= NOW(); -- Don't update ceiling dates to the past
+
+ IF FOUND THEN
+ updated := updated + 1;
+ END IF;
+ END LOOP;
+
+ RETURN updated;
+END;
+$func$ LANGUAGE plpgsql;
+
+COMMIT;
diff --git a/Open-ILS/src/templates/conify/global/config/hard_due_date_values.tt2 b/Open-ILS/src/templates/conify/global/config/hard_due_date_values.tt2
index b1ba77c..91fbe2e 100644
--- a/Open-ILS/src/templates/conify/global/config/hard_due_date_values.tt2
+++ b/Open-ILS/src/templates/conify/global/config/hard_due_date_values.tt2
@@ -65,7 +65,7 @@
suppressFields="['hard_due_date']"
suppressEditFields="['id']"
fmClass="chddv"
- hideSelector="true"
+ hideSelector="false"
editOnEnter="true">
</table>
</div>
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 5 +++--
...fig_update_hard_due_dates_ceiling_date_fix.sql} | 5 +++--
.../conify/global/config/hard_due_date_values.tt2 | 2 +-
.../circulation/hard_due_date_value_fixes.adoc | 6 ++++++
4 files changed, 13 insertions(+), 5 deletions(-)
copy Open-ILS/src/sql/Pg/upgrade/{0470.schema.config_update_hard_due_dates_repairs.sql => 1036.function.config_update_hard_due_dates_ceiling_date_fix.sql} (73%)
create mode 100644 docs/RELEASE_NOTES_NEXT/circulation/hard_due_date_value_fixes.adoc
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list