[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. 70a7f1cd22bba776b99b208ac543d8f703e4e6af
Evergreen Git
git at git.evergreen-ils.org
Thu May 16 11:02:47 EDT 2013
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_4 has been updated
via 70a7f1cd22bba776b99b208ac543d8f703e4e6af (commit)
via 7a3f95cb06f272e8ec0b8e0aeef645a9d516735e (commit)
from 06fd286ef8d300ca4ab1cea6847fdc8027836b8f (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 70a7f1cd22bba776b99b208ac543d8f703e4e6af
Author: Mike Rylander <mrylander at gmail.com>
Date: Fri Apr 19 16:14:13 2013 -0400
Correct subfield format for authority lookup
The Authority Control Set code expects the format of subfields
that it will be used to build a MARC.Field object to be of the
form: [[code,value],...] This commit makes that true.
Additionally, dojo.filter over a list of lists can cause the
nested array set to be flattened. So, instead, we loop directly.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js b/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js
index c6c6c00..adb9086 100644
--- a/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js
+++ b/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js
@@ -289,17 +289,22 @@ if(!dojo._hasResource["openils.AuthorityControlSet"]) {
var b_field = this.bibFieldByTag(field.tag);
if (b_field) { // construct an marc authority record
- af = b_field.authority_field();
+ var af = b_field.authority_field();
+
+ var sflist = [];
+ for (var i = 0; i < field.subfields.length; i++) {
+ if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
+ sflist.push(field.subfields[i]);
+ }
+ }
+
var m = new MARC.Record ({rtype:'AUT'});
m.appendFields(
new MARC.Field ({
tag : af.tag(),
ind1: field.ind1,
ind2: field.ind2,
- subfields: [dojo.filter(
- field.subfields,
- function (sf) { return (af.sf_list().indexOf(sf[0]) > -1) }
- )]
+ subfields: sflist
})
);
diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index b3eb53a..614061f 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1606,8 +1606,7 @@ function validateAuthority (button) {
var sf_list = [];
for (var j = 0; j < subfields.length; j++) {
var sf = subfields[j];
- sf_list.push( sf.childNodes[1].value );
- sf_list.push( sf.childNodes[2].value );
+ sf_list.push( [ sf.childNodes[1].value, sf.childNodes[2].value ] );
}
var matches = acs.findMatchingAuthorities(
commit 7a3f95cb06f272e8ec0b8e0aeef645a9d516735e
Author: Bill Erickson <berick at esilibrary.com>
Date: Thu May 16 09:11:50 2013 -0400
Repair faulty MARC editor authority validation
Repair how the JS inspects the results of
open-ils.search.authority.simple_heading.from_xml.batch.atomic, which is
used to look up matches for authority validation. It returns a more
complex structure in the brave new world of authority control sets.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 1fbf544..b3eb53a 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1616,11 +1616,28 @@ function validateAuthority (button) {
'subfields' : sf_list
})
);
+
+ // matches = [ { "$csetId" : [ ... ] } ]
+
+ var found = false;
+ if (matches[0]) { // probably set
+ for (var cset in matches[0]) {
+ var arr = matches[0][cset];
+ if (arr.length) {
+ // protect against errant empty string values
+ if (arr.length == 1 && arr[0] == '')
+ continue;
+ found = true;
+ break;
+ }
+ }
+ }
+
// XXX If adt, etc should be validated separately from vxz, etc then move this up into the above for loop
for (var j = 0; j < subfields.length; j++) {
var sf = subfields[j];
- if (!matches.length) {
+ if (!found) {
dojo.removeClass(sf.childNodes[2], 'marcValidated');
dojo.addClass(sf.childNodes[2], 'marcUnvalidated');
} else {
@@ -1629,7 +1646,7 @@ function validateAuthority (button) {
}
}
- if (matches.length) done = true;
+ if (found) done = true;
});
}
-----------------------------------------------------------------------
Summary of changes:
.../web/js/dojo/openils/AuthorityControlSet.js | 15 ++++++++----
Open-ILS/xul/staff_client/server/cat/marcedit.js | 24 ++++++++++++++++---
2 files changed, 30 insertions(+), 9 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list