From 36bc484ccd7aa999b9cf586d7db97df6ec8abe06 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 7 Oct 2008 12:48:39 +0000 Subject: [PATCH] only expose the marc editor for queued recs git-svn-id: svn://svn.open-ils.org/ILS/trunk@10776 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/vandelay/vandelay.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index c13a90e327..7ad50b3e31 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -384,23 +384,35 @@ function vlPopulateMatchGrid(grid, data) { grid.update(); } +function showMe(id) { + dojo.style(dojo.byId(id), 'display', 'block'); +} +function hideMe(id) { + dojo.style(dojo.byId(id), 'display', 'none'); +} + 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]; + if(inCat) { + hideMe('vl-marc-html-edit-button'); // don't show marc editor button + dijit.byId('vl-marc-html-edit-button').onClick = function(){} api = ['open-ils.search', 'open-ils.search.biblio.record.html']; if(currentType == 'auth') 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);}; params = [authtoken, recId]; api = ['open-ils.vandelay', 'open-ils.vandelay.queued_bib_record.html']; if(currentType == 'auth') api = ['open-ils.vandelay', 'open-ils.vandelay.queued_authority_record.html']; } + fieldmapper.standardRequest( api, { async: true, -- 2.43.2