From 14a1c63d1e83c8b8c39801cd81a2b6239e42f2d9 Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 21 Sep 2010 03:25:05 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17857 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 6c68fcdd9..f4f66e75d 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -2338,16 +2338,17 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) { 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 = (CONS){new_auth.id()}; + 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')); + } } }) ); -- 2.11.0