From 54aa8d4f741a0664dc89b0193f7dc94635d2f50c Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 12 Jun 2009 02:04:21 +0000 Subject: [PATCH] Fixes the display issue with using a lot of services in the Z39.50 client by summarizing the total results instead of listing them per service. Based on a patch from Warren Layton. Thanks! I've tweaked this so that the per-service summaries still exist, but as a tooltip/mouse-over. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13375 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/z3950.js | 39 ++++++++++++++++------ .../server/locale/en-US/cat.properties | 1 + 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.js b/Open-ILS/xul/staff_client/server/cat/z3950.js index e00fd11ac9..c4c00c2b3d 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.js +++ b/Open-ILS/xul/staff_client/server/cat/z3950.js @@ -535,27 +535,27 @@ cat.z3950.prototype = { obj.controller.view.cmd_z3950_csv_to_clipboard.setAttribute('disabled','false'); obj.controller.view.cmd_z3950_csv_to_printer.setAttribute('disabled','false'); if (typeof results.length == 'undefined') results = [ results ]; + + var total_showing = 0; + var total_count = 0; + var tooltip_msg = ''; + for (var i = 0; i < results.length; i++) { if (results[i].query) { - x = document.createElement('description'); obj.controller.view.result_message.appendChild(x); - x.appendChild( document.createTextNode($("catStrings").getFormattedString('staff.cat.z3950.handle_results.raw_query', [results[i].query]))); + tooltip_msg += $("catStrings").getFormattedString('staff.cat.z3950.handle_results.raw_query', [results[i].query]) + '\n'; } if (results[i].count) { if (results[i].records) { - x = document.createElement('description'); obj.controller.view.result_message.appendChild(x); var showing = obj.search_params.offset + results[i].records.length; - x.appendChild( - document.createTextNode($("catStrings").getFormattedString('staff.cat.z3950.handle_results.showing_results', - [(showing > results[i].count ? results[i].count : showing), results[i].count, results[i].service])) - ); + total_showing += obj.search_params.offset + results[i].records.length; + total_count += results[i].count; + tooltip_msg += $("catStrings").getFormattedString('staff.cat.z3950.handle_results.showing_results', [(showing > results[i].count ? results[i].count : showing), results[i].count, results[i].service]) + '\n'; } if (obj.search_params.offset + obj.search_params.limit <= results[i].count) { obj.controller.view.page_next.disabled = false; } } else { - x = document.createElement('description'); obj.controller.view.result_message.appendChild(x); - x.appendChild( - document.createTextNode($("catStrings").getFormattedString('staff.cat.z3950.handle_results.num_of_results', [(results[i].count ? results[i].count : 0)]))); + tooltip_msg += $("catStrings").getFormattedString('staff.cat.z3950.handle_results.num_of_results', [(results[i].count ? results[i].count : 0)]) + '\n'; } if (results[i].records) { obj.result_set[ ++obj.number_of_result_sets ] = results[i]; @@ -585,6 +585,25 @@ cat.z3950.prototype = { ); } } + if (total_showing) { + x = document.createElement('description'); + x.setAttribute('crop','end'); + x.setAttribute('tooltiptext',tooltip_msg); + obj.controller.view.result_message.appendChild(x); + x.appendChild( + document.createTextNode($("catStrings").getFormattedString('staff.cat.z3950.handle_results.showing_total_results', + [(total_showing > total_count ? total_count : total_showing), total_count])) + ); + } else { + x = document.createElement('description'); + x.setAttribute('crop','end'); + x.setAttribute('tooltiptext',tooltip_msg); + obj.controller.view.result_message.appendChild(x); + x.appendChild( + document.createTextNode($("catStrings").getFormattedString('staff.cat.z3950.handle_results.num_of_results', [(total_count ? total_count : 0)])) + ); + } + } catch(E) { this.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.z3950.handle_results.search_result_error'),E); } diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties index acdbb0df82..f85352694b 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties @@ -411,6 +411,7 @@ staff.cat.z3950.handle_results.null_server_error=Server Error: request returned staff.cat.z3950.handle_results.server_error=Server Error: %1$s : %2$s staff.cat.z3950.handle_results.raw_query=Raw query: %1$s staff.cat.z3950.handle_results.showing_results=Showing %1$s of %2$s for %3$s +staff.cat.z3950.handle_results.showing_total_results=Showing %1$s of %2$s staff.cat.z3950.handle_results.num_of_results=%1$s records found staff.cat.z3950.handle_results.result_error=Error retrieving results. staff.cat.z3950.handle_results.search_result_error=Failure during search result handling. -- 2.11.0