fixed a couple bugs in mb migration

This commit is contained in:
JT Smith 2005-02-12 22:29:15 +00:00
parent 3aaac188f8
commit 95a1c05143
2 changed files with 22 additions and 23 deletions

View file

@ -1597,6 +1597,7 @@ Any properties to set besides defaults.
sub newByDynamicClass {
my $class = shift;
my $assetId = shift;
return undef unless defined $assetId;
my $className = shift;
my $overrideProperties = shift;
unless (defined $className) {

View file

@ -60,16 +60,15 @@ sub getName {
sub view {
my $self = shift;
my %var;
my $count = 1;
my $count;
my $first;
my @forum_loop;
my $children = $self->getLineage(["children"],{includeOnlyClasses=>["WebGUI::Asset::Wobject::Collaboration"]});
my $children = $self->getLineage(["children"],{includeOnlyClasses=>["WebGUI::Asset::Wobject::Collaboration"],returnObjects=>1});
foreach my $child (@{$children}) {
$count++;
next unless ($child->canView);
if ($count == 1) {
$var{'default.listing'} = $child->view;
$var{'default.description'} = $child->get("description");
$var{'default.title'} = $child->get("title");
$var{'default.controls'} = $child->getToolbar;
$first = $child;
}
my %lastPostVars;
my $lastPost = WebGUI::Asset::Wobject::MessageBoard->newByDynamicClass($child->get("lastPostId"));
@ -87,23 +86,22 @@ sub view {
'forum.lastPost.user.isVisitor' => ($lastPost->get("ownerUserId") eq '1')
);
}
push(@forum_loop, {
%lastPostVars,
'forum.controls' => $child->getToolbar,
'forum.count' => $count,
'forum.title' => $child->get('title'),
'forum.description' => $child->get("description"),
'forum.replies' => $child->get("replies"),
'forum.rating' => $child->get("rating"),
'forum.views' => $child->get("views"),
'forum.threads' => $child->get("threads"),
'forum.url' => $child->getUrl,
'forum.user.canView' => $child->canView,
'forum.user.canPost' => $child->canPost
});
$count++;
}
push(@forum_loop, {
%lastPostVars,
'forum.controls' => $child->getToolbar,
'forum.count' => $count,
'forum.title' => $child->get('title'),
'forum.description' => $child->get("description"),
'forum.replies' => $child->get("replies"),
'forum.rating' => $child->get("rating"),
'forum.views' => $child->get("views"),
'forum.threads' => $child->get("threads"),
'forum.url' => $child->getUrl,
'forum.user.canView' => $child->canView,
'forum.user.canPost' => $child->canPost
});
}
$var{'default.listing'} = $first->view if ($count == 1 && defined $first);
$var{'forum.add.url'} = $self->getUrl("func=add&class=WebGUI::Asset::Wobject::Collaboration");
$var{'forum.add.label'} = WebGUI::International::get(75,"MessageBoard");
$var{'title.label'} = WebGUI::International::get(99);
@ -112,7 +110,7 @@ sub view {
$var{'threads.label'} = WebGUI::International::get(1036);
$var{'replies.label'} = WebGUI::International::get(1016);
$var{'lastpost.label'} = WebGUI::International::get(1017);
$var{areMultipleForums} = ($count > 2);
$var{areMultipleForums} = ($count > 1);
$var{forum_loop} = \@forum_loop;
return $self->processTemplate(\%var,$self->get("templateId"));
}