[open-ils-commits] r10781 - in trunk/Open-ILS/web: opac/locale/en-US vandelay vandelay/inc

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Oct 7 14:51:50 EDT 2008


Author: erickson
Date: 2008-10-07 14:51:46 -0400 (Tue, 07 Oct 2008)
New Revision: 10781

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:
moved latest test labels into the DTD.  reloading marc-html display after record edit

Modified: trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2008-10-07 14:48:11 UTC (rev 10780)
+++ trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2008-10-07 18:51:46 UTC (rev 10781)
@@ -80,3 +80,5 @@
 <!ENTITY vandelay.view.marc "View MARC">
 <!ENTITY vandelay.xpath.advanced "XPath (advanced)">
 <!ENTITY vandelay.xpath "XPath">
+<!ENTITY vandelay.save "Save Changes">
+<!ENTITY vandelay.record_saved "Record Saved">

Modified: trunk/Open-ILS/web/vandelay/inc/marchtml.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/inc/marchtml.xml	2008-10-07 14:48:11 UTC (rev 10780)
+++ trunk/Open-ILS/web/vandelay/inc/marchtml.xml	2008-10-07 18:51:46 UTC (rev 10781)
@@ -1,5 +1,7 @@
 <!-- MARC as HTML -->
 <h1>&vandelay.marc.record;</h1><br/>
+<span class='hidden' id='vl-marc-edit-save-label'>&vandelay.save;</span>
+<span class='hidden' id='vl-marc-edit-complete-label'>&vandelay.record_saved;</span>
 <div>
     <button id='vl-marc-html-done-button' dojoType='dijit.form.Button'>&#x2196; &vandelay.return;</button>
     <button id='vl-marc-html-edit-button' dojoType='dijit.form.Button'>&vandelay.edit;</button>

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2008-10-07 14:48:11 UTC (rev 10780)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2008-10-07 18:51:46 UTC (rev 10781)
@@ -409,7 +409,8 @@
             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 @@
     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 @@
                     ['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 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 @@
                 var rec = r.recv().content();
                 if(e = openils.Event.parse(rec))
                     return alert(e);
-                vlOpenMarcEditWindow(rec);
+                vlOpenMarcEditWindow(rec, postReloadHTMLHandler);
             }
         }
     );



More information about the open-ils-commits mailing list