diff --git a/docs/upgrades/upgrade_5.4.4-5.5.0.sql b/docs/upgrades/upgrade_5.4.4-5.5.0.sql index 3fd519bbb..c9c01c696 100644 --- a/docs/upgrades/upgrade_5.4.4-5.5.0.sql +++ b/docs/upgrades/upgrade_5.4.4-5.5.0.sql @@ -173,9 +173,9 @@ alter table forum add column views int not null default 0; alter table forum add column replies int not null default 0; alter table forum add column rating int not null default 0; alter table wobject add column forumId int; -delete from international where languageId=1 and namespace='WebGUI' and internationalId=567; -delete from international where languageId=1 and namespace='WebGUI' and internationalId=568; -delete from international where languageId=1 and namespace='WebGUI' and internationalId=569; +delete from international where namespace='WebGUI' and internationalId=567; +delete from international where namespace='WebGUI' and internationalId=568; +delete from international where namespace='WebGUI' and internationalId=569; update international set internationalId=1024, namespace='WebGUI' where internationalId=1 and namespace='Discussion'; update international set internationalId=1025, namespace='WebGUI' where internationalId=524 and namespace='Discussion'; insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1028,1,'WebGUI','Moderate posts?', 1065966284,'Asking the admin whether they wish to moderate the posts in a discussion or just allow all posts to go out.'); @@ -183,5 +183,8 @@ insert into international (internationalId,languageId,namespace,message,lastUpda insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1026,1,'WebGUI','Allow rich edit?', 1065966219,'Asking the admin whether they wish to allow rich edit in a discussion.'); update international set internationalId=1029, namespace='WebGUI' where internationalId=525 and namespace='Discussion'; update international set internationalId=1030, namespace='WebGUI' where internationalId=526 and namespace='Discussion'; +delete from international where namespace='Article' and internationalId=27; +delete from international where namespace='USS' and internationalId=28; +delete from international where namespace='USS' and internationalId=45; diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index edb952490..9420a666d 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -14,6 +14,7 @@ use strict; use Tie::CPHash; use WebGUI::Attachment; use WebGUI::DateTime; +use WebGUI::Forum::UI; use WebGUI::HTML; use WebGUI::HTMLForm; use WebGUI::Icon; @@ -352,13 +353,6 @@ sub www_editSubmissionSave { } } -#------------------------------------------------------------------- -sub www_showMessage { - return $_[0]->SUPER::www_showMessage(''.WebGUI::International::get(45,$_[0]->get("namespace")).'
' - .''.WebGUI::International::get(28,$_[0]->get("namespace")).'
'); -} - #------------------------------------------------------------------- sub www_view { my (%var, $row, $page, $p, $constraints, @submission, @content, $image, $i, $numResults, $thumbnail, $responses); @@ -499,9 +493,10 @@ sub www_viewRSS { #------------------------------------------------------------------- sub www_viewSubmission { return "" unless ($session{form}{sid}); - my ($output, $submission, $file, @data, %var, $replies); - $submission = $_[0]->getCollateral("USS_submission","USS_submissionId",$session{form}{sid}); + my ($file, @data, %var, $replies); + my $submission = $_[0]->getCollateral("USS_submission","USS_submissionId",$session{form}{sid}); return $_[0]->www_view unless ($submission->{USS_submissionId}); + my $callback = WebGUI::URL::page("func=viewSubmission&wid=".$_[0]->get("wobjectId")."&sid=".$submission->{USS_submissionId}); WebGUI::SQL->write("update USS_submission set views=views+1 where USS_submissionId=$session{form}{sid}"); $var{title} = $submission->{title}; $var{content} = WebGUI::HTML::filter($submission->{content},$_[0]->get("filterContent")); @@ -563,8 +558,14 @@ sub www_viewSubmission { $var{"attachment.url"} = $file->getURL; $var{"attachment.icon"} = $file->getIcon; $var{"attachment.name"} = $file->getFilename; - } - $var{"replies"} = WebGUI::Discussion::showThreads($_[0]); + } + if ($_[0]->get("allowDiscussion")) { + if ($session{form}{forumOp}) { + $var{"replies"} = WebGUI::Forum::UI::forumOp($callback); + } else { + $var{"replies"} = WebGUI::Forum::UI::www_viewForum($callback,$submission->{forumId}); + } + } return WebGUI::Template::process(WebGUI::Template::get($_[0]->get("submissionTemplateId"),"USS/Submission"), \%var); }