Adding the SQL Form and editForm error feedback.
This commit is contained in:
parent
82b2ad934d
commit
179e4a89ef
15 changed files with 6293 additions and 4 deletions
|
|
@ -542,6 +542,16 @@ sub getEditForm {
|
|||
});
|
||||
}
|
||||
$tabform->addTab("properties",$i18n->get("properties"));
|
||||
|
||||
# process errors
|
||||
my $errors = $self->session->stow->get('editFormErrors');
|
||||
print "[$errors]";
|
||||
if ($errors) {
|
||||
$tabform->getTab("properties")->readOnly(
|
||||
-value=>"<p>Some error(s) occurred:<ul><li>".join('</li><li>', @$errors).'</li></ul></p>',
|
||||
)
|
||||
}
|
||||
|
||||
$tabform->getTab("properties")->readOnly(
|
||||
-label=>$i18n->get("asset id"),
|
||||
-value=>$self->get("assetId"),
|
||||
|
|
@ -1523,7 +1533,9 @@ sub prepareView {
|
|||
|
||||
=head2 processPropertiesFromFormPost ( )
|
||||
|
||||
Updates current Asset with data from Form.
|
||||
Updates current Asset with data from Form. You can feed back errors by returning an
|
||||
arrayref containing the error messages. If there is no error you do not have to return
|
||||
anything.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -1906,7 +1918,19 @@ sub www_editSave {
|
|||
return $self->getContainer->www_view;
|
||||
}
|
||||
}
|
||||
$object->processPropertiesFromFormPost;
|
||||
|
||||
my $error = $object->processPropertiesFromFormPost;
|
||||
if (ref $error eq 'ARRAY') {
|
||||
$self->session->stow->set('editFormErrors', $error);
|
||||
if ($self->session->form->process('assetId') eq 'new') {
|
||||
$object->purge;
|
||||
return $self->www_add();
|
||||
} else {
|
||||
$object->purgeRevision;
|
||||
return $self->www_edit();
|
||||
}
|
||||
}
|
||||
|
||||
$object->updateHistory("edited");
|
||||
if ($self->session->form->process("proceed") eq "manageAssets") {
|
||||
$self->session->asset($object->getParent);
|
||||
|
|
@ -1921,6 +1945,7 @@ sub www_editSave {
|
|||
$self->session->asset($object);
|
||||
return $self->session->asset->$method();
|
||||
}
|
||||
|
||||
$self->session->asset($object->getContainer);
|
||||
return $self->session->asset->www_view;
|
||||
}
|
||||
|
|
|
|||
3844
lib/WebGUI/Asset/Wobject/SQLForm.pm
Normal file
3844
lib/WebGUI/Asset/Wobject/SQLForm.pm
Normal file
File diff suppressed because it is too large
Load diff
366
lib/WebGUI/Help/Asset_SQLForm.pm
Normal file
366
lib/WebGUI/Help/Asset_SQLForm.pm
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
package WebGUI::Help::Asset_SQLForm;
|
||||
|
||||
our $HELP = {
|
||||
'sqlform add/edit ' => {
|
||||
title => 'edit sqlform',
|
||||
body => 'sqlform description',
|
||||
fields => [
|
||||
{
|
||||
title => 'gef table name',
|
||||
description => 'gef table name description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef import table',
|
||||
description => 'gef import table description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef database to use',
|
||||
description => 'gef database to use description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef max file size',
|
||||
description => 'gef max file size description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef send mail to',
|
||||
description => 'gef send mail to description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title =>'show meta data',
|
||||
description => 'gef show meta data description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef edit template',
|
||||
description => 'gef edit template description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef search template',
|
||||
description => 'gef search template description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'gef submit group',
|
||||
description => 'gef submit group description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'manage fields',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
tag => 'manage field types',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
|
||||
{
|
||||
tag => 'manage regexes',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'edit field' => {
|
||||
title => 'edit field title',
|
||||
body => 'edit field description',
|
||||
fields => [
|
||||
{
|
||||
title => 'ef field name',
|
||||
description => 'ef field name description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef display name',
|
||||
description => 'ef display name description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef field type',
|
||||
description => 'ef field type description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef signed',
|
||||
description => 'ef signed description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef autoincrement',
|
||||
description => 'ef autoincrement description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef form height',
|
||||
description => 'ef form height description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef max field length',
|
||||
description => 'ef max field length description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef max field length',
|
||||
description => 'ef max field length description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef regex',
|
||||
description => 'ef regex description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef required',
|
||||
description => 'ef required description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef read only',
|
||||
description => 'ef read only description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef default value',
|
||||
description => 'ef default value description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef field constraint',
|
||||
description => 'ef field constraint description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef searchable',
|
||||
description => 'ef searchable description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef fulltext',
|
||||
description => 'ef fulltext description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef show in search',
|
||||
description => 'ef show in search description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef summary length',
|
||||
description => 'ef summary length description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef populate keys',
|
||||
description => 'ef populate keys description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef populate values',
|
||||
description => 'ef populate values description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef join selector',
|
||||
description => 'ef join selector description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef join constraint',
|
||||
description => 'ef join constraint description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef join keys',
|
||||
description => 'ef join keys description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
{
|
||||
title => 'ef join values',
|
||||
description => 'ef join values description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'manage field types',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
|
||||
{
|
||||
tag => 'manage regexes',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'edit field type' => {
|
||||
title => 'edit field type title',
|
||||
body => 'edit field type description',
|
||||
fields => [
|
||||
{
|
||||
title => 'eft db field type',
|
||||
description => 'eft db field type description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
title => 'eft form field type',
|
||||
description => 'eft form field type description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
related => [
|
||||
|
||||
{
|
||||
tag => 'manage fields',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'edit regex' => {
|
||||
title =>'edit regex title',
|
||||
body => 'edit regex description',
|
||||
fields =>[
|
||||
{
|
||||
title => 'er name',
|
||||
description => 'er name description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
title => 'er regex',
|
||||
description => 'er regex description',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'manage fields',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'manage fields' => {
|
||||
title =>'manage fields title',
|
||||
body => 'edit field description',
|
||||
related => [
|
||||
{
|
||||
tag => 'edit field',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
tag => 'manage field types',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
|
||||
{
|
||||
tag => 'manage regexes',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'manage field types' => {
|
||||
title => 'manage field types title',
|
||||
body => 'edit field type description',
|
||||
related => [
|
||||
{
|
||||
tag => 'edit field type',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
tag => 'manage fields',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'manage regexes' => {
|
||||
title =>'manage regexes title',
|
||||
body => 'edit regex description',
|
||||
related => [
|
||||
{
|
||||
tag => 'edit regex',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
tag => 'manage fields',
|
||||
namespace => 'Asset_SQLForm'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'edit record template' => {
|
||||
title => 'edit template help title',
|
||||
body => 'edit template help',
|
||||
related => [
|
||||
{
|
||||
tag => 'sqlform add/edit',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
tag => 'template language',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'search record template' => {
|
||||
title => 'search template help title',
|
||||
body => 'search template help',
|
||||
related => [
|
||||
{
|
||||
tag => 'sqlform add/edit',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
{
|
||||
tag => 'template language',
|
||||
namespace => 'Asset_SQLForm',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
1322
lib/WebGUI/i18n/English/Asset_SQLForm.pm
Normal file
1322
lib/WebGUI/i18n/English/Asset_SQLForm.pm
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue