From a623998209db1cc3299818a2922fd6d42b529ba8 Mon Sep 17 00:00:00 2001 From: senator Date: Fri, 3 Sep 2010 16:30:47 +0000 Subject: [PATCH] Serials: a wizard for the pattern code field of the caption_and_pattern object This field holds the same data you'd find in the contents of an 853, 854, or 855 tag. This wizard aims to make it a little easier for mere mortals to compose this information, since the correctness of this field is fairly central to reasonably accurate serials issuance prediction. Find a button to launch this wizard from the Caption/Pattern interface of the Serial Control View. Big thanks to Galen Charlton, Dan Wells and Mike Rylander for all the help in getting this started and understanding the MARC. The wizard does still have a way to go before it's everything it can be. It still needs (in no particular order): - scrollbars on that dialog window - support for subfield $y and probably $z, possibly others - i18n fixes, accessibility improvements - more control over subfield $8 - more input validation and user guidance; sane defaults for some fields? - reconsideration of the order of the parts of the wizard - finding out if it makes sense to allow $m without $j,$k and $l present git-svn-id: svn://svn.open-ils.org/ILS/trunk@17472 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 3 + .../server/locale/en-US/serial.properties | 15 + .../staff_client/server/serial/batch_receive.js | 69 +-- .../server/serial/batch_receive_overlay.xul | 3 +- Open-ILS/xul/staff_client/server/serial/common.js | 62 +++ .../staff_client/server/serial/pattern_wizard.js | 609 +++++++++++++++++++++ .../staff_client/server/serial/pattern_wizard.xul | 32 ++ .../server/serial/pattern_wizard_overlay.xul | 289 ++++++++++ .../xul/staff_client/server/serial/scap_editor.js | 21 +- .../xul/staff_client/server/serial/scap_editor.xul | 1 + Open-ILS/xul/staff_client/server/skin/serial.css | 12 +- 11 files changed, 1046 insertions(+), 70 deletions(-) create mode 100644 Open-ILS/xul/staff_client/server/serial/common.js create mode 100644 Open-ILS/xul/staff_client/server/serial/pattern_wizard.js create mode 100644 Open-ILS/xul/staff_client/server/serial/pattern_wizard.xul create mode 100644 Open-ILS/xul/staff_client/server/serial/pattern_wizard_overlay.xul diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index fd1cbf786..0f3a07f54 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1571,6 +1571,9 @@ + + + diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties b/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties index 79f3dcb1a..84b0669f5 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties @@ -67,3 +67,18 @@ batch_receive.receive_time_note=Receive-time Note batch_receive.cn_for_lib=Do you want to use this call number at %1$s?\nIt doesn't exist there, and it will have to be created. batch_receive.missing_units=You have not provided barcodes and call numbers for all of the selected items. Choose OK to receive those items anyway, or choose Cancel to supply the missing information. batch_receive.missing_cn=You cannot assign a barcode without selecting a call number. Please correct the non-conforming units. +pattern_wizard.enumeration.a=First level +pattern_wizard.enumeration.b=Second level +pattern_wizard.enumeration.c=Third level +pattern_wizard.enumeration.d=Fourth level +pattern_wizard.enumeration.e=Fifth level +pattern_wizard.enumeration.f=Sixth level +pattern_wizard.enumeration.g=First alternate +pattern_wizard.enumeration.h=Second alternate +pattern_wizard.chronology.i=First level +pattern_wizard.chronology.j=Second level +pattern_wizard.chronology.k=Third level +pattern_wizard.chronology.l=Fourth level +pattern_wizard.chronology.m=Alternative numbering scheme +pattern_wizard.not_removable_row=You cannot remove this row because it's not at the end of the sequence. Remove later rows first. +pattern_wizard.bad_date_value=That is not a valid day for that month. diff --git a/Open-ILS/xul/staff_client/server/serial/batch_receive.js b/Open-ILS/xul/staff_client/server/serial/batch_receive.js index 3e7ffd3a1..f43995dde 100644 --- a/Open-ILS/xul/staff_client/server/serial/batch_receive.js +++ b/Open-ILS/xul/staff_client/server/serial/batch_receive.js @@ -1,7 +1,6 @@ +/* The code in this file relies on common.js */ + dojo.require("dojo.cookie"); -dojo.require("dojo.date.locale"); -dojo.require("dojo.date.stamp"); -dojo.require("dojo.string"); dojo.require("openils.Util"); dojo.require("openils.User"); dojo.require("openils.CGI"); @@ -9,61 +8,6 @@ dojo.require("openils.PermaCrud"); var batch_receiver; -String.prototype.trim = function() {return this.replace(/^\s*(.+)\s*$/,"$1");} - -/** - * hard_empty() is needed because dojo.empty() doesn't seem to work on - * XUL nodes. This also means that dojo.place() with a position argument of - * "only" doesn't do what it should, but calling hard_empty() on the refnode - * first will do the trick. - */ -function hard_empty(node) { - if (typeof(node) == "string") - node = dojo.byId(node); - - if (node && node.childNodes.length > 0) { - dojo.forEach( - node.childNodes, - function(c) { - if (c) { - if (c.childNodes.length > 0) - dojo.forEach(c.childNodes, hard_empty); - dojo.destroy(c); - } - } - ); - } -} - -function hide(e) { - if (typeof(e) == "string") e = dojo.byId(e); - openils.Util.addCSSClass(e, "hideme"); -} - -function show(e) { - if (typeof(e) == "string") e = dojo.byId(e); - openils.Util.removeCSSClass(e, "hideme"); -} - -function hide_table_cell(e) { - if (typeof(e) == "string") e = dojo.byId(e); - - e.style.display = "none"; - e.style.visibility = "hidden"; -} - -function show_table_cell(e) { - if (typeof(e) == "string") e = dojo.byId(e); - e.style.display = "table-cell"; - e.style.visibility = "visible"; -} - -function busy(on) { - if (typeof(busy._window) == "undefined") - busy._window = dojo.query("window")[0]; - busy._window.style.cursor = on ? "wait" : "auto"; -} - function S(k) { return dojo.byId("serialStrings").getString("batch_receive." + k). replace("\\n", "\n"); @@ -74,15 +18,6 @@ function F(k, args) { getFormattedString("batch_receive." + k, args).replace("\\n", "\n"); } -function T(s) { return document.createTextNode(s); } -function D(s) {return s ? openils.Util.timeStamp(s,{"selector":"date"}) : "";} -function node_by_name(s, ctx) {return dojo.query("[name='"+ s +"']",ctx)[0];} - -function num_sort(a, b) { - [a, b] = [Number(a), Number(b)]; - return a > b ? 1 : (a < b ? -1 : 0); -} - function BatchReceiver() { var self = this; diff --git a/Open-ILS/xul/staff_client/server/serial/batch_receive_overlay.xul b/Open-ILS/xul/staff_client/server/serial/batch_receive_overlay.xul index fe77020a1..adedc30bf 100644 --- a/Open-ILS/xul/staff_client/server/serial/batch_receive_overlay.xul +++ b/Open-ILS/xul/staff_client/server/serial/batch_receive_overlay.xul @@ -6,10 +6,11 @@ xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + + + + +