[open-ils-commits] r10767 - in trunk/Open-ILS/web:
opac/locale/en-US vandelay vandelay/inc
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Oct 6 17:45:02 EDT 2008
Author: erickson
Date: 2008-10-06 17:44:57 -0400 (Mon, 06 Oct 2008)
New Revision: 10767
Modified:
trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
trunk/Open-ILS/web/vandelay/inc/marchtml.xml
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
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
Modified: trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd 2008-10-06 21:42:22 UTC (rev 10766)
+++ trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd 2008-10-06 21:44:57 UTC (rev 10767)
@@ -7,6 +7,7 @@
<!ENTITY vandelay.bib.attrs "Bibliographic attributes">
<!ENTITY vandelay.bib.records "Bibliographic Records">
<!ENTITY vandelay.cancel "Cancel">
+<!ENTITY vandelay.edit "Edit">
<!ENTITY vandelay.code "Code">
<!ENTITY vandelay.column "Column">
<!ENTITY vandelay.create.attr.def "Create Attribute Definition">
Modified: trunk/Open-ILS/web/vandelay/inc/marchtml.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/inc/marchtml.xml 2008-10-06 21:42:22 UTC (rev 10766)
+++ trunk/Open-ILS/web/vandelay/inc/marchtml.xml 2008-10-06 21:44:57 UTC (rev 10767)
@@ -2,6 +2,7 @@
<h1>&vandelay.marc.record;</h1><br/>
<div>
<button id='vl-marc-html-done-button' dojoType='dijit.form.Button'>↖ &vandelay.return;</button>
+ <button id='vl-marc-html-edit-button' dojoType='dijit.form.Button'>&vandelay.edit;</button>
</div>
<div>
<style>#vl-marc-record-html td {padding:0px;}</style>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2008-10-06 21:42:22 UTC (rev 10766)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2008-10-06 21:44:57 UTC (rev 10767)
@@ -387,6 +387,7 @@
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,8 +754,54 @@
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);
+ }
+ }
+ );
+}
+
+
+
//------------------------------------------------------------
// attribute editors
More information about the open-ils-commits
mailing list