X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch.html;h=b70b82db29d9d9df24b47e76db7696d6b885e6a5;hb=f7c686b2da39bc975b6a197b2879aa7a6fa4fa10;hp=d44b454653267f1eeeab1242f85e22b2968466ab;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index d44b45465..b70b82db2 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -307,9 +307,11 @@ if ( $opt{'disableable'} ) { $opt{'query'}{'hashref'}{'disabled'} = ''; $opt{'query'}{'extra_sql'} =~ s/^\s*WHERE/ AND/i; + my $table = $opt{'query'}{'table'}; + $opt{'count_query'} .= ( $opt{'count_query'} =~ /WHERE/i ? ' AND ' : ' WHERE ' ). - "( disabled = '' OR disabled IS NULL )"; + "( $table.disabled = '' OR $table.disabled IS NULL )"; } elsif ( $opt{'disabled_statuspos'} || $opt{'disabled_statuspos'} eq '0' ) { #add status column @@ -360,12 +362,6 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) { s/^\s*SELECT\s*(.*?)\s+FROM\s/SELECT COUNT(*) FROM /i; #silly vim:/ } - if ( $opt{disableable} && ! $cgi->param('showdisabled') ) { - $opt{count_query} .= - ( ( $opt{count_query} =~ /WHERE/i ) ? ' AND ' : ' WHERE ' ). - "( disabled = '' OR disabled IS NULL )"; - } - unless ( $type eq 'html-print' ) { #setup some pagination things if we're in html mode @@ -453,4 +449,6 @@ if ( ref($opt{query}) ) { $header ||= $sth->{NAME}; } +push @$rows, $opt{'footer_data'} if $opt{'footer_data'}; +