From a978899f2ade2054eceaac68e6878ed83ddfa0f7 Mon Sep 17 00:00:00 2001 From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 17 Dec 2009 18:41:26 +0000 Subject: [PATCH] bill Full Details and Show Last Few Circs uses the old item details pane. This cleans up that pane a bit (list actions and sticky view) and gives it a Show in OPAC button. git-svn-id: svn://svn.open-ils.org/ILS/trunk@15186 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 6 ++--- .../staff_client/chrome/content/main/constants.js | 1 + .../xul/staff_client/server/cat/copy_summary.xul | 28 +++++++++++++--------- Open-ILS/xul/staff_client/server/cat/util.js | 9 +++++-- .../xul/staff_client/server/circ/circ_summary.xul | 2 +- .../xul/staff_client/server/circ/copy_details.xul | 2 +- Open-ILS/xul/staff_client/server/circ/util.js | 4 ++-- Open-ILS/xul/staff_client/server/patron/bill2.js | 2 ++ .../xul/staff_client/server/patron/bill_details.js | 2 +- Open-ILS/xul/staff_client/server/patron/bills.js | 2 ++ Open-ILS/xul/staff_client/server/patron/display.js | 1 + 11 files changed, 38 insertions(+), 21 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 4a53bb807b..4912923d93 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2310,9 +2310,9 @@ <!ENTITY staff.cat.copy_summary.age_protect.label "Age Protect:"> <!ENTITY staff.cat.copy_summary.total_circs.label "Total Circulations:"> <!ENTITY staff.cat.copy_summary.alternate_view.label "Alternate View"> -<!ENTITY staff.cat.copy_summary.save_columns.label "Save Columns"> -<!ENTITY staff.cat.copy_summary.sel_clip.label "Copy to Clipboard"> -<!ENTITY staff.cat.copy_summary.print_export.label "Print Export"> +<!ENTITY staff.cat.copy_summary.alternate_view.accesskey ""> +<!ENTITY staff.cat.copy_summary.show_in_opac.label "Show in Catalog"> +<!ENTITY staff.cat.copy_summary.show_in_opac.accesskey "S"> <!ENTITY staff.cat.marcedit.options.label "Options"> <!ENTITY staff.cat.marcedit.stackSubfields.label "Stack subfields"> <!ENTITY staff.cat.marcedit.stackSubfields.accesskey "s"> diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index afa8b6275c..010b325691 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -179,6 +179,7 @@ const api = { 'FM_BOOKING_CREATE_BRT_AND_BRSRC' : { 'app' : 'open-ils.booking', 'method' : 'open-ils.booking.create_brt_and_brsrc_from_copies' }, 'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false }, 'FM_BRE_RETRIEVE_VIA_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve.authoritative', 'secure' : false }, + 'FM_BRE_ID_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.bib_id.by_barcode', 'secure' : false }, 'FM_BRE_ID_SEARCH_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.find_by_barcode', 'secure' : false }, 'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.multiclass.query.staff' }, 'FM_BRE_ID_SEARCH_VIA_TCN' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.tcn', 'secure' : false }, diff --git a/Open-ILS/xul/staff_client/server/cat/copy_summary.xul b/Open-ILS/xul/staff_client/server/cat/copy_summary.xul index 78c57e221b..4810959360 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_summary.xul @@ -21,7 +21,7 @@ <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?> <window id="cat_copy_summary_win" - onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }" + onload="try { font_helper(); persist_helper(); my_init(); } catch(E) { alert(E); }" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> @@ -85,7 +85,9 @@ 'map_row_to_columns' : circ.util.std_map_row_to_columns(), } ); - + $('list_actions').appendChild( g.list.render_list_actions() ); + g.list.set_list_actions(); + function acp_callback(req) { try { var copy = req.getResultObject(); @@ -121,6 +123,10 @@ $w('copy_summary_callnumber',cn.label()); } g.list.append({'row':{'my':{'acp':copy,'acn':cn}}}); + g.barcode = copy.barcode(); g.doc_id = cn.record(); + if (g.doc_id > -1) { + $('show_in_opac').hidden = false; + } } catch(E) { g.error.standard_unexpected_error_alert('retrieving volume',E); } @@ -156,7 +162,9 @@ } }); - toggle_deck(); toggle_deck(); /* quick hack */ + if ( $('alternate_view').checked ) { + toggle_deck(); + } } catch(E) { try { g.error.standard_unexpected_error_alert('copy_summary.xul',E); } catch(F) { alert(E + '\n' + F); } @@ -167,12 +175,8 @@ try { if ($('item_deck').selectedIndex == 0) { $('item_deck').selectedIndex = 1; /* change to grid */ - $('save_columns').hidden = true; - $('sel_clip').hidden = true; } else { $('item_deck').selectedIndex = 0; /* change to tree */ - $('save_columns').hidden = false; - $('sel_clip').hidden = false; } } catch(E) { } @@ -233,10 +237,12 @@ </grid> </deck> <hbox> - <button label="&staff.cat.copy_summary.alternate_view.label;" oncommand="toggle_deck()"/> - <button id="save_columns" label="&staff.cat.copy_summary.save_columns.label;" oncommand="try { g.list.save_columns(); } catch(E) { alert(E); }"/> - <button id="sel_clip" label="&staff.cat.copy_summary.sel_clip.label;" oncommand="try { g.list.node.view.selection.selectAll(); g.list.clipboard(); } catch(E) { alert(E); }"/> - <button id="print_export" label="&staff.cat.copy_summary.print_export.label;" oncommand="try { g.list.on_all_fleshed = function() { JSAN.use('util.print'); var p = new util.print(); p.simple( g.list.dump_csv(), { 'content_type' : 'text/plain' } ); setTimeout( function() { g.list.on_all_fleshed = null; }, 0); }; g.list.full_retrieve(); } catch(E) { alert(E); }"/> + <hbox id="list_actions"/> + <button id="show_in_opac" hidden="true" label="&staff.cat.copy_summary.show_in_opac.label;" accesskey="&staff.cat.copy_summary.show_in_opac.accesskey;" + oncommand="JSAN.use('cat.util'); cat.util.show_in_opac([{barcode:g.barcode,doc_id:g.doc_id}]);"/> + <checkbox id="alternate_view" label="&staff.cat.copy_summary.alternate_view.label;" accesskey="&staff.cat.copy_summary.alternate_view.accesskey;" + oils_persist="checked" oils_persist_no_poke="true" + oncommand="toggle_deck()"/> </hbox> </groupbox> diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 20196b4117..a32b9946b0 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -178,13 +178,18 @@ cat.util.spawn_spine_editor = function(selection_list) { cat.util.show_in_opac = function(selection_list) { JSAN.use('util.error'); var error = new util.error(); + JSAN.use('util.network'); var network = new util.network(); var doc_id; var seen = {}; try { for (var i = 0; i < selection_list.length; i++) { doc_id = selection_list[i].doc_id; if (!doc_id) { - alert($("catStrings").getFormattedString('staff.cat.util.show_in_opac.unknown_barcode', [selection_list[i].barcode])); - continue; + var barcode = selection_list[i].barcode; + doc_id = network.simple_request('FM_BRE_ID_VIA_BARCODE',[barcode]); + if (typeof doc_id.ils_event != 'undefined' || doc_id == -1) { + alert($("catStrings").getFormattedString('staff.cat.util.show_in_opac.unknown_barcode', [barcode])); + continue; + } } if (doc_id == -1 ) { continue; /* pre-cat */ diff --git a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul index 64f2e65184..b28d85ab16 100644 --- a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul @@ -69,7 +69,7 @@ var mid = document.createElement('iframe'); mv.appendChild(mid); mid.setAttribute('src',urls.XUL_COPY_SUMMARY); mid.setAttribute('flex','1'); - get_contentWindow(mid).xulG = { 'copy_id' : g.copy.id() }; + get_contentWindow(mid).xulG = { 'copy_id' : g.copy.id(), 'new_tab' : xulG.new_tab, 'url_prefix' : xulG.url_prefix }; show_circs(); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_details.xul b/Open-ILS/xul/staff_client/server/circ/copy_details.xul index 662f139ecb..911dd05ea5 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_details.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_details.xul @@ -94,7 +94,7 @@ var item_summary = document.createElement('iframe'); ib.appendChild(item_summary); item_summary.setAttribute('src',urls.XUL_COPY_SUMMARY); item_summary.setAttribute('flex','1'); - get_contentWindow(item_summary).xulG = { 'copy' : g.copy, 'callnumber' : g.callnumber }; + get_contentWindow(item_summary).xulG = { 'copy' : g.copy, 'callnumber' : g.callnumber, 'new_tab' : xulG.new_tab, 'url_prefix' : xulG.url_prefix }; $('r_last').disabled = true; if (g.circ) { diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 341a1f3a48..4efd066251 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -65,7 +65,7 @@ circ.util.show_copy_details = function(copy_id) { try { var url = xulG.url_prefix( urls.XUL_COPY_DETAILS ); // + '?copy_id=' + copy_id; - var my_xulG = obj.win.open( url, 'show_copy_details', 'chrome,resizable,modal', { 'copy_id' : copy_id } ); + var my_xulG = obj.win.open( url, 'show_copy_details', 'chrome,resizable,modal', { 'copy_id' : copy_id, 'new_tab' : xulG.new_tab, 'url_prefix' : xulG.url_prefix } ); if (typeof my_xulG.retrieve_these_patrons == 'undefined') return; var patrons = my_xulG.retrieve_these_patrons; @@ -137,7 +137,7 @@ circ.util.show_last_few_circs = function(selection_list) { try { if (typeof selection_list[i].copy_id == 'undefined' || selection_list[i].copy_id == null) continue; var url = xulG.url_prefix( urls.XUL_CIRC_SUMMARY ); // + '?copy_id=' + selection_list[i].copy_id + '&count=' + count; - var my_xulG = obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal', { 'copy_id' : selection_list[i].copy_id } ); + var my_xulG = obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal', { 'copy_id' : selection_list[i].copy_id, 'new_tab' : xulG.new_tab, 'url_prefix': xulG.url_prefix } ); if (typeof my_xulG.retrieve_these_patrons == 'undefined') continue; var patrons = my_xulG.retrieve_these_patrons; diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 9d6e0a724f..b572db6f10 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -595,6 +595,8 @@ function handle_details() { refresh(); if (typeof window.xulG == 'object' && typeof window.xulG.refresh == 'function') window.xulG.refresh(); }, + 'new_tab' : xulG.new_tab, + 'url_prefix' : xulG.url_prefix } ); } diff --git a/Open-ILS/xul/staff_client/server/patron/bill_details.js b/Open-ILS/xul/staff_client/server/patron/bill_details.js index 1b5bca24c8..cd3ec87ec5 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_details.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_details.js @@ -91,7 +91,7 @@ function retrieve_circ() { var copy_summary = document.createElement('iframe'); csb.appendChild(copy_summary); copy_summary.setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + r_circ.target_copy()); copy_summary.setAttribute('flex','1'); - get_contentWindow(copy_summary).xulG = { 'copy_id' : r_circ.target_copy() }; + get_contentWindow(copy_summary).xulG = { 'copy_id' : r_circ.target_copy(), 'new_tab' : xulG.new_tab, 'url_prefix' : xulG.url_prefix }; g.network.simple_request( 'MODS_SLIM_RECORD_RETRIEVE_VIA_COPY.authoritative', diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js index 71f9e6f564..8d1ac8a393 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills.js +++ b/Open-ILS/xul/staff_client/server/patron/bills.js @@ -958,6 +958,8 @@ patron.bills.prototype = { 'patron_id' : obj.patron_id, 'mbts_id' : my.mobts.id(), 'refresh' : function() { obj.refresh(); }, + 'new_tab' : xulG.new_tab, + 'url_prefix' : xulG.url_prefix } ); }, diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index f457f4904d..ee137af67c 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -426,6 +426,7 @@ patron.display.prototype = { 'display_window' : window, 'patron_id' : obj.patron.id(), 'url_prefix' : xulG.url_prefix, + 'new_tab' : xulG.new_tab, 'on_money_change' : function(b) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); obj.summary_window.refresh(); -- 2.11.0