move EMSSubmission editSubmission to FormBuilder
This commit is contained in:
parent
ebc955f2e5
commit
4d55fd82d7
1 changed files with 7 additions and 6 deletions
|
|
@ -353,8 +353,8 @@ sub www_editSubmission {
|
||||||
}
|
}
|
||||||
my $asset = $self || $parent;
|
my $asset = $self || $parent;
|
||||||
my $url = $asset->getUrl('func=editSubmissionSave');
|
my $url = $asset->getUrl('func=editSubmissionSave');
|
||||||
my $newform = WebGUI::HTMLForm->new($session,action => $url);
|
my $newform = WebGUI::FormBuilder->new($session,action => $url);
|
||||||
$newform->hidden(name => 'assetId', value => $assetId);
|
$newform->addField( "hidden", name => 'assetId', value => $assetId);
|
||||||
my $formDescription = $parent->getFormDescription;
|
my $formDescription = $parent->getFormDescription;
|
||||||
my @defs = reverse @{__PACKAGE__->definition($session)};
|
my @defs = reverse @{__PACKAGE__->definition($session)};
|
||||||
my @fieldNames = qw/title submissionStatus startDate duration seatsAvailable location description/;
|
my @fieldNames = qw/title submissionStatus startDate duration seatsAvailable location description/;
|
||||||
|
|
@ -401,7 +401,7 @@ sub www_editSubmission {
|
||||||
$field->{fieldType} = "readOnly";
|
$field->{fieldType} = "readOnly";
|
||||||
}
|
}
|
||||||
|
|
||||||
$newform->dynamicField(%$field);
|
$newform->addField( "dynamicField", %$field);
|
||||||
} else {
|
} else {
|
||||||
my $value;
|
my $value;
|
||||||
# TODO see that the data gets formatted
|
# TODO see that the data gets formatted
|
||||||
|
|
@ -411,14 +411,14 @@ sub www_editSubmission {
|
||||||
} else {
|
} else {
|
||||||
$value = $field->{value} || '[ ]';
|
$value = $field->{value} || '[ ]';
|
||||||
}
|
}
|
||||||
$newform->readOnly(
|
$newform->addField( "readOnly",
|
||||||
label => $field->{label},
|
label => $field->{label},
|
||||||
value => $value,
|
value => $value,
|
||||||
fieldId => $field->{fieldId},
|
fieldId => $field->{fieldId},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$newform->submit;
|
$newform->addField( "submit", name => "submit" );
|
||||||
my $title = $asset->get('title');
|
my $title = $asset->get('title');
|
||||||
my $content =
|
my $content =
|
||||||
$asset->processTemplate({
|
$asset->processTemplate({
|
||||||
|
|
@ -426,9 +426,10 @@ sub www_editSubmission {
|
||||||
isDynamic => $session->form->get('asJson') || 0,
|
isDynamic => $session->form->get('asJson') || 0,
|
||||||
backUrl => $parent->getUrl,
|
backUrl => $parent->getUrl,
|
||||||
pageTitle => $title,
|
pageTitle => $title,
|
||||||
pageForm => $newform->print,
|
pageForm => $newform->toHtml,
|
||||||
commentForm => $self ? $self->getFormattedComments : '',
|
commentForm => $self ? $self->getFormattedComments : '',
|
||||||
commentFlag => $self ? 1 : 0 ,
|
commentFlag => $self ? 1 : 0 ,
|
||||||
|
%{ $newform->toTemplateVars },
|
||||||
},$parent->getParent->get('eventSubmissionTemplateId'));
|
},$parent->getParent->get('eventSubmissionTemplateId'));
|
||||||
WebGUI::Macro::process( $session, \$content );
|
WebGUI::Macro::process( $session, \$content );
|
||||||
if( $params->{asHashRef} ) {
|
if( $params->{asHashRef} ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue