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

Evergreen Git git at git.evergreen-ils.org
Wed Dec 19 17:28:15 EST 2012


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  f5d27df4111b54367d7f270f7b63d4f8e9db2b92 (commit)
      from  d4fba307f7714924ef79789a4b327d783959fcbf (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 f5d27df4111b54367d7f270f7b63d4f8e9db2b92
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Wed Dec 19 11:41:28 2012 -0500

    LP #1092179 FlattenerGrid Filter dialog lead to clobbering grid's base query
    
    You could see this in the Simplified Hold Pull List interface.  Using
    the filter dialog would refresh the grid and populate it with rows
    corresponding to your filters, but it would throw away your setting from
    the context org dropdown (labeled "Show the pull list for..." there).
    
    FlattenerGrid had a broken mechanism for trying to nicely mix a user's
    input from things like context org dropdowns with whatever they put into
    the filter dialog, and now that mechanism has been fixed.
    
    This also means a tiny change to the User Event Log interface to react
    to the slight change in FlattenerGrid's API.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/actor/user/event_log.tt2 b/Open-ILS/src/templates/actor/user/event_log.tt2
index 9bbc722..de1afa1 100644
--- a/Open-ILS/src/templates/actor/user/event_log.tt2
+++ b/Open-ILS/src/templates/actor/user/event_log.tt2
@@ -196,13 +196,12 @@
 
     /* The callback fired when the OrgUnitFilteringSelect is changed */
     function set_grid_query_from_org_selector() {
-        /* Naughty: shouldn't use _baseQuery like this, but need to rethink
-           multiple competing filtering mechanisms. */
-        grid._baseQuery.perm_lib = aou.descendantNodeList(
+        grid.baseQuery.perm_lib = aou.descendantNodeList(
             org_selector.attr("value"), /* as id */ true
         );
 
-        /* But for the persistent filter UI, this would be grid.refresh() */
+        /* But for the persistent filter UI, this would be grid.filter()
+           and grid.refresh() */
         if (filter_semaphore())   /* avoid race between ou selector and other
                                      filter thing */
             filter_semaphore_callback();
diff --git a/Open-ILS/src/templates/circ/hold_pull_list.tt2 b/Open-ILS/src/templates/circ/hold_pull_list.tt2
index 485d717..67056a8 100644
--- a/Open-ILS/src/templates/circ/hold_pull_list.tt2
+++ b/Open-ILS/src/templates/circ/hold_pull_list.tt2
@@ -21,9 +21,15 @@
     };
 
     function set_grid_query_from_org_selector() {
-        grid.query = {
+        grid.baseQuery = {  /* Don't optimize away this assignment.  It's
+                               important to store this data so that the filter
+                               dialog doesn't clobber it later. */
             "copy_circ_lib": org_selector.attr("value")
         };
+        grid.filter(
+            dojo.mixin(grid.query, grid.baseQuery),
+            true    /* re-fetch */
+        );
         grid.refresh();
     }
 
diff --git a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
index 03166da..54e67c2 100644
--- a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js
@@ -26,6 +26,10 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) {
             "filterWidgetBuilders": null,
             "filterSemaphore": null,
             "filterSemaphoreCallback": null,
+            "baseQuery": null,  /* Good place to mix in data from, say, context
+                                   OU selectors so that it should get mixed
+                                   correctly with the generated query from the
+                                   filter dialog. */
 
             /* These potential constructor arguments may be useful to
              * FlattenerGrid in their own right, and are passed to
@@ -392,8 +396,11 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) {
             },
 
             "startup": function() {
-                /* Save original query for further filtering later */
-                this._baseQuery = dojo.clone(this.query);
+                /* Save original query for further filtering later, unless
+                 * we've already defined baseQuery from the outside, in
+                 * which case it persists. */
+                if (!this.baseQuery)
+                    this.baseQuery = dojo.clone(this.query);
 
                 this._addAutoFields();
 
@@ -503,7 +510,7 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) {
                     this.filterUi.onApply = dojo.hitch(
                         this, function(filter) {
                             this.filter(
-                                dojo.mixin(filter, this._baseQuery),
+                                dojo.mixin(filter, this.baseQuery),
                                 true    /* re-render */
                             );
                         }

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

Summary of changes:
 Open-ILS/src/templates/actor/user/event_log.tt2    |    7 +++----
 Open-ILS/src/templates/circ/hold_pull_list.tt2     |    8 +++++++-
 .../web/js/dojo/openils/widget/FlattenerGrid.js    |   13 ++++++++++---
 3 files changed, 20 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list