[open-ils-commits] r12695 - in trunk/Open-ILS/web: js/ui/default/acq/common templates/default/acq/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 26 15:22:06 EDT 2009
Author: erickson
Date: 2009-03-26 15:22:00 -0400 (Thu, 26 Mar 2009)
New Revision: 12695
Modified:
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
plugged in marc edit functionality for lineitems
Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-03-26 18:35:00 UTC (rev 12694)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-03-26 19:22:00 UTC (rev 12695)
@@ -166,12 +166,16 @@
};
this._drawInfo = function(li) {
+
+ acqLitEditMarc.onClick = function() { self.editMarc(li); }
this.drawMarcHTML(li);
this.infoTbody = dojo.byId('acq-lit-info-tbody');
+
if(!this.infoRow)
this.infoRow = this.infoTbody.removeChild(dojo.byId('acq-lit-info-row'));
while(this.infoTbody.childNodes[0])
this.infoTbody.removeChild(this.infoTbody.childNodes[0]);
+
for(var i = 0; i < li.attributes().length; i++) {
var attr = li.attributes()[i];
var row = this.infoRow.cloneNode(true);
@@ -407,6 +411,37 @@
}
);
}
+
+ this.editMarc = function(li) {
+
+ /* 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?
+
+ var self = this;
+ win.xulG = {
+ record : {marc : li.marc()},
+ save : {
+ label: 'Save Record', // XXX I18N
+ func: function(xmlString) {
+ li.marc(xmlString);
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem.update'],
+ { async: true,
+ params: [openils.User.authtoken, li],
+ oncomplete: function(r) {
+ openils.Util.readResponse(r);
+ win.close();
+ self.drawInfo(li.id())
+ }
+ }
+ );
+ },
+ }
+ };
+ }
}
Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-26 18:35:00 UTC (rev 12694)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-26 19:22:00 UTC (rev 12695)
@@ -78,6 +78,9 @@
</table>
<div style='margin-top:40px;'>
<h3>MARC Record</h3>
+ <div>
+ <div dojoType='dijit.form.Button' jsId='acqLitEditMarc'>Edit MARC Record</div>
+ </div>
<div id='acq-lit-marc-div' style='margin-top:20px;'> </div>
</div>
</div>
More information about the open-ils-commits
mailing list