[open-ils-commits] r13375 - in trunk/Open-ILS/xul/staff_client/server: cat locale/en-US (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 11 22:04:22 EDT 2009
Author: phasefx
Date: 2009-06-11 22:04:21 -0400 (Thu, 11 Jun 2009)
New Revision: 13375
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
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.
Modified: trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2009-06-12 01:16:55 UTC (rev 13374)
+++ trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2009-06-12 02:04:21 UTC (rev 13375)
@@ -535,27 +535,27 @@
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 @@
);
}
}
+ 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);
}
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-06-12 01:16:55 UTC (rev 13374)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-06-12 02:04:21 UTC (rev 13375)
@@ -411,6 +411,7 @@
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.
More information about the open-ils-commits
mailing list