From 65e7211b4298f65d0b628d834996a4669098ecdc Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 10 Nov 2011 17:22:22 -0500 Subject: [PATCH] Serials: allow freer input in holding code mini-wizard In the Subscription Details interface of the Alternate Serials Control View, under the Issuance tab, if you create a new issuance you can now enter things like "01/02" in (say) the month field to denote a combined January/February issue. All those fields are now free-form, whereas some of them used to be numeric only. Also, avoid an occasional issue where an error message about dijit.form.DateTextBox not being a constructor would appear in the JavaScript console. The problem was in a race condition among some co-dependent JavaScript files that were all being loaded at the same time. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Wells --- Open-ILS/web/js/dojo/openils/widget/HoldingCode.js | 12 +++--------- .../js/ui/default/serial/subscription/issuance.js | 2 ++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js index 4722cba00a..1221c7c144 100644 --- a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js +++ b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js @@ -3,7 +3,6 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) { dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.form.DropDownButton"); dojo.require("dijit.form.TextBox"); - dojo.require("dijit.form.NumberTextBox"); var _needed_fields = "abcdefghijklm"; @@ -67,13 +66,8 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) { } dojo.create("td", {"innerHTML": field.caption}, tr); - var dij = field.subfield > "h" ? - dijit.form.NumberTextBox : dijit.form.TextBox; - var input = new dij( - { - "name": field.subfield, - "constraints": {"pattern": "####"} - }, + var input = new dijit.form.TextBox( + {"name": field.subfield}, dojo.create("td", null, tr) ); input.startup(); @@ -89,7 +83,7 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) { inputs.forEach( function(input) { var value = input.input.attr("value"); - if (value === null || isNaN(value)) { + if (value === null || value === "") { /* XXX i18n */ alert("A valid holding code cannot be " + "produced with any blank fields."); diff --git a/Open-ILS/web/js/ui/default/serial/subscription/issuance.js b/Open-ILS/web/js/ui/default/serial/subscription/issuance.js index 75484c52dd..eb4fae411e 100644 --- a/Open-ILS/web/js/ui/default/serial/subscription/issuance.js +++ b/Open-ILS/web/js/ui/default/serial/subscription/issuance.js @@ -1,3 +1,5 @@ +dojo.require("dijit.form.DateTextBox"); + function fresh_scap_selector(grid) { /* this really needs to be sync, not async */ pcrud.search( -- 2.43.2