[open-ils-commits] [GIT] Evergreen ILS branch rel_2_6 updated. c3f01cbe10d8fba01a061e4f1c2ec2b240f787c6

Evergreen Git git at git.evergreen-ils.org
Mon Mar 2 16:33:48 EST 2015


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_6 has been updated
       via  c3f01cbe10d8fba01a061e4f1c2ec2b240f787c6 (commit)
      from  c0903852267a70414ecdc69a56caf20cf076df56 (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 c3f01cbe10d8fba01a061e4f1c2ec2b240f787c6
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Mar 4 11:31:13 2014 -0500

    LP#1287791: Restrict authority browse to controlled subfields
    
    Back in bug 1175308 I added some logic that improves the behavior
    of the MARC editor's right-click authority popup. Now we need to
    go a little farther and adjust that logic to be more careful about
    which subfields it uses to browse for authority records. Specifically,
    it should only use controlled subfields.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 3455b41..a8eeb10 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1967,12 +1967,27 @@ function searchAuthority (term, tag, sf, limit) {
 function browseAuthority (sf_popup, menu_id, target, sf, limit, page) {
     dojo.require('dojox.xml.parser');
 
+    var target_tag = sf.parent(). at tag.toString();
+
+    var found_acs = [];
+    dojo.forEach( acs.controlSetList(), function (acs_id) {
+        if (acs.controlSet(acs_id).control_map[target_tag]) found_acs.push(acs_id);
+    });
+
+    var cmap;
+    if (!found_acs.length) {
+        target.setAttribute('context', 'clipboard');
+        return false;
+    } else {
+        cmap = acs.controlSet(found_acs[0]).control_map;
+    }
+
     // map tag + subfield to the appropriate authority browse axis:
     // currently authority.author, authority.subject, authority.title, authority.topic
     // based on mappings in OpenILS::Application::SuperCat, though Authority Control
     // Sets will change that
 
-    var axis_list = acs.bibFieldBrowseAxes( sf.parent(). at tag.toString() );
+    var axis_list = acs.bibFieldBrowseAxes( target_tag );
 
     // No matching tag means no authorities to search - shortcut
     if (axis_list.length == 0) {
@@ -1993,6 +2008,9 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) {
     var sf_string = '';
     var sf_list = sf.parent().subfield;
     for ( var i in sf_list) {
+        if (!cmap[target_tag][sf_list[i]. at code.toString()]) {
+            continue; // This is not a controlled subfield, such as $0
+        }
         sf_string += sf_list[i].toString() + ' ';
         if (sf_list[i] === sf) break;
     }

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/xul/staff_client/server/cat/marcedit.js |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list