[open-ils-commits] [GIT] Evergreen ILS branch master updated. e47016c1cc29d1106d1afc2d90cdba1255412f10

Evergreen Git git at git.evergreen-ils.org
Thu Nov 30 10:13:20 EST 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  e47016c1cc29d1106d1afc2d90cdba1255412f10 (commit)
      from  a0a92e094115ab569a5a5afb469b104f7e2bd865 (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 e47016c1cc29d1106d1afc2d90cdba1255412f10
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Fri Sep 15 14:38:18 2017 -0400

    LP#1178802: force ceiling dates to be end of day
    
    This patch ensures that when a hard due date (or hard due date value)
    is created or edited, the ceiling date is set to the end of that day.
    
    This fixes a problem where a ceiling date would not be applied for
    loans checked out earlier on the ceiling date itself.
    
    This patch intentionally does not touch existing hard due date
    values.  It also does not use the database or middle layer to coerce
    the ceiling dates to end of day to leave upon the possiblity that
    an Angular version of the hard due date editor will allow operators
    to set both date and time. (Note that Dojo does not readily have a
    combined date/time picker.)
    
    To test
    -------
    [1] Apply the patch, then in the hard due date editor, verify that
        when creating a hard due date _value_, the date gets saved as
        ending at 23:59:59 in the local time zone.
    [2] Similarly, verify that when editing an existing hard due date value,
        the date gets saved as ending at 23:59:59.
    [3] Repeat steps 1 and 2, but this time for hard due dates.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Michele Morgan <mmorgan at noblenet.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/conify/global/config/hard_due_date.tt2 b/Open-ILS/src/templates/conify/global/config/hard_due_date.tt2
index 1c9940d..d50a483 100644
--- a/Open-ILS/src/templates/conify/global/config/hard_due_date.tt2
+++ b/Open-ILS/src/templates/conify/global/config/hard_due_date.tt2
@@ -4,6 +4,9 @@
     dojo.require("openils.CGI");
     dojo.require("openils.Util");
     dojo.require("openils.widget.AutoGrid");
+    dojo.require("dojo.date.locale");
+    dojo.require("dojo.date.stamp");
+
 
     function get_chdd_name(rowIndex, item) {
         if (!item) return null;
@@ -37,6 +40,24 @@
                 openils.Util.show("one_only");
             }
             chddGrid.loadAll({"order_by": {"chdd": "name"}}, filter);
+
+            function munge_ceiling(chdd) {
+                var cd = dojo.date.stamp.fromISOString(chdd.ceiling_date());
+                // set to end of day in client time zone; if we were using
+                // moment, we could do moment().endOf('day') instead
+                cd.setHours(23, 59, 59);
+                chdd.ceiling_date(dojo.date.stamp.toISOString(cd));
+            }
+            chddGrid.onEditPane = function(pane) {
+                pane.onSubmit = function(chdd, ops) {
+                    munge_ceiling(chdd);
+                    (new openils.PermaCrud())[pane.mode](chdd, ops);
+               }
+            }
+            chddGrid.createPaneOnSubmit = function(chdd, ops, pane) {
+                munge_ceiling(chdd);
+                (new openils.PermaCrud())[pane.mode](chdd, ops);
+            }
         }
     );
 </script>
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 91fbe2e..8854bcb 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
@@ -6,6 +6,8 @@
     dojo.require("openils.Util");
     dojo.require("openils.widget.AutoGrid");
     dojo.require("dijit.form.TextBox");
+    dojo.require("dojo.date.locale");
+    dojo.require("dojo.date.stamp");
 
     openils.Util.addOnLoad(
         function() {
@@ -33,6 +35,24 @@
                 "create": chdd_id
             };
 
+            function munge_ceiling(chddv) {
+                var cd = dojo.date.stamp.fromISOString(chddv.ceiling_date());
+                // set to end of day in client time zone; if we were using
+                // moment, we could do moment().endOf('day') instead
+                cd.setHours(23, 59, 59);
+                chddv.ceiling_date(dojo.date.stamp.toISOString(cd));
+            }
+            chddvGrid.onEditPane = function(pane) {
+                pane.onSubmit = function(chddv, ops) {
+                    munge_ceiling(chddv);
+                    (new openils.PermaCrud())[pane.mode](chddv, ops);
+               }
+            }
+            chddvGrid.createPaneOnSubmit = function(chddv, ops, pane) {
+                munge_ceiling(chddv);
+                (new openils.PermaCrud())[pane.mode](chddv, ops);
+            }
+
             chddvGrid.loadAll({"order_by": {"chddv": "active_date"}}, filter);
         }
     );

-----------------------------------------------------------------------

Summary of changes:
 .../conify/global/config/hard_due_date.tt2         |   21 ++++++++++++++++++++
 .../conify/global/config/hard_due_date_values.tt2  |   20 +++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list