[open-ils-commits] r19023 - in trunk/Open-ILS/xul/staff_client/server: cat locale/en-US (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Dec 19 23:38:38 EST 2010


Author: dbs
Date: 2010-12-19 23:38:35 -0500 (Sun, 19 Dec 2010)
New Revision: 19023

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
Add an "Apply full authority" option to the MARC editor 

By definition, the only subfields that should be applied from an
authority record to a bibliographic record are the complete set
from the 1XX field of the authority record. So, rather than forcing 
the user to select the correct subfields from the chosen authority
record, give them this handy shortcut to do the right thing.

Also, add copyright / licensing header - hopefully accurate.


Modified: trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-12-20 02:48:32 UTC (rev 19022)
+++ trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-12-20 04:38:35 UTC (rev 19023)
@@ -1,4 +1,23 @@
-// vim: et:sw=4:ts=4:
+/* vim: et:sw=4:ts=4:
+ *
+ * Copyright (C) 2004-2008  Georgia Public Library Service
+ * Copyright (C) 2008-2010  Equinox Software, Inc.
+ * Mike Rylander <miker at esilibrary.com> 
+ *
+ * Copyright (C) 2010 Dan Scott <dan at coffeecode.net>
+ * Copyright (C) 2010 Internationaal Instituut voor Sociale Geschiedenis <info at iisg.nl>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.  
+ *
+ */
 var xmlDeclaration = /^<\?xml version[^>]+?>/;
 
 var serializer = new XMLSerializer();
@@ -1916,9 +1935,18 @@
     return true;
 }
 
-function applyAuthority ( target, ui_sf, e4x_sf ) {
+/* Apply the complete 1xx */
+function applyFullAuthority ( target, ui_sf, e4x_sf ) {
+    var new_vals = dojo.query('*[tag^="1"]', target);
+    return applyAuthority( target, ui_sf, e4x_sf, new_vals );
+}
 
+function applySelectedAuthority ( target, ui_sf, e4x_sf ) {
     var new_vals = target.getElementsByAttribute('checked','true');
+    return applyAuthority( target, ui_sf, e4x_sf, new_vals );
+}
+
+function applyAuthority ( target, ui_sf, e4x_sf, new_vals ) {
     var field = e4x_sf.parent();
 
     for (var i = 0; i < new_vals.length; i++) {
@@ -2488,13 +2516,26 @@
                 createMenuitem(
                     { label : $('catStrings').getString('staff.cat.marcedit.apply_selected.label'),
                       command : function (event) {
-                            applyAuthority(event.target.previousSibling, target, sf);
+                            applySelectedAuthority(event.target.previousSibling, target, sf);
                             return true;
                       }
                     }
                 )
             );
 
+            popup.appendChild( createComplexXULElement( 'menuseparator' ) );
+
+            popup.appendChild(
+                createMenuitem(
+                    { label : $('catStrings').getString('staff.cat.marcedit.apply_full.label'),
+                      command : function (event) {
+                            applyFullAuthority(event.target.previousSibling.previousSibling.previousSibling, target, sf);
+                            return true;
+                      }
+                    }
+                )
+            );
+
             sf_popup.appendChild( submenu );
         });
 

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2010-12-20 02:48:32 UTC (rev 19022)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2010-12-20 04:38:35 UTC (rev 19023)
@@ -241,6 +241,7 @@
 staff.cat.marcedit.replace_007.label=Add/Replace 007
 staff.cat.marcedit.replace_008.label=Add/Replace 008
 staff.cat.marcedit.not_authority_field.label=Not a controlled subfield
+staff.cat.marcedit.apply_full.label=Apply Full Authority (1XX)
 staff.cat.marcedit.apply_selected.label=Apply Selected
 staff.cat.marcedit.no_authority_match.label=No matching authority records found
 staff.cat.marcedit.next_page.label=Next page



More information about the open-ils-commits mailing list