[open-ils-commits] r17857 - trunk/Open-ILS/xul/staff_client/server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Sep 20 23:25:07 EDT 2010


Author: dbs
Date: 2010-09-20 23:25:05 -0400 (Mon, 20 Sep 2010)
New Revision: 17857

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
Log:
Append the $0 controlling subfield to newly created authorities

Still a work in progress; obviously we need to try and grab a better
institutional code, need to teach the "Create and edit..." option
how to do the same thing, and should augment the "Authority created"
dialog box to tell the user to save the record or lose the changes
they just made.

At some point we need to consider auto-saving records, perhaps immediately
after we provide infinite undo capability to step back through previous
changes.


Modified: trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-09-21 03:06:49 UTC (rev 17856)
+++ trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-09-21 03:25:05 UTC (rev 17857)
@@ -2338,16 +2338,17 @@
                 command : function() { 
                     // Call middle-layer function to create and save the new authority
                     var source_f = summarizeField(sf);
-                    fieldmapper.standardRequest(
+                    var new_auth = fieldmapper.standardRequest(
                         ["open-ils.cat", "open-ils.cat.authority.record.create_from_bib"],
-                        {
-                            "async": true,
-                            "params": [source_f, ses()],
-                            "oncomplete": function() {
-                                alert($('catStrings').getString('staff.cat.marcedit.create_authority_success.label'));
-                            }
-                        }
+                        [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>;
+                        sf.parent().appendChild(id_sf);
+                        var new_sf = marcSubfield(id_sf);
+                        target.parentNode.appendChild(new_sf);
+                        alert($('catStrings').getString('staff.cat.marcedit.create_authority_success.label'));
+                    }
                 }
             })
         );



More information about the open-ils-commits mailing list