collaboration system pretty much working
This commit is contained in:
parent
e6c38c85ad
commit
924139ba30
4 changed files with 52 additions and 63 deletions
|
|
@ -695,26 +695,10 @@ while (my ($id, $template, $namespace) = $sth->array) {
|
|||
$template =~ s/\<tmpl_var\s+callback\.label\>//ixsg;
|
||||
$template =~ s/\<tmpl_var\s+forum\.description\>//ixsg;
|
||||
$template =~ s/\<tmpl_var\s+forum\.title\>//ixsg;
|
||||
$template =~ s/forum\.search\./search./ixsg;
|
||||
$template =~ s/forum\.subscribe\./subscribe./ixsg;
|
||||
$template =~ s/forum\.unsubscribe\./unsubscribe./ixsg;
|
||||
$template =~ s/forum\.//ixsg;
|
||||
$template =~ s/thread\.list\.url/collaboration.url/ixsg;
|
||||
$template =~ s/thread\.new\.url/add.url/ixsg;
|
||||
$template =~ s/thread\.new\.label/add.label/ixsg;
|
||||
$template =~ s/thread\.sortby\./sortby./ixsg;
|
||||
$template =~ s/thread\.date\./date./ixsg;
|
||||
$template =~ s/thread\.user\./user./ixsg;
|
||||
$template =~ s/thread\.views\./views./ixsg;
|
||||
$template =~ s/thread\.replies./replies./ixsg;
|
||||
$template =~ s/thread\.rating\./rating./ixsg;
|
||||
$template =~ s/thread\.last\./lastReply./ixsg;
|
||||
$template =~ s/thread\.sorted\./sorted./ixsg;
|
||||
$template =~ s/thread\.sortedBy\./sortedBy./ixsg;
|
||||
$template =~ s/thread\.views/views/ixsg;
|
||||
$template =~ s/thread\.replies/replies/ixsg;
|
||||
$template =~ s/thread\.rating/rating/ixsg;
|
||||
$template =~ s/thread\.rating_loop/rating_loop/ixsg;
|
||||
$template =~ s/thread\.isSticky/isSticky/ixsg;
|
||||
$template =~ s/thread\.isLocked/isLocked/ixsg;
|
||||
$template =~ s/thread\.root\.subject/title/ixsg;
|
||||
$template =~ s/thread\.root\.url/url/ixsg;
|
||||
$template =~ s/thread\.root\.epoch/dateSubmitted/ixsg;
|
||||
|
|
@ -726,35 +710,35 @@ while (my ($id, $template, $namespace) = $sth->array) {
|
|||
$template =~ s/thread\.root\.user\.name/username/ixsg;
|
||||
$template =~ s/thread\.root\.user\.id/ownerUserId/ixsg;
|
||||
$template =~ s/thread\.root\.user\.isVisitor/user.isVisitor/ixsg;
|
||||
$template =~ s/thread\.root\.user\.status/status/ixsg;
|
||||
$template =~ s/thread\.last\.url/last.url/ixsg;
|
||||
$template =~ s/thread\.last\.subject/last.title/ixsg;
|
||||
$template =~ s/thread\.last\.epoch/last.dateSubmitted/ixsg;
|
||||
$template =~ s/thread\.last\.date/last.dateSubmitted.human/ixsg;
|
||||
$template =~ s/thread\.last\.time/last.timeSubmitted.human/ixsg;
|
||||
$template =~ s/thread\.last\.user.profile/last.userProfile.url/ixsg;
|
||||
$template =~ s/thread\.last\.user.name/last.username/ixsg;
|
||||
$template =~ s/thread\.last\.user.id/last.ownerUserId/ixsg;
|
||||
$template =~ s/thread\.last\.user.isVisitor/last.user.isVisitor/ixsg;
|
||||
$template =~ s/thread\.last\.status/last.status/ixsg;
|
||||
$template =~ s/post\.subject\.label/subject.label/ixsg;
|
||||
$template =~ s/thread\.root\..status/status/ixsg;
|
||||
$template =~ s/thread\.last\.subject/lastReply.title/ixsg;
|
||||
$template =~ s/thread\.last\.epoch/lastReply.dateSubmitted/ixsg;
|
||||
$template =~ s/thread\.last\.date/lastReply.dateSubmitted.human/ixsg;
|
||||
$template =~ s/thread\.last\.time/lastReply.timeSubmitted.human/ixsg;
|
||||
$template =~ s/thread\.last\.user.profile/lastReply.userProfile.url/ixsg;
|
||||
$template =~ s/thread\.last\.user.name/lastReply.username/ixsg;
|
||||
$template =~ s/thread\.last\.user.id/lastReply.ownerUserId/ixsg;
|
||||
$template =~ s/thread\.last\./lastReply./ixsg;
|
||||
$template =~ s/thread\.//ixsg;
|
||||
$template =~ s/post\.subject/title/ixsg;
|
||||
$template =~ s/post\.message/content/ixsg;
|
||||
$template =~ s/post\.time\.value/timeSubmitted.human/ixsg;
|
||||
$template =~ s/post\.date\.value/dateSubmitted.human/ixsg;
|
||||
$template =~ s/post\.date\.epoch/dateSubmitted/ixsg;
|
||||
$template =~ s/post\.date\.label/date.label/ixsg;
|
||||
$template =~ s/post\.rating\.label/rating.label/ixsg;
|
||||
$template =~ s/post\.rating\.value/rating/ixsg;
|
||||
$template =~ s/post\.canEdit/user.canEdit/ixsg;
|
||||
$template =~ s/post\.user\.name/username/ixsg;
|
||||
$template =~ s/post\.user\.alias/username/ixsg;
|
||||
$template =~ s/post\.id/assetId/ixsg;
|
||||
$template =~ s/post\.user\.id/ownerUserId/ixsg;
|
||||
$template =~ s/post\.user\.profile/userProfile.url/ixsg;
|
||||
$template =~ s/post\.//ixsg;
|
||||
$template =~ s/form\.begin/form.header/ixsg;
|
||||
$template =~ s/form\.end/form.footer/ixsg;
|
||||
$template =~ s/message\.form/content.form/ixsg;
|
||||
$template =~ s/subject\.form/title.form/ixsg;
|
||||
$template =~ s/newpost\.header/newpost.header.label/ixsg;
|
||||
$template =~ s/newpost\.isReply/isReply/ixsg;
|
||||
$template =~ s/newpost\.isEdit/isEdit/ixsg;
|
||||
$template =~ s/newpost\.isNewThread/isNewThread/ixsg;
|
||||
$template =~ s/newpost\.isNewMessage/isNewPost/ixsg;
|
||||
$template =~ s/newpost\.header/newpost.header.label/ixsg;
|
||||
$template =~ s/newpost\.//ixsg;
|
||||
$template =~ s/firstPage/pagination.firstPage/ixsg;
|
||||
$template =~ s/lastPage/pagination.lastPage/ixsg;
|
||||
$template =~ s/nextPage/pagination.nextPage/ixsg;
|
||||
|
|
@ -764,7 +748,8 @@ while (my ($id, $template, $namespace) = $sth->array) {
|
|||
$template =~ s/numberOfPages/pagination.pageCount/ixsg;
|
||||
$template =~ s/pageNumber/pagination.pageNumber/ixsg;
|
||||
$template =~ s/thread_loop/post_loop/ixsg;
|
||||
$template =~ s/\<div align="center"\>\s+\<a href=""\>-=:\s+:=-\<\/a\>\s+\<\/div\>//ixsg;
|
||||
$template =~ s/back\.url/collaboration.url/ixsg;
|
||||
$template =~ s/-=:\s+:=-//ixsg;
|
||||
WebGUI::SQL->write("update template set template=".quote($template).", namespace=".quote($namespace)." where assetId=".quote($id));
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -515,8 +515,8 @@ sub processPropertiesFromFormPost {
|
|||
groupIdView => $self->getThread->get("groupIdView"),
|
||||
groupIdEdit => $self->getThread->get("groupIdEdit")
|
||||
);
|
||||
$data{startDate} = $self->getThread-getParent->get("startDate") unless ($session{form}{startDate});
|
||||
$data{endDate} = $self->getThread-getParent->get("endDate") unless ($session{form}{endDate});
|
||||
$data{startDate} = $self->getThread->getParent->get("startDate") unless ($session{form}{startDate});
|
||||
$data{endDate} = $self->getThread->getParent->get("endDate") unless ($session{form}{endDate});
|
||||
($data{synopsis}, $data{content}) = $self->getSynopsisAndContentFromFormPost;
|
||||
if ($self->getThread->getParent->get("addEditStampToPosts")) {
|
||||
$data{content} .= "<p>\n\n --- (Edited on ".WebGUI::DateTime::epochToHuman()." by ".$session{user}{alias}.") --- \n</p>";
|
||||
|
|
@ -684,7 +684,7 @@ sub www_deny {
|
|||
sub www_edit {
|
||||
my $self = shift;
|
||||
my %var = %{$self->getTemplateVars};
|
||||
$var{'form.header'} = WebGUI::Form::formHeader({action=>$self->getUrl})
|
||||
$var{'form.header'} = WebGUI::Form::formHeader({action=>$self->getParent->getUrl})
|
||||
.WebGUI::Form::hidden({
|
||||
name=>"func",
|
||||
value=>"add"
|
||||
|
|
@ -750,7 +750,7 @@ sub www_edit {
|
|||
$var{'form.preview'} = WebGUI::Form::submit({value=>"Preview"});
|
||||
$var{'form.submit'} = WebGUI::Form::button({
|
||||
value=>"Save",
|
||||
onclick=>"this.value='Please wait...'; this.form.func.value='editSave'; this.form.submit();"
|
||||
extras=>"onclick=\"this.value='Please wait...'; this.form.func.value='editSave'; this.form.submit();\""
|
||||
});
|
||||
$var{'form.footer'} = WebGUI::Form::formFooter();
|
||||
$var{usePreview} = $self->getThread->getParent->get("usePreview");
|
||||
|
|
|
|||
|
|
@ -179,15 +179,18 @@ sub getNextThread {
|
|||
unless (exists $self->{_next}) {
|
||||
$self->{_next} = WebGUI::Asset::Post->newByPropertyHashRef(
|
||||
WebGUI::SQL->quickHashRef("
|
||||
select asset.*,Post.*
|
||||
select *
|
||||
from Thread
|
||||
left join asset on asset.assetId=Thread.assetId
|
||||
left join Post on Post.assetId=asset.assetId
|
||||
where Thread.parentId=".quote($self->get("parentId"))."
|
||||
where asset.parentId=".quote($self->get("parentId"))."
|
||||
and asset.state='published'
|
||||
and asset.className='WebGUI::Asset::Post::Thread'
|
||||
and ".$self->getParent->getValue("sortBy").">".quote($self->get($self->getParent->getValue("sortBy")))."
|
||||
and (userId=".quote($self->get("ownerUserId"))." or Post.status='approved')
|
||||
and (
|
||||
Post.status in ('approved','archived')
|
||||
or (asset.ownerUserId=".quote($session{user}{userId})." and asset.ownerUserId<>'1')
|
||||
)
|
||||
order by ".$self->getParent->getValue("sortBy")." asc
|
||||
",WebGUI::SQL->getSlave)
|
||||
);
|
||||
|
|
@ -209,18 +212,19 @@ sub getPreviousThread {
|
|||
my $self = shift;
|
||||
unless (exists $self->{_previous}) {
|
||||
$self->{_previous} = WebGUI::Asset::Post->newByPropertyHashRef(
|
||||
WebGUI::SQL->quickHashRef("
|
||||
select asset.*,Post.*
|
||||
WebGUI::SQL->quickHashRef(" select *
|
||||
from Thread
|
||||
left join asset on asset.assetId=Thread.assetId
|
||||
left join Post on Post.assetId=asset.assetId
|
||||
where Thread.parentId=".quote($self->get("parentId"))."
|
||||
where asset.parentId=".quote($self->get("parentId"))."
|
||||
and asset.state='published'
|
||||
and asset.className='WebGUI::Asset::Post::Thread'
|
||||
and ".$self->getParent->getValue("sortBy")."<".quote($self->get($self->getParent->getValue("sortBy")))."
|
||||
and (userId=".quote($self->get("ownerUserId"))." or Post.status='approved')
|
||||
order by ".$self->getParent->getValue("sortBy")." desc
|
||||
",WebGUI::SQL->getSlave)
|
||||
and (
|
||||
Post.status in ('approved','archived')
|
||||
or (asset.ownerUserId=".quote($session{user}{userId})." and asset.ownerUserId<>'1')
|
||||
)
|
||||
order by ".$self->getParent->getValue("sortBy")." desc ",WebGUI::SQL->getSlave)
|
||||
);
|
||||
};
|
||||
return $self->{_previous};
|
||||
|
|
@ -569,13 +573,13 @@ sub view {
|
|||
$self->getParent->appendTemplateLabels($var);
|
||||
|
||||
$var->{'user.isVisitor'} = ($session{user}{userId} eq '1');
|
||||
$var->{'user.isModerator'} = $self->canModerate;
|
||||
$var->{'user.isModerator'} = $self->getParent->canModerate;
|
||||
$var->{'user.canPost'} = $self->getParent->canPost;
|
||||
$var->{'user.canReply'} = $self->canReply;
|
||||
|
||||
$var->{'layout.nested.url'} = $self->getThreadLayoutUrl("nested");
|
||||
$var->{'layout.flat.url'} = $self->getThreadLayoutUrl("flat");
|
||||
$var->{'layout.threaded.url'} = $self->getThreadLayoutUrl("threaded");
|
||||
$var->{'layout.nested.url'} = $self->getLayoutUrl("nested");
|
||||
$var->{'layout.flat.url'} = $self->getLayoutUrl("flat");
|
||||
$var->{'layout.threaded.url'} = $self->getLayoutUrl("threaded");
|
||||
my $layout = $session{scratch}{discussionLayout} || $session{user}{discussionLayout};
|
||||
$var->{'layout.isFlat'} = ($layout eq "flat");
|
||||
$var->{'layout.isNested'} = ($layout eq "nested");
|
||||
|
|
@ -633,7 +637,7 @@ sub view {
|
|||
|
||||
$var->{"search.url"} = $self->getParent->getSearchUrl;
|
||||
$var->{"back.url"} = $self->getThread->getParent->getUrl;
|
||||
return $self->processTemplate($var,$self->getParent->get("submissionTemplateId"));
|
||||
return $self->processTemplate($var,$self->getParent->get("threadTemplateId"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ sub appendPostListTemplateVars {
|
|||
my $page = $p->getPageData;
|
||||
my $i = 0;
|
||||
foreach my $row (@$page) {
|
||||
my $post = WebGUI::Asset::Wobject::Forum->newByPropertyHashRef($row);
|
||||
my $post = WebGUI::Asset::Wobject::Collaboration->newByPropertyHashRef($row);
|
||||
$post->{_parent} = $self; # caching parent for efficiency
|
||||
my $controls = deleteIcon('func=delete',$post->get("url"),"Delete").editIcon('func=edit',$post->get("ur"));
|
||||
if ($self->get("sortBy") eq "lineage") {
|
||||
|
|
@ -66,7 +66,7 @@ sub appendPostListTemplateVars {
|
|||
"id"=>$post->getId,
|
||||
"url"=>$post->getUrl,
|
||||
rating_loop=>\@rating_loop,
|
||||
"content"=>$self->formatContent,
|
||||
"content"=>$post->formatContent,
|
||||
"status"=>$post->getStatus,
|
||||
# "thumbnail"=>$submission->getThumbnailUrl,
|
||||
# "submission.image"=>$submission->getImageUrl,
|
||||
|
|
@ -74,7 +74,7 @@ sub appendPostListTemplateVars {
|
|||
"dateUpdated.human"=>epochToHuman($post->get("dateUpdated"),"%z"),
|
||||
"timeSubmitted.human"=>epochToHuman($post->get("dateSubmitted"),"%Z"),
|
||||
"timeUpdated.human"=>epochToHuman($post->get("dateUpdated"),"%Z"),
|
||||
"userProfile.url"=>$post->getUserProfileUrl,
|
||||
"userProfile.url"=>$post->getPosterProfileUrl,
|
||||
"user.isVisitor"=>$post->get("ownerUserId") eq "1",
|
||||
"edit.url"=>$post->getEditUrl,
|
||||
'controls'=>$controls,
|
||||
|
|
@ -114,7 +114,7 @@ sub appendTemplateLabels {
|
|||
$var->{"edit.label"} = "Edit";
|
||||
$var->{'endDate.label'} = "End Date";
|
||||
$var->{'exactphrase.label'} = "Exact Phrase";
|
||||
$var->{"flat.label"} = "Flat";
|
||||
$var->{"layout.flat.label"} = "Flat";
|
||||
$var->{'image.label'} = "Image";
|
||||
$var->{'link.header.label'} = "Edit Link";
|
||||
$var->{"lock.label"} = "Lock";
|
||||
|
|
@ -123,7 +123,7 @@ sub appendTemplateLabels {
|
|||
$var->{'message.label'} = "Message";
|
||||
$var->{"next.label"} = "Next";
|
||||
$var->{'newWindow.label'} = "Open in new window?";
|
||||
$var->{"nested.label"} = "Nested";
|
||||
$var->{"layout.nested.label"} = "Nested";
|
||||
$var->{"previous.label"} = "Previous";
|
||||
$var->{"post.label"} = "Add a post.";
|
||||
$var->{'question.label'} = "Question";
|
||||
|
|
@ -144,7 +144,7 @@ sub appendTemplateLabels {
|
|||
$var->{"status.label"} = "Status";
|
||||
$var->{"thumbnail.label"} = "Thumbnail";
|
||||
$var->{"title.label"} = "Title";
|
||||
$var->{"threaded.label"} = "Threaded";
|
||||
$var->{"layout.threaded.label"} = "Threaded";
|
||||
$var->{"unlock.label"} = "Unlock";
|
||||
$var->{"unstick.label"} = "Unstick";
|
||||
$var->{"unsubscribe.label"} = "Unsubscribe";
|
||||
|
|
@ -1006,7 +1006,7 @@ sub www_viewRSS {
|
|||
from Thread
|
||||
left join asset on Thread.assetId=asset.parentId
|
||||
left join Post on Post.assetId=asset.assetId
|
||||
where Thread.parentId=".quote($self->getId)." and asset.state='published'
|
||||
where asset.parentId=".quote($self->getId)." and asset.state='published'
|
||||
and asset.className='WebGUI::Asset::Post::Thread' and Post.status='approved'
|
||||
order by ".$self->getValue("sortBy")." ".$self->getValue("sortOrder"));
|
||||
my $i = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue