<field name="incomplete" oils_persist:virtual="true" />
</fields>
</class>
- <class id="sre" controller="open-ils.cstore" oils_obj:fieldmapper="serial::record_entry" oils_persist:tablename="serial.record_entry" reporter:label="Record Entry">
+ <class id="sre" controller="open-ils.pcrud open-ils.cstore" oils_obj:fieldmapper="serial::record_entry" oils_persist:tablename="serial.record_entry" reporter:label="Serial Record Entry">
<fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
<field name="active" reporter:datatype="bool"/>
<field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
<link field="editor" reltype="has_a" key="id" map="" class="au"/>
<link field="creator" reltype="has_a" key="id" map="" class="au"/>
</links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="CREATE_MFHD_RECORD" global_required="true"/>
+ <retrieve/>
+ <update permission="UPDATE_MFHD_RECORD" global_required="true"/>
+ <delete permission="DELETE_MFHD_RECORD" global_required="true"/>
+ </actions>
+ </permacrud>
</class>
- <class id="sfr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::full_rec" oils_persist:tablename="serial.full_rec" reporter:label="Full Record">
+ <class id="sfr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::full_rec" oils_persist:tablename="serial.full_rec" reporter:label="Serial Full Record">
<fields oils_persist:primary="id" oils_persist:sequence="serial.full_rec_id_seq">
<field name="id" reporter:datatype="id" />
<field name="ind1" />
hideMe(G.ui.rdetail.cp_info_none);
}
+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');
+
+ win.xulG = {
+ record : {marc : rec.marc()},
+ save : {
+ label: 'Save',
+ func: function(xmlString) {
+ rec.marc(xmlString);
+ rec.ischanged(true);
+ pcrud.update(rec);
+ },
+ }
+ };
+}
+
+function loadMarcEditor(recId) {
+ var pcrud = new openils.PermaCrud({"authtoken": G.user.session});
+ var recs = pcrud.search("sre", {"record": recId});
+ OpenMarcEditWindow(pcrud, recs[0]);
+}
+
/*
* This function could be written much more intelligently
* Limited brain power means that I'm brute-forcing it for now
return null;
}
- dojo.place("<table><caption class='rdetail_header color_1'>Holdings summary</caption><tbody id='rdetail_holdings_tbody'></tbody></table>", "rdetail_details_table", "after");
+ dojo.place("<table><caption id='mfhdHoldingsCaption' class='rdetail_header color_1'>Holdings summary</caption><tbody id='rdetail_holdings_tbody'></tbody></table>", "rdetail_details_table", "after");
if (hh.length > 0) {
dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>Holdings</td><td class='rdetail_item'>" + hh + "</td></tr>", "rdetail_holdings_tbody", "last");
}
if (hinc.length > 0) {
dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>Incomplete</td><td class='rdetail_item'>" + hinc + "</td></tr>", "rdetail_holdings_tbody", "last");
}
+ if (isXUL()) {
+ dojo.require('openils.Event');
+ dojo.require('openils.PermaCrud');
+ dojo.place("<span> - </span><a class='classic_link' href='javascript:loadMarcEditor(" + getRid() + ")'> Edit</a>", "mfhdHoldingsCaption", "last");
+ }
}
function _rdetailDraw(r) {