From: Dan Pearl Date: Fri, 5 Feb 2016 20:34:31 +0000 (-0500) Subject: LC1352542 - Printing LC Spine Labels format problem X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=248969f079f1abf396e27d810b2e1d09b47fb6aa;p=working%2FEvergreen.git LC1352542 - Printing LC Spine Labels format problem A reference was mis-coded in the javascript, so the special case code written for LC handling was never executed. In addition, the pattern matching code that was now revealed produced incorrect results. Signed-off-by: Dan Pearl --- diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.js b/Open-ILS/xul/staff_client/server/cat/spine_labels.js index 7822c90e46..f09408be3f 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.js +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.js @@ -170,23 +170,18 @@ callnum = String(volume.label()); } /* handle spine labels differently if using LC */ - if (volume.label_class() == 3) { - /* for LC, split between classification subclass letters and numbers */ - var lc_class_re = /^([A-Z]{1,3})([0-9]+.*?)$/i; - var lc_class_match = lc_class_re.exec(callnum); - if (lc_class_match && lc_class_match.length > 1) { - callnum = lc_class_match[1] + ' ' + lc_class_match[2]; + var lab_class = volume.label_class(); + if (lab_class.id() == 3) { + /* Establish a pattern where every return value should be isolated on its own line + on the spine label: subclass letters, subclass numbers, + cutter numbers, trailing stuff (date) */ + var patt1 = /^([A-Z]{1,3})\s*(\d+(?:\.\d+)?)\s*(\.[A-Z]\d*)([A-Z]\d*)?(.*)$/i; + var result = callnum.match(patt1); + if (result) { + callnum = result.slice(1).join(' '); } + /* If result is null, leave callnum alone. Can't parse this malformed call num */ - /* for LC, split between Cutter numbers */ - var lc_cutter_re = /^(.*)(\.[A-Z]{1}[0-9]+.*?)$/ig; - var lc_cutter_match = lc_cutter_re.exec(callnum); - if (lc_cutter_match && lc_cutter_match.length > 1) { - callnum = ''; - for (var i = 1; i < lc_cutter_match.length; i++) { - callnum += lc_cutter_match[i] + ' '; - } - } } /* Only add the prefixes and suffixes once */ diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/spine_label.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/spine_label.adoc new file mode 100644 index 0000000000..b515bab3c3 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Cataloging/spine_label.adoc @@ -0,0 +1,4 @@ +Spine Label Formatting +^^^^^^^^^^^^^^^^^^^^^^ +The spine label formatting for LC-class call numbers did not format correctly. +This has been fixed.