EMS import/export, Form::*::getValueFromPost(alt_values), and tests
This commit is contained in:
parent
0a7e06edca
commit
c09b2cae1b
46 changed files with 1728 additions and 299 deletions
|
|
@ -81,7 +81,7 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 yesNo ( )
|
||||
|
||||
Returns either a 1 or 0 representing yes, no.
|
||||
|
||||
|
|
@ -97,6 +97,32 @@ sub yesNo {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
If value is present, we will process it, otherwise the superclass will handle the request.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input. This should be in the form 1, 0, 'Y' or 'N'. 1 or 0 is returned.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue;
|
||||
|
||||
if (@_) {
|
||||
my $value = shift;
|
||||
return '' unless length $value; # empty import value?
|
||||
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
return $self->SUPER::getValueFromPost;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 toHtml ( )
|
||||
|
||||
Renders a yes/no question field.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue