File Coverage

lib/CGI/OptimalQuery/ShowColumns.pm
Criterion Covered Total %
statement 12 25 48.0
branch 0 4 0.0
condition 0 6 0.0
subroutine 4 6 66.6
pod 0 2 0.0
total 16 43 37.2


line stmt bran cond sub pod time code
1             package CGI::OptimalQuery::ShowColumns;
2              
3 1     1   1129 use strict;
  1         2  
  1         22  
4 1     1   4 use warnings;
  1         1  
  1         22  
5 1     1   3 no warnings qw( uninitialized );
  1         2  
  1         21  
6 1     1   4 use base 'CGI::OptimalQuery::Base';
  1         1  
  1         228  
7              
8 0     0 0   sub escapeHTML { CGI::OptimalQuery::Base::escapeHTML(@_) }
9              
10             sub output {
11 0     0 0   my $o = shift;
12 0           my $buf = CGI::header('text/html').
13             "
14            
15            
16            
17            

select fields to add ..

";
18 0           my $s = $$o{schema}{select};
19 0           my @c = sort { $$s{$a}[2] cmp $$s{$b}[2] } keys %$s;
  0            
20 0           foreach my $colAlias (@c) {
21 0           my $label = $$s{$colAlias}[2];
22 0           my $colOpts = $$s{$colAlias}[3];
23             $buf .= '
24             .escapeHTML($label).''
25 0 0 0       unless $label eq '' || $$colOpts{disable_select} || $$colOpts{is_hidden};
      0        
26             }
27             $buf .= "
28            

29            
30            
31            
32 0 0        
33            
34            
35            

36            
37            
38            
39            
40             ";
41 0           $$o{output_handler}->($buf);
42 0           return undef;
43             }
44              
45             1;