From e26eadb21c86248d6cb7fd0fba875f3eb6a88a0c Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 7 Oct 2008 18:51:46 +0000 Subject: [PATCH 1/1] moved latest test labels into the DTD. reloading marc-html display after record edit git-svn-id: svn://svn.open-ils.org/ILS/trunk@10781 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/vandelay.dtd | 2 ++ Open-ILS/web/vandelay/inc/marchtml.xml | 2 ++ Open-ILS/web/vandelay/vandelay.js | 30 ++++++++++++--------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/vandelay.dtd b/Open-ILS/web/opac/locale/en-US/vandelay.dtd index 754132bb12..dbbb0618e9 100644 --- a/Open-ILS/web/opac/locale/en-US/vandelay.dtd +++ b/Open-ILS/web/opac/locale/en-US/vandelay.dtd @@ -80,3 +80,5 @@ + + diff --git a/Open-ILS/web/vandelay/inc/marchtml.xml b/Open-ILS/web/vandelay/inc/marchtml.xml index d17d983839..7a08d75991 100644 --- a/Open-ILS/web/vandelay/inc/marchtml.xml +++ b/Open-ILS/web/vandelay/inc/marchtml.xml @@ -1,5 +1,7 @@

&vandelay.marc.record;


+ +
diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index 5ea06559b7..2a0c06fd0c 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -409,7 +409,8 @@ function vlLoadMARCHtml(recId, inCat, oncomplete) { api = ['open-ils.search', 'open-ils.search.authority.to_html']; } else { showMe('vl-marc-html-edit-button'); // plug in the marc editor button - dijit.byId('vl-marc-html-edit-button').onClick = function() {vlLoadMarcEditor(currentType, recId);}; + dijit.byId('vl-marc-html-edit-button').onClick = + function() {vlLoadMarcEditor(currentType, recId, oncomplete);}; params = [authtoken, recId]; api = ['open-ils.vandelay', 'open-ils.vandelay.queued_bib_record.html']; if(currentType == 'auth') @@ -780,17 +781,28 @@ function vlFetchQueueFromForm() { retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords); } -function vlOpenMarcEditWindow(rec) { +function vlOpenMarcEditWindow(rec, postReloadHTMLHandler) { /* To run in Firefox directly, must set signed.applets.codebase_principal_support to true in about:config */ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); win = window.open('/xul/server/cat/marcedit.xul'); // XXX version? + + function onsave(r) { + // after the record is saved, reload the HTML display + var stat = r.recv().content(); + if(e = openils.Event.parse(stat)) + return alert(e); + alert(dojo.byId('vl-marc-edit-complete-label').innerHTML); + win.close(); + vlLoadMARCHtml(rec.id(), false, postReloadHTMLHandler); + } + win.xulG = { record : {marc : rec.marc()}, save : { - label: 'Save', // XXX + label: dojo.byId('vl-marc-edit-save-label').innerHTML, func: function(xmlString) { var method = 'open-ils.permacrud.update.' + rec.classname; rec.marc(xmlString); @@ -798,13 +810,7 @@ function vlOpenMarcEditWindow(rec) { ['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 - } + oncomplete: onsave } ); }, @@ -812,7 +818,7 @@ function vlOpenMarcEditWindow(rec) { }; } -function vlLoadMarcEditor(type, recId) { +function vlLoadMarcEditor(type, recId, postReloadHTMLHandler) { var method = 'open-ils.permacrud.search.vqbr'; if(currentType != 'bib') method = method.replace(/vqbr/,'vqar'); @@ -825,7 +831,7 @@ function vlLoadMarcEditor(type, recId) { var rec = r.recv().content(); if(e = openils.Event.parse(rec)) return alert(e); - vlOpenMarcEditWindow(rec); + vlOpenMarcEditWindow(rec, postReloadHTMLHandler); } } ); -- 2.43.2