mw.sdump('D_CAT','refresh_spawning_browse_list error: ' + js2JSON(E) + '\n');
}
}
+
+function spawn_marc_from_copy_editor() {
+ try {
+ var record_id = user_request(
+ 'open-ils.search',
+ 'open-ils.search.biblio.find_by_barcode',
+ [ cn_list[0].copies()[0].barcode() ]
+ )[0].ids[0];
+ marc_view(app_shell,record_id);
+ } catch(E) {
+ handle_error(E);
+ }
+}
+
<command id="cmd_edit_save" oncommand="
save_edited_copies();
"/>
+ <command id="cmd_edit_close" oncommand="
+ mw.close_tab(app_shell,'main_tabbox');
+ "/>
+ <command id="cmd_view_marc" oncommand="
+ spawn_marc_from_copy_editor();
+ "/>
<command id="cmd_refresh_parent" oncommand="
refresh_spawning_browse_list();
"/>
<vbox id="copy_edit_vbox" flex="1">
<iframe id="copy_edit_frame" flex="1"/>
<hbox id="copy_edit_hbox" flex="0">
+ <button id="copy_edit_close" label="Close Editor" command="cmd_edit_close"/>
+ <button id="copy_edit_marc" label="View MARC" command="cmd_view_marc"/>
<spacer id="copy_edit_spacer" flex="1"/>
<button id="copy_edit_save" label="Save Changes" command="cmd_edit_save"/>
</hbox>
debug("Setting up view marc with record " + record.doc_id());
- var func = function() {
-
- var req = new RemoteRequest(
- "open-ils.search",
- "open-ils.search.biblio.record.html",
- record.doc_id());
-
- req.send(true);
-
- var html = req.getResultObject();
- html = html.replace( /<table/, '<div id="this_div"><input id="copy_btn" type="submit" value="Copy Browser" /><input id="marc_btn" type="submit" value="MARC Editor" /></div><table' );
- dump( pretty_print( html ) );
- var id = record.doc_id();
- var win = new_window("data:text/html," + html);
- setTimeout(
- function() {
- win.document.title = "View MARC";
- win.focus();
- win.document.getElementById('marc_btn').addEventListener(
- 'click',
- function(ev) {
- spawn_marc_editor(
- p.w.app_shell, 'new_tab', 'main_tabbox', {
- 'find_this_id' : record.doc_id()
- }
- ).find_this_id = record.doc_id();
- },
- false
- );
- win.document.getElementById('copy_btn').addEventListener(
- 'click',
- function(ev) {
- spawn_copy_browser(
- p.w.app_shell, 'new_tab', 'main_tabbox', {
- 'find_this_id' : record.doc_id()
- }
- ).find_this_id = record.doc_id();
- },
- false
- );
- }, 0
- );
- }
-
+ var func = function() { marc_view(p.w.app_shell,record.doc_id()); }
return func;
}
}
}
+function marc_view(app_shell,record_id) {
+ try {
+ var html = user_request(
+ "open-ils.search",
+ "open-ils.search.biblio.record.html",
+ [ record_id ]
+ )[0];
+ html = html.replace( /<table/, '<div id="this_div"><input id="copy_btn" type="submit" value="Copy Browser" /><input id="marc_btn" type="submit" value="MARC Editor" /></div><table' );
+ var id = record_id;
+ var win = new_window("data:text/html," + html);
+ setTimeout(
+ function() {
+ win.document.title = "View MARC";
+ win.focus();
+ win.document.getElementById('marc_btn').addEventListener(
+ 'click',
+ function(ev) {
+ spawn_marc_editor(
+ app_shell, 'new_tab', 'main_tabbox', {
+ 'find_this_id' : record_id
+ }
+ ).find_this_id = record_id;
+ },
+ false
+ );
+ win.document.getElementById('copy_btn').addEventListener(
+ 'click',
+ function(ev) {
+ spawn_copy_browser(
+ app_shell, 'new_tab', 'main_tabbox', {
+ 'find_this_id' : record_id
+ }
+ ).find_this_id = record_id;
+ },
+ false
+ );
+ }, 0
+ );
+ } catch(E) {
+ handle_error(E);
+ }
+}
+
function spawn_patron_edit(d,placement,place,passthru_params,clone) {
var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
return spawn_interface(d,placement,place,chrome,getString('patron_editor_interface_label'),passthru_params,clone);