more bugfixes. last of this round of syntaxCheck.t fixes.
This commit is contained in:
parent
9b867ab627
commit
f8de599f35
11 changed files with 40 additions and 31 deletions
|
|
@ -125,11 +125,11 @@ sub definition {
|
|||
dateSubmitted => {
|
||||
noFormPost=>1,
|
||||
fieldType=>"hidden",
|
||||
defaultValue=$session->datetime->time()
|
||||
defaultValue=>$session->datetime->time()
|
||||
},
|
||||
dateUpdated => {
|
||||
fieldType=>"hidden",
|
||||
defaultValue=$session->datetime->time()
|
||||
defaultValue=>$session->datetime->time()
|
||||
},
|
||||
username => {
|
||||
fieldType=>"hidden",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Post::Thread;
|
|||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Asset::Post;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::International;
|
||||
use WebGUI::MessageLog;
|
||||
use WebGUI::Paginator;
|
||||
|
|
@ -66,8 +67,9 @@ sub decrementReplies {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_Thread");
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Thread");
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
icon=>'thread.gif',
|
||||
|
|
@ -104,7 +106,7 @@ sub definition {
|
|||
}
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($definition);
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -146,7 +148,7 @@ A string indicating the type of layout to use. Can be flat or nested.
|
|||
sub getLayoutUrl {
|
||||
my $self = shift;
|
||||
my $layout = shift;
|
||||
return $self->session->asset->getUrl("layout=".$layout.'#id'.$self->session->asset->getId) if (exists $self->session->asset);
|
||||
return $self->session->asset->getUrl("layout=".$layout.'#id'.$self->session->asset->getId) if ($self->session->asset);
|
||||
return $self->getUrl("layout=".$layout);
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +549,8 @@ sub subscribe {
|
|||
my $self = shift;
|
||||
$self->createSubscriptionGroup;
|
||||
WebGUI::Cache->new($self->session,"cspost_".$self->getId."_".$self->session->user->userId."_".$self->session->scratch->get("discussionLayout")."_".$self->session->form->process("pn"))->delete;
|
||||
$group->addUsers([$self->session->user->userId],[$self->get("subscriptionGroupId")]);
|
||||
my $group = WebGUI::Group->new($self->session,$self->get("subscriptionGroupId"));
|
||||
$group->addUsers([$self->session->user->userId]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -607,7 +610,8 @@ Negates the subscribe method.
|
|||
sub unsubscribe {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"cspost_".$self->getId."_".$self->session->user->userId."_".$self->session->scratch->get("discussionLayout")."_".$self->session->form->process("pn"))->delete;
|
||||
$group->deleteUsers([$self->session->user->userId],[$self->get("subscriptionGroupId")]);
|
||||
my $group = WebGUI::Group->new($self->session,$self->get("subscriptionGroupId"));
|
||||
$group->deleteUsers([$self->session->user->userId]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -664,7 +668,7 @@ sub view {
|
|||
} else {
|
||||
$sql .= "asset.lineage";
|
||||
}
|
||||
my $currentPageUrl = $session{requestedUrl};
|
||||
my $currentPageUrl = $self->session->url->requestedUrl;
|
||||
$p->setDataByQuery($sql, undef, undef, undef, "url", $currentPageUrl);
|
||||
foreach my $dataSet (@{$p->getPageData()}) {
|
||||
next unless ($dataSet->{className} eq "WebGUI::Asset::Post" || $dataSet->{className} eq "WebGUI::Asset::Post::Thread"); #handle non posts!
|
||||
|
|
|
|||
|
|
@ -575,8 +575,8 @@ sub processPropertiesFromFormPost {
|
|||
});
|
||||
}
|
||||
if ($self->session->form->process("fid") eq "new") { # hack to get proceed to work.
|
||||
$session{whatNext} = $self->session->form->process("proceed");
|
||||
} else { $session{whatNext} = "nothing"; }
|
||||
$session->stow->set('whatNext',$self->session->form->process("proceed"));
|
||||
} else { $session->stow->set('whatNext','nothing'); }
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -734,6 +734,7 @@ sub www_deleteTabConfirm {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editField {
|
||||
my $self = shift;
|
||||
my $fid = shift || $self->session->form->process("fid") || 'new';
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
|
||||
my (%field, $f, %fieldStatus,$tab);
|
||||
|
|
@ -745,7 +746,6 @@ sub www_editField {
|
|||
"editable" => $i18n->get(6),
|
||||
"required" => $i18n->get(75)
|
||||
);
|
||||
$self->session->form->process("fid") = "new" if ($self->session->form->process("fid") eq "");
|
||||
unless ($self->session->form->process("fid") eq "new") {
|
||||
%field = $self->session->db->quickHash("select * from DataForm_field where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
|
||||
}
|
||||
|
|
@ -891,9 +891,8 @@ sub www_editFieldSave {
|
|||
" where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
|
||||
}
|
||||
$self->reorderCollateral("DataForm_field","DataForm_fieldId", _tonull("DataForm_tabId",$self->session->form->process("tid"))) if ($self->session->form->process("fid") ne "new");
|
||||
if ($session{whatNext} eq "editField" || $self->session->form->process("proceed") eq "editField") {
|
||||
$self->session->form->process("fid") = "new";
|
||||
return $self->www_editField;
|
||||
if ($self->session->stow->get('whatNext') eq "editField" || $self->session->form->process("proceed") eq "editField") {
|
||||
return $self->www_editField('new');
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -992,6 +992,7 @@ sub www_editQuestion {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editQuestionSave {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless ($_[0]->canEdit);
|
||||
|
||||
$self->session->form->process("qid") = $_[0]->setCollateral("Survey_question", "Survey_questionId", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue