more form fixes
This commit is contained in:
parent
040d593999
commit
9181a23d73
3 changed files with 9 additions and 2 deletions
|
|
@ -146,9 +146,12 @@ sub toHtml {
|
|||
}
|
||||
my $i=0;
|
||||
my $options = $self->getOptions;
|
||||
$self->session->errorHandler->warn(JSON->new->encode($options));
|
||||
|
||||
foreach my $key (keys %{$options}) {
|
||||
$i++;
|
||||
my $checked = (grep { $_ eq $key } @{ $self->correctValues($self->get('value')) })
|
||||
my @values = $self->getDefaultValue;
|
||||
my $checked = (grep { $_ eq $key } @values)
|
||||
? 1
|
||||
: 0
|
||||
;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,8 @@ sub getOptions {
|
|||
}
|
||||
else {
|
||||
foreach my $line (split "\n", $possibleValues) {
|
||||
if ($line =~ m/(.*)|(.*)/) {
|
||||
$line =~ s/^(.*)\r|\s*$/$1/;
|
||||
if ($line =~ m/(.*)\|(.*)/) {
|
||||
$options{$1} = $2;
|
||||
}
|
||||
else {
|
||||
|
|
@ -208,6 +209,7 @@ sub getValue {
|
|||
@values = @{$value};
|
||||
}
|
||||
else {
|
||||
$value =~ s/\r//g;
|
||||
@values = split "\n", $value;
|
||||
}
|
||||
}
|
||||
|
|
@ -240,6 +242,7 @@ sub getDefaultValue {
|
|||
@values = @{$value};
|
||||
}
|
||||
else {
|
||||
$value =~ s/\r//g;
|
||||
@values = split "\n", $value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ sub getOptions {
|
|||
}
|
||||
else {
|
||||
foreach my $line (split "\n", $possibleValues) {
|
||||
$line =~ s/^(.*)\r|\s*$/$1/;
|
||||
if ($line =~ m/(.*)|(.*)/) {
|
||||
$options{$1} = $2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue