From d6afcde7b98c5452e541d8eb4c516e98b4975c36 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 10 Sep 2005 18:20:29 +0000 Subject: [PATCH] fix [ 1266159 ] 6.7.1 - getEditForm fields are in funky order --- docs/changelog/6.x.x.txt | 1 + lib/WebGUI/Asset/Wobject.pm | 17 +++++++------ lib/WebGUI/Asset/Wobject/Article.pm | 20 +++++++++------- lib/WebGUI/Asset/Wobject/MessageBoard.pm | 22 ++++++++++------- lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 24 ++++++++++--------- 5 files changed, 49 insertions(+), 35 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 371577c8c..5e258cb40 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -26,6 +26,7 @@ page. - Added some new indicies to make asset queries .01 to .1 seconds faster per query. - fix [ 1274488 ] Visitors language not recognized 6.7.2 + - fix [ 1266159 ] 6.7.1 - getEditForm fields are in funky order 6.7.3 diff --git a/lib/WebGUI/Asset/Wobject.pm b/lib/WebGUI/Asset/Wobject.pm index b2d1ee9cb..94c35a9e4 100644 --- a/lib/WebGUI/Asset/Wobject.pm +++ b/lib/WebGUI/Asset/Wobject.pm @@ -66,11 +66,9 @@ An array of hashes to prepend to the list sub definition { my $class = shift; my $definition = shift; - push(@{$definition}, { - tableName=>'wobject', - className=>'WebGUI::Asset::Wobject', - autoGenerateForms=>1, - properties=>{ + my %properties; + tie %properties, 'Tie::IxHash'; + %properties = ( description=>{ fieldType=>'HTMLArea', defaultValue=>undef, @@ -118,7 +116,12 @@ sub definition { hoverHelp=>WebGUI::International::get('1079 description','Wobject'), namespace=>'style' } - } + ); + push(@{$definition}, { + tableName=>'wobject', + className=>'WebGUI::Asset::Wobject', + autoGenerateForms=>1, + properties => \%properties }); return $class->SUPER::definition($definition); } @@ -247,7 +250,7 @@ Returns the TabForm object that will be used in generating the edit page for thi sub getEditForm { my $self = shift; my $tabform = $self->SUPER::getEditForm(); - foreach my $definition (@{$self->definition}) { + foreach my $definition (reverse @{$self->definition}) { my $properties = $definition->{properties}; next unless ($definition->{autoGenerateForms}); foreach my $fieldname (keys %{$properties}) { diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index d0d2b0c77..eaa42c6c6 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -11,6 +11,7 @@ package WebGUI::Asset::Wobject::Article; #------------------------------------------------------------------- use strict; +use Tie::IxHash; use WebGUI::DateTime; use WebGUI::International; use WebGUI::Paginator; @@ -25,13 +26,9 @@ our @ISA = qw(WebGUI::Asset::Wobject); sub definition { my $class = shift; my $definition = shift; - push(@{$definition}, { - assetName=>WebGUI::International::get(1,"Asset_Article"), - icon=>'article.gif', - autoGenerateForms=>1, - tableName=>'Article', - className=>'WebGUI::Asset::Wobject::Article', - properties=>{ + my %properties; + tie %properties, 'Tie::IxHash'; + %properties = ( templateId =>{ fieldType=>"template", defaultValue=>'PBtmpl0000000000000002', @@ -65,7 +62,14 @@ sub definition { hoverHelp=>WebGUI::International::get('carriage return description','Asset_Article'), uiLevel=>5 } - } + ); + push(@{$definition}, { + assetName=>WebGUI::International::get(1,"Asset_Article"), + icon=>'article.gif', + autoGenerateForms=>1, + tableName=>'Article', + className=>'WebGUI::Asset::Wobject::Article', + properties=>\%properties }); return $class->SUPER::definition($definition); } diff --git a/lib/WebGUI/Asset/Wobject/MessageBoard.pm b/lib/WebGUI/Asset/Wobject/MessageBoard.pm index f5069c331..bfcecf9ba 100644 --- a/lib/WebGUI/Asset/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Asset/Wobject/MessageBoard.pm @@ -11,6 +11,7 @@ package WebGUI::Asset::Wobject::MessageBoard; #------------------------------------------------------------------- use strict; +use Tie::IxHash; use WebGUI::Asset::Wobject; use WebGUI::DateTime; use WebGUI::International; @@ -25,13 +26,9 @@ our @ISA = qw(WebGUI::Asset::Wobject); sub definition { my $class = shift; my $definition = shift; - push(@{$definition}, { - assetName=>WebGUI::International::get(2,"Asset_MessageBoard"), - icon=>'messageBoard.gif', - tableName=>'MessageBoard', - className=>'WebGUI::Asset::Wobject::MessageBoard', - autoGenerateForms=>1, - properties=>{ + my %properties; + tie %properties, 'Tie::IxHash'; + %properties = ( templateId =>{ tab=>"display", fieldType=>"template", @@ -39,8 +36,15 @@ sub definition { namespace=>"MessageBoard", label=>WebGUI::International::get(73,"Asset_MessageBoard"), hoverHelp=>WebGUI::International::get('73 description',"Asset_MessageBoard") - }, - } + } + ); + push(@{$definition}, { + assetName=>WebGUI::International::get(2,"Asset_MessageBoard"), + icon=>'messageBoard.gif', + tableName=>'MessageBoard', + className=>'WebGUI::Asset::Wobject::MessageBoard', + autoGenerateForms=>1, + properties=>\%properties }); return $class->SUPER::definition($definition); } diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 7f8bec7f6..0b5765cf3 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -14,6 +14,7 @@ use HTML::Entities; use strict; use Storable; use Tie::CPHash; +use Tie::IxHash; use WebGUI::Cache; use WebGUI::DateTime; use WebGUI::HTMLForm; @@ -67,19 +68,12 @@ A hash reference passed in from a subclass definition. =cut - -#------------------------------------------------------------------- sub definition { my $class = shift; my $definition = shift; - push(@{$definition}, { - assetName=>WebGUI::International::get(2,'Asset_SyndicatedContent'), - uiLevel=>6, - autoGenerateForms=>1, - icon=>'syndicatedContent.gif', - tableName=>'SyndicatedContent', - className=>'WebGUI::Asset::Wobject::SyndicatedContent', - properties=>{ + my %properties; + tie %properties, 'Tie::IxHash'; + %properties = ( templateId =>{ tab=>"display", fieldType=>'template', @@ -123,7 +117,15 @@ sub definition { hoverHelp=>WebGUI::International::get('hasTermsLabel description','Asset_SyndicatedContent'), maxlength=>255 } - } + ); + push(@{$definition}, { + assetName=>WebGUI::International::get(2,'Asset_SyndicatedContent'), + uiLevel=>6, + autoGenerateForms=>1, + icon=>'syndicatedContent.gif', + tableName=>'SyndicatedContent', + className=>'WebGUI::Asset::Wobject::SyndicatedContent', + properties=>%properties }); return $class->SUPER::definition($definition); }