From: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Date: Wed, 16 Nov 2011 20:19:18 +0000 (-0500)
Subject: Serials: be less eager to offer season dropdown in holding code mini-wizard
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6ebb789434cb554ce1036d92a4dded3ecf23b989;p=evergreen%2Fmasslnc.git

Serials: be less eager to offer season dropdown in holding code mini-wizard

The recent commit (ebce79a288b in master) to make the holding code
mini-wizard offer a dropdown for season offers it too often, sometimes
in completely inappropriate cases.

This commit gets it right, and incidentally fixes two totally broken
links elsewhere in alternate serials control view interfaces.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
---

diff --git a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
index 7d8aa09f8a..b26cb2bef7 100644
--- a/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
+++ b/Open-ILS/web/js/dojo/openils/widget/HoldingCode.js
@@ -55,7 +55,7 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
             var value = pattern_code[i + 1];
 
             if (_needed_fields.indexOf(subfield) != -1)
-                fields.push({"subfield": subfield, "caption": value});
+                fields.push({"subfield": subfield, "caption": value, "pattern_value": value});
         }
 
         if (!fields.length) {
@@ -71,9 +71,9 @@ if (!dojo._hasResource["openils.widget.HoldingCode"]) {
         dojo.create("td", {"innerHTML": field.caption}, tr);
 
         /* Any more special cases than this and we should switch to a dispatch
-         * table or somethingl. */
+         * table or something. */
         var input;
-        if (field.subfield == "j") {
+        if (field.pattern_value.match(/season/)) {
             input = new dijit.form.FilteringSelect(
                 {
                     "name": field.subfield,
diff --git a/Open-ILS/web/js/ui/default/serial/list_item.js b/Open-ILS/web/js/ui/default/serial/list_item.js
index 8455c82d86..c4c7654616 100644
--- a/Open-ILS/web/js/ui/default/serial/list_item.js
+++ b/Open-ILS/web/js/ui/default/serial/list_item.js
@@ -28,7 +28,7 @@ function load_siss_display() {
                     var link = dojo.byId("siss_label_here");
                     link.onclick = function() {
                         location.href = oilsBasePath +
-                            "/eg/serial/subscription?id=" +
+                            "/serial/subscription?id=" +
                             r.subscription() + "&tab=issuances";
                     }
                     link.innerHTML = r.label();
diff --git a/Open-ILS/web/js/ui/default/serial/list_stream.js b/Open-ILS/web/js/ui/default/serial/list_stream.js
index 403b317120..79bf05d259 100644
--- a/Open-ILS/web/js/ui/default/serial/list_stream.js
+++ b/Open-ILS/web/js/ui/default/serial/list_stream.js
@@ -36,7 +36,7 @@ function load_sdist_display() {
                     var link = dojo.byId("sdist_label_here");
                     link.onclick = function() {
                         location.href = oilsBasePath +
-                            "/eg/serial/subscription?id=" +
+                            "/serial/subscription?id=" +
                             r.subscription() + "&tab=distributions";
                     }
                     link.innerHTML = r.label();