X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch.html;h=730a51aa3dd15522f4f9a664e4855a875e54d5d9;hb=2b199169bd62b8582eedb872b4e76bee48899e81;hp=476b5095eb4e5e263f03a223417af407c6fd7e30;hpb=95144265eeb3ecd13b16708dbdd75dd3701f92ad;p=freeside.git diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 476b5095e..730a51aa3 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -16,7 +16,7 @@ Example: # (deprecated, will be singularlized # simplisticly) - #literal SQL query string (deprecated?) or qsearch hashref or arrayref + #literal SQL query string (corner cases only) or qsearch hashref or arrayref #of qsearch hashrefs for a union of qsearches 'query' => { 'table' => 'tablename', @@ -33,8 +33,8 @@ Example: }, # "select * from tablename"; - - #required unless 'query' is an SQL query string (shouldn't be...) + + #required (now even if 'query' is an SQL query string) 'count_query' => 'SELECT COUNT(*) FROM tablename', ### @@ -119,7 +119,11 @@ Example: #(query needs to be a qsearch hashref and # header & fields need to be defined) - #handling agent virtualization + # Agent Virtualization parameters: + # In this context, only available if your selected table has agentnum. + # You must also include agentnum as a SELECT column in your SQL query, + # or experience non-obvious problems + # 'agent_virt' => 1, # set true if this search should be # agent-virtualized 'agent_null' => 1, # set true to view global records always @@ -131,7 +135,7 @@ Example: 'agent_pos' => 3, # optional position (starting from 0) to # insert an Agent column (query needs to be a # qsearch hashref and header & fields need to - # be defined)cust_pkg_susp.html + # be defined) # sort, link & display properties for fields @@ -218,6 +222,8 @@ my(%opt) = @_; my $curuser = $FS::CurrentUser::CurrentUser; +$m->comp('/elements/handle_uri_query'); + my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/ ? $1 : 'html' ; @@ -383,14 +389,15 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) { #setup some pagination things if we're in html mode my $conf = new FS::Conf; - $confmax = $conf->config('maxsearchrecordsperpage') || 100; - if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) { - $maxrecords = $1; - } else { - $maxrecords ||= $confmax; - } - $opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect'); + unless ($opt{'disable_maxselect'}) { + $confmax = $conf->config('maxsearchrecordsperpage') || 100; + if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) { + $maxrecords = $1; + } else { + $maxrecords ||= $confmax; + } + } $limit = $maxrecords ? "LIMIT $maxrecords" : '';