[open-ils-commits] r13243 - trunk/Open-ILS/web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 26 23:05:17 EDT 2009
Author: dbs
Date: 2009-05-26 23:05:15 -0400 (Tue, 26 May 2009)
New Revision: 13243
Modified:
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
Fix MFHD edit invocation by using pcrud.retrieve to get the right MFHD record
Make an EcmaScript spec writer happy somewhere by returning null from all of these functions.
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-27 03:00:41 UTC (rev 13242)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-27 03:05:15 UTC (rev 13243)
@@ -181,31 +181,35 @@
}
function OpenMarcEditWindow(pcrud, rec) {
- /*
- 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?
- dojo.require('openils.PermaCrud');
+ /*
+ 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?
+ dojo.require('openils.PermaCrud');
- win.xulG = {
- record : {marc : rec.marc()},
- save : {
- label: 'Save',
- func: function(xmlString) {
- rec.marc(xmlString);
- rec.ischanged(true);
- pcrud.update(rec);
- },
- }
- };
+ win.xulG = {
+ record : {marc : rec.marc()},
+ save : {
+ label: 'Save MFHD',
+ func: function(xmlString) {
+ rec.marc(xmlString);
+ rec.ischanged(true);
+ pcrud.update(rec);
+ },
+ }
+ };
+ return null;
}
function loadMarcEditor(recId) {
var pcrud = new openils.PermaCrud({"authtoken": G.user.session});
- var recs = pcrud.search("sre", {"id": recId, "deleted": false});
- OpenMarcEditWindow(pcrud, recs[0]);
+ var rec = pcrud.retrieve("sre", recId);
+ if (rec) {
+ OpenMarcEditWindow(pcrud, rec);
+ }
+ return null;
}
/*
@@ -217,6 +221,7 @@
if (!holdings) { return null; }
dojo.forEach(holdings, _holdingsDrawMFHD);
+ return null;
}
function _holdingsDrawMFHD(holdings, entryNum) {
@@ -256,11 +261,13 @@
dojo.require('openils.PermaCrud');
dojo.place("<span> - </span><a class='classic_link' href='javascript:loadMarcEditor(" + holdings.id() + ")'> Edit</a>", "mfhdHoldingsCaption", "last");
}
+ return null;
}
function _holdingsDrawMFHDEntry(entryNum, entryName, entry) {
var flatEntry = entry.toString().replace(/,/g, ', ');
dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>" + entryName + "</td><td class='rdetail_item'>" + flatEntry + "</td></tr>", "rdetail_holdings_tbody_" + entryNum, "last");
+ return null;
}
function _rdetailDraw(r) {
More information about the open-ils-commits
mailing list