125 |
my $attr_labels = read_config_txt 'labels'; |
my $attr_labels = read_config_txt 'labels'; |
126 |
my $attr_operators = read_config_txt 'operators'; |
my $attr_operators = read_config_txt 'operators'; |
127 |
|
|
128 |
my @attr = @{ $attr_labels->{'-values'} }; |
my @attr = @{ $attr_labels->{'-values'} } if $attr_labels; |
129 |
@attr = keys %{ $stats->{attr} } unless @attr; |
@attr = keys %{ $stats->{attr} } unless @attr; |
130 |
|
|
131 |
|
|
132 |
warn dump( $attr_labels, $attr_operators ); |
warn dump( $attr_labels, $attr_operators ); |
133 |
|
|
134 |
my $only_input; |
my $only_input; |
135 |
|
my $inputs_available = 0; |
136 |
|
|
137 |
foreach ( @{ $db->{input} } ) { |
foreach ( @{ $db->{input} } ) { |
138 |
my $input = $_->{name} || die "no name in ",dump( $_ ); |
my $input = $_->{name} || die "no name in ",dump( $_ ); |
139 |
if ( ! $only_input->{'-labels'}->{$input} ) { |
if ( ! $only_input->{'-labels'}->{$input} ) { |
140 |
push @{ $only_input->{'-values'} }, $input; |
push @{ $only_input->{'-values'} }, $input; |
141 |
$only_input->{'-labels'}->{$input} = $_->{description} || $input; |
$only_input->{'-labels'}->{$input} = $_->{description} || $input; |
142 |
|
$inputs_available++; |
143 |
} |
} |
144 |
} |
} |
145 |
|
|
165 |
qq|<input type=hidden name=current_page value=1 >|, |
qq|<input type=hidden name=current_page value=1 >|, |
166 |
checkbox( -name => 'debug', -default => 0 ), # FIXME hidden? |
checkbox( -name => 'debug', -default => 0 ), # FIXME hidden? |
167 |
qq|<div id=inputs>|, |
qq|<div id=inputs>|, |
168 |
h2( 'Select input' ), |
$inputs_available > 1 ? |
169 |
|
h2( 'Select input' ) . |
170 |
checkbox_group( |
checkbox_group( |
171 |
-name => 'only_input', |
-name => 'only_input', |
172 |
%$only_input, |
%$only_input, |
173 |
-linebreak=> 'true', |
-linebreak=> 'true', |
174 |
), |
) : '', |
175 |
qq|</div>|, |
qq|</div>|, |
176 |
end_form, |
end_form, |
177 |
; |
; |