From 07deed5b4a5f5e915bbfafd4417642fcfd0eeab4 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 16 Sep 2011 12:45:11 -0400 Subject: [PATCH] Add Show In Catalog button to Z39.50 Import. Changes to z3950.xul: Add show_in_catalog command. Add button next to Mark for Overlay button. Changes to z3950.js: Enable/disable Show In Catalog button whenever Mark for Overlay button is enabled/disabled. Add code for show_in_catalog to open the record detail screen in a new tab. Signed-off-by: Jason Stephenson Signed-off-by: Dan Scott --- Open-ILS/xul/staff_client/server/cat/z3950.js | 25 +++++++++++++++++++++++++ Open-ILS/xul/staff_client/server/cat/z3950.xul | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.js b/Open-ILS/xul/staff_client/server/cat/z3950.js index ac3e7122bc..a7da8d73d6 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.js +++ b/Open-ILS/xul/staff_client/server/cat/z3950.js @@ -73,9 +73,11 @@ cat.z3950.prototype = { } if (o.getAttribute('service') == 'native-evergreen-catalog') { $('mark_overlay_btn').disabled = false; + $('show_in_catalog_btn').disabled = false; obj.controller.view.mark_overlay.setAttribute('doc_id',o.getAttribute('doc_id')); } else { $('mark_overlay_btn').disabled = true; + $('show_in_catalog_btn').disabled = true; } return o.getAttribute('retrieve_id'); } @@ -176,6 +178,29 @@ cat.z3950.prototype = { } } ], + 'show_in_catalog' : [ + ['command'], + function() { + try { + var doc_id = obj.controller.view.mark_overlay.getAttribute('doc_id'); + if (doc_id) { + var opac_url = xulG.url_prefix( urls.opac_rdetail ) + doc_id; + var content_params = { + 'session' : ses(), + 'authtime' : ses('authtime'), + 'opac_url' : opac_url, + }; + xulG.new_tab( + xulG.url_prefix(urls.XUL_OPAC_WRAPPER), + {'tab_name': $("catStrings").getString('staff.cat.z3950.replace_tab_with_opac.tab_name')}, + content_params + ); + } + } catch(E) { + alert('Error in z3950.js, show_in_catalog: ' + E); + } + } + ], 'marc_import' : [ ['command'], function() { diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.xul b/Open-ILS/xul/staff_client/server/cat/z3950.xul index 2a30095ebe..32f9a9e2ea 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.xul +++ b/Open-ILS/xul/staff_client/server/cat/z3950.xul @@ -86,6 +86,7 @@ + @@ -187,6 +188,11 @@ disabled="true" label="&staff.cat.z3950.mark_overlay.label;" accesskey="&staff.cat.z3950.mark_overlay.accesskey;"/> +