From: dbs Date: Tue, 21 Sep 2010 03:25:05 +0000 (+0000) Subject: Append the $0 controlling subfield to newly created authorities X-Git-Tag: kcls-grey-screen-prod1~837 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=14a1c63d1e83c8b8c39801cd81a2b6239e42f2d9;p=evergreen%2Fequinox.git 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 --- diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 6c68fcdd92..f4f66e75dc 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')); + } } }) );