Replace hard-coded '(CONS)' for MARC control number identifier in authority records
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 1 Nov 2010 20:41:14 +0000 (20:41 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 1 Nov 2010 20:41:14 +0000 (20:41 +0000)
We created an actor.org_unit_setting, 'cat.marc_control_number_identifier', for
specifying the preferred MARC control number identifier, but when we create a
new authority record from the MARC editor, the hardcoded value of 'CONS' is being
used.

This teaches the staff client how to pull the appropriate value from the AOUS
when invoking the MARC Editor.

Resolves https://bugs.launchpad.net/evergreen/+bug/669245

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18559 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/server/cat/marcedit.js

index 444b14d..c772ba6 100644 (file)
@@ -121,6 +121,7 @@ function set_marc_edit() {
     var a =    xulG.url_prefix( urls.XUL_MARC_EDIT );
     var b =    {};
     var c =    {
+            'marc_control_number_identifier' : g.data.hash.aous['cat.marc_control_number_identifier'] || 'Set cat.marc_control_number_identifier in Library Settings',
             'record' : { 'url' : '/opac/extras/supercat/retrieve/marcxml/record/' + docid, "id": docid, "rtype": "bre" },
             'fast_add_item' : function(doc_id,cn_label,cp_barcode) {
                 try {
index d6b4cc6..3ee7f8c 100644 (file)
@@ -142,6 +142,7 @@ function my_init() {
             window.xulG = {};
             window.xulG.record = {};
             window.xulG.save = {};
+            window.xulG.marc_control_number_identifier = 'CONS';
 
             window.xulG.save.label = $('catStrings').getString('staff.cat.marcedit.save.label');
             window.xulG.save.func = function (r) { alert(r); }
@@ -2350,7 +2351,7 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) {
                         [source_f, ses()]
                     );
                     if (new_auth && new_auth.id()) {
-                        var id_sf = <subfield code="0" xmlns="http://www.loc.gov/MARC21/slim">(CONS){new_auth.id()}</subfield>;
+                        var id_sf = <subfield code="0" xmlns="http://www.loc.gov/MARC21/slim">({xulG.marc_control_number_identifier}){new_auth.id()}</subfield>;
                         sf.parent().appendChild(id_sf);
                         var new_sf = marcSubfield(id_sf);
                         target.parentNode.appendChild(new_sf);
@@ -2602,7 +2603,7 @@ function loadMarcEditor(pcrud, marcxml, target, sf) {
                         if (!new_rec) {
                             return '';
                         }
-                        var id_sf = <subfield code="0" xmlns="http://www.loc.gov/MARC21/slim">(CONS){new_rec.id()}</subfield>;
+                        var id_sf = <subfield code="0" xmlns="http://www.loc.gov/MARC21/slim">({xulG.marc_control_number_identifier}){new_rec.id()}</subfield>;
                         sf.parent().appendChild(id_sf);
                         var new_sf = marcSubfield(id_sf);
                         target.parentNode.appendChild(new_sf);