From e4cc70919c928b92807ce83ade1b1c87f460cd11 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 27 Mar 2010 21:17:17 -0400 Subject: cgi sql search form: comparison bug fix; clearer information when results exceed match limit set v2 and ino on limit set backported to v1 --- lib/sisu/v1/cgi_sql_common.rb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v1/cgi_sql_common.rb') diff --git a/lib/sisu/v1/cgi_sql_common.rb b/lib/sisu/v1/cgi_sql_common.rb index 9900ff43..5b2ef9b2 100644 --- a/lib/sisu/v1/cgi_sql_common.rb +++ b/lib/sisu/v1/cgi_sql_common.rb @@ -285,8 +285,8 @@ module SiSU_CGI_sql @date_available=q['dta'] if q['dta']=~/\S/ @date_valid=q['dtv'] if q['dtv']=~/\S/ @filename=if q['doc'] and q['search'] !~/search db/; q['doc'] - elsif q['fns']=~/\S/; q['fns']ยท - end + elsif q['fns']=~/\S/; q['fns'] + end @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 @@offset=q['off'] if q['off']=~/\d+/ # 0 end @@ -448,7 +448,9 @@ module SiSU_CGI_sql @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s end def previous - @offset_previous >= 0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '' + @offset_previous >= 0 \ + ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \ + : '' end def start @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s @@ -877,14 +879,15 @@ module SiSU_CGI_sql end @counters_txt=if @counter_txt_doc > 0 if checked_stats =~/\S/ - @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i - over='over' + @@lt_t=if @counter_txt_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{
Found in the main body of #{@counter_txt_doc} documents, and at #{over} #{@counter_txt_ocn} locations within.
} + %{
Found in the main body of #{over_this_number} #{@counter_txt_doc} documents, and at #{over_limit} #{@counter_txt_ocn} locations within.
} else '' end else '' @@ -930,14 +933,15 @@ module SiSU_CGI_sql end @counters_endn=if @counter_endn_doc > 0 if checked_stats =~/\S/ - @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i - over='over' + @@lt_e=if @counter_endn_ocn==dbi_statement.sql_limit.to_i + over_limit='over the limit set of' + over_this_number='more than' true else - over='' + over_limit,over_this_number='','' false end - %{Found in the endnotes of #{@counter_endn_doc} documents, and at #{over} #{@counter_endn_ocn} locations within.
} + %{Found in the endnotes of #{over_this_number} #{@counter_endn_doc} documents, and at #{over_limit} #{@counter_endn_ocn} locations within.
} else '' end end -- cgit v1.2.3