From: erickson Date: Mon, 6 Oct 2008 21:44:57 +0000 (+0000) Subject: added a marc-edit button to the marc-html view interface. launches marc editor tab... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=620ee87ee74bb8724a16fe603afeb71be6e1aa1f;p=Evergreen.git added a marc-edit button to the marc-html view interface. launches marc editor tab for editing queued bib/auth records. closes tab on save. still some TODOs, but basically works git-svn-id: svn://svn.open-ils.org/ILS/trunk@10767 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/vandelay.dtd b/Open-ILS/web/opac/locale/en-US/vandelay.dtd index 50e25c7671..754132bb12 100644 --- a/Open-ILS/web/opac/locale/en-US/vandelay.dtd +++ b/Open-ILS/web/opac/locale/en-US/vandelay.dtd @@ -7,6 +7,7 @@ + diff --git a/Open-ILS/web/vandelay/inc/marchtml.xml b/Open-ILS/web/vandelay/inc/marchtml.xml index af70ba2785..d17d983839 100644 --- a/Open-ILS/web/vandelay/inc/marchtml.xml +++ b/Open-ILS/web/vandelay/inc/marchtml.xml @@ -2,6 +2,7 @@

&vandelay.marc.record;


+
diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index 80c23ce41a..bcfeb0c522 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -387,6 +387,7 @@ function vlPopulateMatchGrid(grid, data) { function vlLoadMARCHtml(recId, inCat, oncomplete) { dijit.byId('vl-marc-html-done-button').onClick = oncomplete; + dijit.byId('vl-marc-html-edit-button').onClick = function() {vlLoadMarcEditor(currentType, recId);}; displayGlobalDiv('vl-generic-progress'); var api; var params = [recId, 1]; @@ -753,6 +754,52 @@ function vlFetchQueueFromForm() { retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords); } +function vlOpenMarcEditWindow(rec) { + win = window.open('/xul/server/cat/marcedit.xul'); // XXX version? + win.xulG = { + record : {marc : rec.marc()}, + save : { + label: 'Save', // XXX + func: function(xmlString) { + var method = 'open-ils.permacrud.update.' + rec.classname; + rec.marc(xmlString); + fieldmapper.standardRequest( + ['open-ils.permacrud', method], + { async: true, + params: [authtoken, rec], + oncomplete: function(r) { + if(e = openils.Event.parse(rec)) + return alert(e); + alert('Record Updated'); // XXX + win.close(); + // XXX reload marc html view with updates + } + } + ); + }, + } + }; +} + +function vlLoadMarcEditor(type, recId) { + var method = 'open-ils.permacrud.search.vqbr'; + if(currentType != 'bib') + method = method.replace(/vqbr/,'vqar'); + + fieldmapper.standardRequest( + ['open-ils.permacrud', method], + { async: true, + params: [authtoken, {id : recId}], + oncomplete: function(r) { + var rec = r.recv().content(); + if(e = openils.Event.parse(rec)) + return alert(e); + vlOpenMarcEditWindow(rec); + } + } + ); +} + //------------------------------------------------------------