[open-ils-commits] [GIT] Evergreen ILS branch rel_2_2 updated. bc46b75cc56674e264f8005cd160f68ddf3326ea

Evergreen Git git at git.evergreen-ils.org
Thu May 16 12:15:18 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_2 has been updated
       via  bc46b75cc56674e264f8005cd160f68ddf3326ea (commit)
       via  f32375f6d719048329e631c621138db1335f3537 (commit)
      from  815f5e2dfd49019b9962d5a9e28eda3677f8e8dd (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 bc46b75cc56674e264f8005cd160f68ddf3326ea
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>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.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 245037d..adf69e2 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1608,8 +1608,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 f32375f6d719048329e631c621138db1335f3537
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>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 0df3507..245037d 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1618,11 +1618,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 {
@@ -1631,7 +1648,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