[open-ils-commits] [GIT] Evergreen ILS branch master updated. 74ddf23e5295de20ea3094cc65d6ce8a78114856

Evergreen Git git at git.evergreen-ils.org
Mon Mar 2 16:32:12 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, master has been updated
       via  74ddf23e5295de20ea3094cc65d6ce8a78114856 (commit)
      from  6c52b6ed021adcf43e9ef7b7152c1245ef263585 (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 74ddf23e5295de20ea3094cc65d6ce8a78114856
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 05ce1c4..dca52a6 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1997,12 +1997,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) {
@@ -2023,6 +2038,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