Code cleanup for moving form generation out of getFormTemplateVars
This commit is contained in:
parent
b04aa0a1f3
commit
2609e06a44
1 changed files with 8 additions and 22 deletions
|
|
@ -278,7 +278,7 @@ sub _createForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _getFormFields ($entry, @orderedFields)
|
||||
=head2 _getFormFields ($entry)
|
||||
|
||||
Return a list of form fields for this DataForm.
|
||||
|
||||
|
|
@ -286,10 +286,6 @@ Return a list of form fields for this DataForm.
|
|||
|
||||
A WebGUI::AssetCollateral::DataForm::Entry collateral object, with data for an entry in the DataForm.
|
||||
|
||||
=head3 @orderedFields
|
||||
|
||||
Field configurations for this DataForm
|
||||
|
||||
=cut
|
||||
|
||||
sub _getFormFields {
|
||||
|
|
@ -938,24 +934,14 @@ sub getRecordTemplateVars {
|
|||
for my $field_form (@fields) {
|
||||
my ($field, $form) = @{ $field_form };
|
||||
# need a copy
|
||||
my $value;
|
||||
my $func = $session->form->process('func');
|
||||
my $ignoreForm = $func eq 'editSave' || $func eq 'editFieldSave';
|
||||
if ($entry) {
|
||||
$value = $entry->field( $field->{name} );
|
||||
my $hidden = ($field->{status} eq 'hidden' && !$session->var->isAdminOn)
|
||||
|| ($field->{isMailField} && !$self->mailData);
|
||||
|
||||
# populate Rich Editor field if the field is an HTMLArea
|
||||
if ($field->{type} eq "HTMLArea") {
|
||||
$field->{htmlAreaRichEditor} = $self->htmlAreaRichEditor ;
|
||||
}
|
||||
elsif (!$ignoreForm && defined (my $formValue = $self->session->form->process($field->{name}))) {
|
||||
$value = $formValue;
|
||||
}
|
||||
my $hidden
|
||||
= ($field->{status} eq 'hidden' && !$session->var->isAdminOn)
|
||||
|| ($field->{isMailField} && !$self->mailData);
|
||||
|
||||
# populate Rich Editor field if the field is an HTMLArea
|
||||
if ($field->{type} eq "HTMLArea") {
|
||||
$field->{htmlAreaRichEditor} = $self->htmlAreaRichEditor ;
|
||||
}
|
||||
$value = $form->getValueAsHtml;
|
||||
my $value = $form->getValueAsHtml;
|
||||
my %fieldProperties = (
|
||||
"form" => $form->toHtml,
|
||||
"name" => $field->{name},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue