[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. f9ce3c6bd083af31296a1de784f4756b26bb8cec

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 11:32:26 EST 2011


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_1 has been updated
       via  f9ce3c6bd083af31296a1de784f4756b26bb8cec (commit)
      from  4eae8be20eeb798ae5fcd54dabb959cd6d0b6c43 (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 f9ce3c6bd083af31296a1de784f4756b26bb8cec
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Mon Nov 14 15:31:14 2011 -0500

    Serials: in the holding code mini-wizard, offer a dropdown for seasons
    
    This spares the user from having to remember the MFHD code for the
    season, when dealing with periodicals issued by season (21 - 24 for
    Spring - Winter, respectively).
    
    This also applies sets the "scrollOnFocus" attribute to false for the
    dijits within the mini wizard, as the jumpy behavior you get in
    less-than-fullscreen staff client windows is otherwise maddening.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
index 1221c7c..7d8aa09 100644
--- a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
+++ b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
@@ -4,7 +4,27 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
     dojo.require("dijit.form.DropDownButton");
     dojo.require("dijit.form.TextBox");
 
+    /* XXX These variables and functions preceding the call to dojo.declar()
+     * all pollute the window namespace.  They're not written as methods for
+     * the openils.widget.HoldingCode "class," but they should probably move
+     * into there anyway.
+     */
+
     var _needed_fields = "abcdefghijklm";
+    var _season_store = new dojo.data.ItemFileReadStore({
+        "data": {
+            "identifier": "code",
+            "label": "label",
+            "items": [
+                {"code": 21, "label": "Spring"},
+                {"code": 22, "label": "Summer"},
+                {"code": 23, "label": "Fall"},
+                {"code": 24, "label": "Winter"}
+            ]
+        }
+    }); /* XXX i18n the above seasons. Also maybe don't
+         hardcode MFHD seasons here? */
+
 
     function _prepare_ttip_dialog(div, wizard) {
         dojo.empty(div);
@@ -47,6 +67,32 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
         _prepare_ttip_dialog_fields(div, fields, wizard);
     }
 
+    function _generate_dijit_for_field(field, tr) {
+        dojo.create("td", {"innerHTML": field.caption}, tr);
+
+        /* Any more special cases than this and we should switch to a dispatch
+         * table or somethingl. */
+        var input;
+        if (field.subfield == "j") {
+            input = new dijit.form.FilteringSelect(
+                {
+                    "name": field.subfield,
+                    "store": _season_store,
+                    "searchAttr": "label",
+                    "scrollOnFocus": false
+                }, dojo.create("td", null, tr)
+            );
+        } else {
+            input = new dijit.form.TextBox(
+                {"name": field.subfield, "scrollOnFocus": false},
+                dojo.create("td", null, tr)
+            );
+        }
+        input.startup();
+
+        return input;
+    }
+
     function _prepare_ttip_dialog_fields(div, fields, wizard) {
         /* XXX TODO Don't assume these defaults for the indicators and $8, and
          * provide reasonable control over them. */
@@ -65,12 +111,7 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
                         field.caption.slice(1);
                 }
 
-                dojo.create("td", {"innerHTML": field.caption}, tr);
-                var input = new dijit.form.TextBox(
-                    {"name": field.subfield},
-                    dojo.create("td", null, tr)
-                );
-                input.startup();
+                var input = _generate_dijit_for_field(field, tr);
                 wizard.preset_input_by_date(input, field.caption.toLowerCase());
                 inputs.push({"subfield": field.subfield, "input": input});
             }
@@ -95,7 +136,8 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
                     wizard.code_text_box.attr("value", js2JSON(holding_code));
                     wizard.wizard_button.attr("disabled", false);
                     dojo.empty(div);
-                }
+                },
+                "scrollOnFocus": false
             }, dojo.create(
                 "span", null, dojo.create(
                     "td", {"colspan": 2},

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

Summary of changes:
 Open-ILS/web/js/dojo/openils/widget/HoldingCode.js |   56 +++++++++++++++++---
 1 files changed, 49 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list