Added pre-emptive moderation and thread locking to discussions.
This commit is contained in:
parent
6e36054be1
commit
3c9e939566
7 changed files with 497 additions and 208 deletions
|
|
@ -7,6 +7,14 @@ upgrading from one version to the next, or even between multiple
|
|||
versions. Be sure to heed the warnings contained herein as they will
|
||||
save you many hours of grief.
|
||||
|
||||
4.2.0
|
||||
--------------------------------------------------------------------
|
||||
* All Discussion properties have been reset to enable the new
|
||||
discussion moderation features. If you are using discussions
|
||||
on your site, you'll need to set these properties back to
|
||||
whatever you were using. Note that none of the actual
|
||||
discussion data has been changed or lost.
|
||||
|
||||
4.1.0
|
||||
--------------------------------------------------------------------
|
||||
* Between 3.6.5 and now, much of the WebGUI filesystem has changed
|
||||
|
|
@ -18,7 +26,6 @@ save you many hours of grief.
|
|||
files (like conf files) from WebGUI.old to your new WebGUI
|
||||
folder.
|
||||
|
||||
|
||||
3.10.0 && 3.10.1
|
||||
--------------------------------------------------------------------
|
||||
* Be very very careful when applying the patch files for these
|
||||
|
|
|
|||
|
|
@ -2,3 +2,66 @@ insert into webguiVersion values ('4.2.0','upgrade',unix_timestamp());
|
|||
insert into international values (6,'Item','English','Edit Item');
|
||||
insert into settings values ('runOnRegistration','');
|
||||
insert into international values (559,'WebGUI','English','Run On Registration');
|
||||
alter table discussion add column locked int not null default 0;
|
||||
alter table discussion add column status varchar(30) not null default 'Approved';
|
||||
update international set internationalId=560, namespace='WebGUI' where internationalId=7 and namespace='UserSubmission';
|
||||
update international set internationalId=561, namespace='WebGUI' where internationalId=8 and namespace='UserSubmission';
|
||||
update international set internationalId=562, namespace='WebGUI' where internationalId=9 and namespace='UserSubmission';
|
||||
update international set internationalId=563, namespace='WebGUI' where internationalId=10 and namespace='UserSubmission';
|
||||
update international set internationalId=564, namespace='WebGUI' where internationalId=3 and namespace='MessageBoard';
|
||||
update international set internationalId=565, namespace='WebGUI' where internationalId=21 and namespace='MessageBoard';
|
||||
update international set internationalId=566, namespace='WebGUI' where internationalId=5 and namespace='MessageBoard';
|
||||
delete from international where internationalId=19 and namespace='Article';
|
||||
delete from international where internationalId=20 and namespace='Article';
|
||||
delete from international where internationalId=21 and namespace='Article';
|
||||
delete from international where namespace='UserSubmission' and internationalId=30;
|
||||
delete from international where namespace='UserSubmission' and internationalId=49;
|
||||
delete from international where namespace='UserSubmission' and internationalId=50;
|
||||
delete from international where namespace='UserSubmission' and internationalId=44;
|
||||
insert into international values (567,'WebGUI','English','Pre-emptive');
|
||||
insert into international values (568,'WebGUI','English','After-the-fact');
|
||||
insert into international values (569,'WebGUI','English','Moderation Type');
|
||||
alter table wobject add column groupToPost int not null default 2;
|
||||
alter table wobject add column editTimeout int not null default 1;
|
||||
alter table wobject add column groupToModerate int not null default 4;
|
||||
alter table wobject add column karmaPerPost int not null default 0;
|
||||
alter table wobject add column moderationType varchar(30) not null default 'after';
|
||||
alter table MessageBoard drop column editTimeout;
|
||||
alter table MessageBoard drop column groupToModerate;
|
||||
alter table MessageBoard drop column groupToPost;
|
||||
alter table MessageBoard drop column karmaPerPost;
|
||||
alter table UserSubmission drop column groupToPost;
|
||||
alter table UserSubmission drop column groupToModerate;
|
||||
alter table UserSubmission drop column editTimeout;
|
||||
alter table UserSubmission drop column karmaPerPost;
|
||||
alter table Article drop column karmaPerPost;
|
||||
alter table Article drop column editTimeout;
|
||||
alter table Article drop column groupToModerate;
|
||||
alter table Article drop column groupToPost;
|
||||
insert into international values (570,'WebGUI','English','Lock Thread');
|
||||
insert into international values (571,'WebGUI','English','Unlock Thread');
|
||||
update international set internationalId=572, namespace='WebGUI' where namespace='UserSubmission' and internationalId=24;
|
||||
update international set internationalId=573, namespace='WebGUI' where namespace='UserSubmission' and internationalId=25;
|
||||
update international set internationalId=574, namespace='WebGUI' where namespace='UserSubmission' and internationalId=26;
|
||||
insert into international values (575,'WebGUI','English','Edit');
|
||||
insert into international values (576,'WebGUI','English','Delete');
|
||||
update international set internationalId=577, namespace='WebGUI' where namespace='MessageBoard' and internationalId=13;
|
||||
delete from international where namespace='UserSubmission' and internationalId=42;
|
||||
delete from international where namespace='UserSubmission' and internationalId=43;
|
||||
delete from international where namespace='Article' and internationalId=25;
|
||||
delete from international where namespace='Article' and internationalId=26;
|
||||
insert into international values (578,'WebGUI','English','You have a pending message to approve.');
|
||||
insert into international values (579,'WebGUI','English','Your message has been approved.');
|
||||
insert into international values (580,'WebGUI','English','Your message has been denied.');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,19 @@ use WebGUI::DateTime;
|
|||
use WebGUI::HTML;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::International;
|
||||
use WebGUI::MessageLog;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Search;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::User;
|
||||
|
||||
our %status =("Approved"=>WebGUI::International::get(560),
|
||||
"Denied"=>WebGUI::International::get(561),
|
||||
"Pending"=>WebGUI::International::get(562));
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _deleteReplyTree {
|
||||
my ($sth, %data, $messageId);
|
||||
|
|
@ -49,6 +55,85 @@ sub _duplicateReplyTree {
|
|||
$sth->finish;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _lockReplyTree {
|
||||
my ($sth, %data, $messageId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$sth = WebGUI::SQL->read("select messageId from discussion where pid=$_[0] order by messageId");
|
||||
while (%data = $sth->hash) {
|
||||
_lockReplyTree($data{messageId});
|
||||
WebGUI::SQL->write("update discussion set locked=1 where messageId=$data{messageId}");
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _unlockReplyTree {
|
||||
my ($sth, %data, $messageId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$sth = WebGUI::SQL->read("select messageId from discussion where pid=$_[0] order by messageId");
|
||||
while (%data = $sth->hash) {
|
||||
_unlockReplyTree($data{messageId});
|
||||
WebGUI::SQL->write("update discussion set locked=0 where messageId=$data{messageId}");
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub approvePost {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = getMessage($session{form}{mid});
|
||||
WebGUI::SQL->write("update discussion set status='Approved' where messageId=$session{form}{mid}");
|
||||
WebGUI::MessageLog::addInternationalizedEntry($message{userId},'',
|
||||
WebGUI::URL::page('func=showMessage&wid='.$session{form}{wid}.'&sid='
|
||||
.$session{form}{sid}.'&mid='.$session{form}{mid}), 579);
|
||||
WebGUI::MessageLog::completeEntry($session{form}{mlog});
|
||||
return WebGUI::Operation::www_viewMessageLog();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub canEditMessage {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = getMessage($_[1]);
|
||||
if ( # is the message owner
|
||||
(
|
||||
(time()-$message{dateOfPost}) < 3600*$_[0]->get("editTimeout")
|
||||
&& $message{userId} eq $session{user}{userId}
|
||||
&& !($message{locked})
|
||||
)
|
||||
# is a moderator
|
||||
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))
|
||||
) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub canPostReply {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost")) && !(${$_[1]}{locked}) && ${$_[1]}{status} eq "Approved") {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub denyPost {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = getMessage($session{form}{mid});
|
||||
WebGUI::SQL->write("update discussion set status='Denied' where messageId=$session{form}{mid}");
|
||||
WebGUI::MessageLog::addInternationalizedEntry($message{userId},'',
|
||||
WebGUI::URL::page('func=showMessage&wid='.$session{form}{wid}.'&sid='
|
||||
.$session{form}{sid}.'&mid='.$session{form}{mid}), 580);
|
||||
WebGUI::MessageLog::completeEntry($session{form}{mlog});
|
||||
return WebGUI::Operation::www_viewMessageLog();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my ($sth, %data, $newMessageId, $oldSubId, $newSubId);
|
||||
|
|
@ -57,7 +142,9 @@ sub duplicate {
|
|||
$sth = WebGUI::SQL->read("select * from discussion where wobjectId=$_[0] and pid=0 and subId=$oldSubId order by messageId");
|
||||
while (%data = $sth->hash) {
|
||||
$newMessageId = getNextId("messageId");
|
||||
WebGUI::SQL->write("insert into discussion values ($newMessageId, $newMessageId, $_[1], 0, $data{userId}, ".quote($data{username}).", ".quote($data{subject}).", ".quote($data{message}).", $data{dateOfPost}, $newSubId)");
|
||||
WebGUI::SQL->write("insert into discussion values ($newMessageId, $newMessageId, $_[1], 0,
|
||||
$data{userId}, ".quote($data{username}).", ".quote($data{subject}).", "
|
||||
.quote($data{message}).", $data{dateOfPost}, $newSubId)");
|
||||
_duplicateReplyTree($data{messageId},$newMessageId,$newMessageId,$_[1],$newSubId);
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -99,6 +186,7 @@ sub formatHeader {
|
|||
<a href="'.WebGUI::URL::page('op=viewProfile&uid='.$_[1]).'">'.$_[2].'</a><br>' if ($_[1] && $_[2] ne "");
|
||||
$output .= "<b>".WebGUI::International::get(239)."</b> ".epochToHuman($_[3],"%z %Z")."<br>" if ($_[3]);
|
||||
$output .= "<b>".WebGUI::International::get(514).":</b> ".$_[4]."<br>" if ($_[4]);
|
||||
$output .= "<b>".WebGUI::International::get(553).":</b> ".$_[6]."<br>" if ($_[6]);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +217,13 @@ sub getMessage {
|
|||
return %message;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub lockThread {
|
||||
_lockReplyTree($session{form}{mid});
|
||||
WebGUI::SQL->write("update discussion set locked=1 where messageId=$session{form}{mid}");
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub post {
|
||||
my ($html, $header, $footer, $f, %message);
|
||||
|
|
@ -137,30 +232,32 @@ sub post {
|
|||
if ($session{form}{replyTo} ne "") { # is a reply
|
||||
$header = WebGUI::International::get(234);
|
||||
%message = getMessage($session{form}{replyTo});
|
||||
$footer = formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views})
|
||||
$footer = formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views},
|
||||
'',$message{status})
|
||||
.'<p>'.formatMessage($message{message});
|
||||
$message{message} = "";
|
||||
$message{subject} = formatSubject("Re: ".$message{subject}) unless ($message{subject} =~ /^Re:/);
|
||||
$session{form}{mid} = "new";
|
||||
$f->hidden("replyTo",$session{form}{replyTo});
|
||||
if ($session{user}{userId} == 1) {
|
||||
$f->text("visitorName",WebGUI::International::get(438));
|
||||
if ($session{user}{userId} == 1) {
|
||||
$f->text("visitorName",WebGUI::International::get(438));
|
||||
}
|
||||
} elsif ($session{form}{mid} eq "new") { # is an entirely new thread
|
||||
$header = WebGUI::International::get(231);
|
||||
if ($session{user}{userId} == 1) {
|
||||
$f->text("visitorName",WebGUI::International::get(438));
|
||||
}
|
||||
$f->text("visitorName",WebGUI::International::get(438));
|
||||
}
|
||||
} else { # is editing an existing message
|
||||
$header = WebGUI::International::get(228);
|
||||
%message = getMessage($session{form}{mid});
|
||||
$footer = formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views})
|
||||
$footer = formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views},
|
||||
'',$message{status})
|
||||
.'<p>'.formatMessage($message{message});
|
||||
$message{subject} = formatSubject($message{subject});
|
||||
}
|
||||
$f->hidden("func","postSave");
|
||||
$f->hidden("func","postSave");
|
||||
$f->hidden("wid",$session{form}{wid});
|
||||
$f->hidden("sid",$session{form}{sid});
|
||||
$f->hidden("sid",$session{form}{sid});
|
||||
$f->hidden("mid",$session{form}{mid});
|
||||
$f->text("subject",WebGUI::International::get(229),$message{subject});
|
||||
$f->HTMLArea("message",WebGUI::International::get(230),$message{message});
|
||||
|
|
@ -173,21 +270,21 @@ sub post {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub postSave {
|
||||
my ($u, $rid, $username, $pid);
|
||||
my ($u, $rid, $status, $username, $pid);
|
||||
if ($session{form}{subject} eq "") {
|
||||
$session{form}{subject} = WebGUI::International::get(232);
|
||||
}
|
||||
if ($session{form}{message} eq "") {
|
||||
$session{form}{subject} .= ' '.WebGUI::International::get(233);
|
||||
$session{form}{subject} .= ' '.WebGUI::International::get(233);
|
||||
}
|
||||
if ($session{form}{mid} eq "new") {
|
||||
if ($session{user}{userId} == 1) {
|
||||
if ($session{form}{visitorName} eq "") {
|
||||
$username = $session{user}{username};
|
||||
} else {
|
||||
if ($session{user}{userId} == 1) {
|
||||
if ($session{form}{visitorName} eq "") {
|
||||
$username = $session{user}{username};
|
||||
} else {
|
||||
$username = $session{form}{visitorName};
|
||||
}
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
$username = $session{user}{username};
|
||||
}
|
||||
if ($session{form}{sid} eq "") {
|
||||
|
|
@ -201,16 +298,28 @@ sub postSave {
|
|||
$rid = $session{form}{mid};
|
||||
$pid = 0;
|
||||
}
|
||||
WebGUI::SQL->write("insert into discussion (messageId, wobjectId, subId, rid, pid, userId, username) values
|
||||
($session{form}{mid},$session{form}{wid},$session{form}{sid},$rid,$pid,$session{user}{userId},".quote($username).")");
|
||||
if ($_[0]->get("moderationType") eq "before") {
|
||||
$status = "Pending";
|
||||
WebGUI::MessageLog::addInternationalizedEntry('',$_[0]->get("groupToModerate"),
|
||||
WebGUI::URL::page('func=showMessage&wid='.$session{form}{wid}.'&sid='
|
||||
.$session{form}{sid}.'&mid='.$session{form}{mid}),
|
||||
578,'WebGUI','pending');
|
||||
} else {
|
||||
$status = "Approved";
|
||||
}
|
||||
WebGUI::SQL->write("insert into discussion (messageId, wobjectId, subId, rid, pid, userId, username, status) values
|
||||
($session{form}{mid},$session{form}{wid},$session{form}{sid},$rid,$pid,$session{user}{userId},"
|
||||
.quote($username).", '$status')");
|
||||
} elsif ($session{setting}{addEditStampToPosts}) {
|
||||
$session{form}{message} = "\n --- (Edited at ".localtime(time)." by $session{user}{username}) --- \n\n".$session{form}{message};
|
||||
$session{form}{message} = "\n --- (Edited at ".localtime(time)." by $session{user}{username}) --- \n\n"
|
||||
.$session{form}{message};
|
||||
}
|
||||
WebGUI::SQL->write("update discussion set subject=".quote($session{form}{subject}).",
|
||||
message=".quote($session{form}{message}).", dateOfPost=".time()." where messageId=$session{form}{mid}");
|
||||
if ($session{setting}{useKarma}) {
|
||||
$u = WebGUI::User->new($session{user}{userId});
|
||||
$u->karma($_[0],"Discussion (".$session{form}{wid}."/".$session{form}{sid}.")","Made a post.");
|
||||
$u->karma($_[0]->get("karmaPerPost"),"Discussion ("
|
||||
.$session{form}{wid}."/".$session{form}{sid}.")","Made a post.");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
@ -263,22 +372,33 @@ sub search {
|
|||
sub showMessage {
|
||||
my (@data, $html, %message, $sqlAdd);
|
||||
tie %message, 'Tie::CPHash';
|
||||
if ($session{form}{mid} eq "") {
|
||||
($session{form}{mid}) = WebGUI::SQL->quickArray("select min(messageId) from discussion
|
||||
where wobjectId=$session{form}{wid}");
|
||||
}
|
||||
if ($session{form}{sid}) {
|
||||
$sqlAdd = " and subId=$session{form}{sid}";
|
||||
}
|
||||
if ($session{form}{mid} eq "") {
|
||||
($session{form}{mid}) = WebGUI::SQL->quickArray("select min(messageId) from discussion where wobjectId=$session{form}{wid}".$sqlAdd);
|
||||
($session{form}{mid}) = WebGUI::SQL->quickArray("select min(messageId) from discussion
|
||||
where wobjectId=$session{form}{wid}".$sqlAdd);
|
||||
}
|
||||
WebGUI::SQL->write("update discussion set views=views+1 where messageId=$session{form}{mid}");
|
||||
%message = getMessage($session{form}{mid});
|
||||
if ($message{messageId}) {
|
||||
$html .= '<h1>'.$message{subject}.'</h1>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
|
||||
$html .= formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},$message{views});
|
||||
$html .= formatHeader($message{subject},$message{userId},$message{username},$message{dateOfPost},
|
||||
$message{views},'',$message{status});
|
||||
$html .= '</td>';
|
||||
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from discussion
|
||||
where wobjectId=$message{wobjectId} and pid=0 and messageId<$message{rid}".$sqlAdd);
|
||||
if (canPostReply($_[1],\%message)) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=post&replyTo='.$session{form}{mid}.'&wid='
|
||||
.$session{form}{wid}.'&sid='.$session{form}{sid})
|
||||
.'">'.WebGUI::International::get(577).'</a><br>';
|
||||
}
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&sid='.$session{form}{sid}.'&wid='.
|
||||
$session{form}{wid}).'">« '.WebGUI::International::get(513).'</a><br>';
|
||||
|
|
@ -289,6 +409,38 @@ sub showMessage {
|
|||
$html .= '<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&sid='.$session{form}{sid}.'&wid='.
|
||||
$session{form}{wid}).'">'.WebGUI::International::get(512).' »</a><br>';
|
||||
}
|
||||
if (canEditMessage($_[1],$session{form}{mid})) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=post&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'
|
||||
.WebGUI::International::get(575).'</a><br>';
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'
|
||||
.WebGUI::International::get(576).'</a><br>';
|
||||
}
|
||||
if (WebGUI::Privilege::isInGroup($_[1]->get("groupToModerate"))) {
|
||||
unless ($message{locked}) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=lockThread&wid='.$session{form}{wid}
|
||||
.'&sid='.$session{form}{sid}.'&mid='.$session{form}{mid}).'">'
|
||||
.WebGUI::International::get(570).'</a><br>';
|
||||
} else {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=unlockThread&wid='.$session{form}{wid}
|
||||
.'&sid='.$session{form}{sid}.'&mid='.$session{form}{mid}).'">'
|
||||
.WebGUI::International::get(571).'</a><br>';
|
||||
}
|
||||
if ($message{status} ne "Approved") {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=approvePost&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mid='.$session{form}{mid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(572).'</a><br>';
|
||||
$html .= '<a href="'.WebGUI::URL::page('op=viewMessageLog').'">'.
|
||||
WebGUI::International::get(573).'</a><br>';
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=denyPost&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mid='.$session{form}{mid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(574).'</a><br>';
|
||||
}
|
||||
|
||||
}
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=search&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'
|
||||
.WebGUI::International::get(364).'</a><br>';
|
||||
$html .= $_[0];
|
||||
$html .= '</tr><tr><td class="tableData">';
|
||||
$html .= formatMessage($message{message}).'<p>';
|
||||
|
|
@ -311,7 +463,7 @@ sub showReplyTree {
|
|||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(244).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(245).'</td></tr>';
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId,status
|
||||
from discussion where messageId=$message{rid}");
|
||||
$data[1] = WebGUI::HTML::filter($data[1],'all');
|
||||
$html .= '<tr';
|
||||
|
|
@ -319,7 +471,11 @@ sub showReplyTree {
|
|||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
||||
$message{wobjectId}).'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.
|
||||
$message{wobjectId}).'">'.substr($data[1],0,30).'</a>';
|
||||
if ($data[4] == $session{user}{userId}) {
|
||||
$html .= ' ('.$status{$data[5]}.')';
|
||||
}
|
||||
$html .= '</td><td class="tableData"><a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
|
||||
'</a></td><td class="tableData">'.
|
||||
epochToHuman($data[3],"%z %Z").'</td></tr>';
|
||||
|
|
@ -329,13 +485,15 @@ sub showReplyTree {
|
|||
if ($session{form}{sid}) {
|
||||
$sql .= " and subId=$session{form}{sid}";
|
||||
}
|
||||
$sql .= " and (status='Approved' or userId=$session{user}{userId})";
|
||||
$sql .= " order by messageId";
|
||||
$sth = WebGUI::SQL->read($sql);
|
||||
while (%data = $sth->hash) {
|
||||
unless ($data{messageId} == $session{form}{mid} && $data{messageId} == $data{rid}) { # don't show first message.
|
||||
$html .= '<tr><td class="tableHeader">';
|
||||
$html .= formatHeader($data{subject},$data{userId},$data{username},$data{dateOfPost},$data{views},
|
||||
WebGUI::URL::page('func=showMessage&mid='.$data{messageId}.'&wid='.$session{form}{wid}));
|
||||
WebGUI::URL::page('func=showMessage&mid='.$data{messageId}.'&wid='.$session{form}{wid}),
|
||||
$data{status});
|
||||
$html .= '</td></tr><tr class="tableData"><td ';
|
||||
if ($data{messageId} == $message{messageId}) {
|
||||
$html .= 'class="highlight"';
|
||||
|
|
@ -355,6 +513,7 @@ sub showThreads {
|
|||
my ($sth, %data, $html, $sql);
|
||||
$sql = "select * from discussion where wobjectId=$session{form}{wid}";
|
||||
$sql .= " and subId=$session{form}{sid}" if ($session{form}{sid});
|
||||
$sql .= " and (status='Approved' or userId=$session{user}{userId})";
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
if ($session{user}{discussionLayout} eq "threaded") {
|
||||
$sql .= " and pid=0 order by dateOfPost desc";
|
||||
|
|
@ -370,7 +529,11 @@ sub showThreads {
|
|||
}
|
||||
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.
|
||||
$data{messageId}.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data{subject},0,30).
|
||||
'</a></td><td class="tableData"><a href="'.
|
||||
'</a>';
|
||||
if ($data{userId} == $session{user}{userId}) {
|
||||
$html .= ' ('.$status{$data{status}}.')';
|
||||
}
|
||||
$html .= '</td><td class="tableData"><a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$data{userId}).'">'.$data{username}.
|
||||
'</a></td><td class="tableData">'.epochToHuman($data{dateOfPost},"%z %Z").
|
||||
'</td></tr>';
|
||||
|
|
@ -382,7 +545,8 @@ sub showThreads {
|
|||
while (%data = $sth->hash) {
|
||||
$html .= '<tr><td class="tableHeader">';
|
||||
$html .= formatHeader($data{subject},$data{userId},$data{username},$data{dateOfPost},$data{views},
|
||||
WebGUI::URL::page('func=showMessage&mid='.$data{messageId}.'&wid='.$session{form}{wid}));
|
||||
WebGUI::URL::page('func=showMessage&mid='.$data{messageId}.'&wid='.$session{form}{wid}),
|
||||
$data{status});
|
||||
$html .= '</td></tr><tr class="tableData"><td ';
|
||||
if ($data{messageId} eq $session{form}{mid}) {
|
||||
$html .= 'class="highlight"';
|
||||
|
|
@ -401,19 +565,35 @@ sub traverseReplyTree {
|
|||
for ($i=0;$i<=$_[1];$i++) {
|
||||
$depth .= " ";
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where pid=$_[0] order by messageId");
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId,status from discussion where pid=$_[0]
|
||||
and (status='Approved' or userId=$session{user}{userId}) order by messageId");
|
||||
while (@data = $sth->array) {
|
||||
$data[1] = WebGUI::HTML::filter($data[1],'all');
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $data[0]) {
|
||||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData">'.$depth.'<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%z %Z").'</td></tr>';
|
||||
$html .= '><td class="tableData">'.$depth.'<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0]
|
||||
.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data[1],0,30).'</a>';
|
||||
if ($data[4] == $session{user}{userId}) {
|
||||
$html .= ' ('.$status{$data[5]}.')';
|
||||
}
|
||||
$html .= '</td><td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'
|
||||
.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%z %Z").'</td></tr>';
|
||||
$html .= traverseReplyTree($data[0],$_[1]+1);
|
||||
}
|
||||
$sth->finish;
|
||||
return $html;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub unlockThread {
|
||||
_unlockReplyTree($session{form}{mid});
|
||||
WebGUI::SQL->write("update discussion set locked=0 where messageId=$session{form}{mid}");
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -87,6 +87,39 @@ sub description {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 discussionProperties ( )
|
||||
|
||||
Returns a formRow list of discussion properties, which may be
|
||||
attached to any Wobject.
|
||||
|
||||
=cut
|
||||
|
||||
sub discussionProperties {
|
||||
my ($f,$editTimeout,$groupToModerate,%moderationType,$moderationType);
|
||||
%moderationType = (before=>WebGUI::International::get(567),after=>WebGUI::International::get(568));
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
if ($_[0]->get("wobjectId") eq "new") {
|
||||
$editTimeout = 1;
|
||||
$moderationType = 'after';
|
||||
} else {
|
||||
$editTimeout = $_[0]->get("editTimeout");
|
||||
$moderationType = $_[0]->get("moderationType");
|
||||
}
|
||||
$groupToModerate = $_[0]->get("groupToModerate") || 4;
|
||||
$f->group("groupToPost",WebGUI::International::get(564),[$_[0]->get("groupToPost")]);
|
||||
$f->integer("editTimeout",WebGUI::International::get(566),$editTimeout);
|
||||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaPerPost",WebGUI::International::get(541),$_[0]->get("karmaPerPost"));
|
||||
} else {
|
||||
$f->hidden("karmaPerPost",$_[0]->get("karmaPerPost"));
|
||||
}
|
||||
$f->group("groupToModerate",WebGUI::International::get(565),[$groupToModerate]);
|
||||
$f->select("moderationType",\%moderationType,WebGUI::International::get(569),[$moderationType]);
|
||||
return $f->printRowsOnly;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 displayTitle ( )
|
||||
|
||||
Returns this instance's title if displayTitle is set to yes.
|
||||
|
|
@ -293,7 +326,7 @@ sub set {
|
|||
$sql = "update wobject set";
|
||||
foreach $key (keys %{$_[1]}) {
|
||||
$_[0]->{_property}{$key} = ${$_[1]}{$key};
|
||||
if (isIn($key, qw(title displayTitle description processMacros pageId templatePosition startDate endDate sequenceNumber))) {
|
||||
if (isIn($key, qw(moderationType groupToModerate groupToPost karmaPerPost editTimeout title displayTitle description processMacros pageId templatePosition startDate endDate sequenceNumber))) {
|
||||
$sql .= " ".$key."=".quote(${$_[1]}{$key}).",";
|
||||
}
|
||||
if (isIn($key, @{$_[2]})) {
|
||||
|
|
@ -440,7 +473,12 @@ sub www_editSave {
|
|||
templatePosition=>$templatePosition,
|
||||
startDate=>$startDate,
|
||||
endDate=>$endDate,
|
||||
description=>$session{form}{description}
|
||||
description=>$session{form}{description},
|
||||
karmaPerPost=>$session{form}{karmaPerPost},
|
||||
groupToPost=>$session{form}{groupToPost},
|
||||
groupToModerate=>$session{form}{groupToModerate},
|
||||
editTimeout=>$session{form}{editTimeout},
|
||||
moderationType=>$session{form}{moderationType}
|
||||
});
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,22 +30,6 @@ our $namespace = "Article";
|
|||
our $name = WebGUI::International::get(1,$namespace);
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _canEditMessage {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = WebGUI::Discussion::getMessage($_[1]);
|
||||
if (
|
||||
(time()-$message{dateOfPost}) < 3600*$_[0]->get("editTimeout")
|
||||
&& $message{userId} eq $session{user}{userId}
|
||||
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))
|
||||
) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my ($file, $w);
|
||||
|
|
@ -62,11 +46,7 @@ sub duplicate {
|
|||
attachment=>$_[0]->get("attachment"),
|
||||
convertCarriageReturns=>$_[0]->get("convertCarriageReturns"),
|
||||
alignImage=>$_[0]->get("alignImage"),
|
||||
allowDiscussion=>$_[0]->get("allowDiscussion"),
|
||||
groupToPost=>$_[0]->get("groupToPost"),
|
||||
groupToModerate=>$_[0]->get("groupToModerate"),
|
||||
karmaPerPost=>$_[0]->get("karmaPerPost"),
|
||||
editTimeout=>$_[0]->get("editTimeout")
|
||||
allowDiscussion=>$_[0]->get("allowDiscussion")
|
||||
});
|
||||
WebGUI::Discussion::duplicate($_[0]->get("wobjectId"),$w->get("wobjectId"));
|
||||
}
|
||||
|
|
@ -88,8 +68,16 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub set {
|
||||
$_[0]->SUPER::set($_[1],
|
||||
[qw(karmaPerPost image linkTitle linkURL attachment convertCarriageReturns alignImage allowDiscussion groupToPost groupToModerate editTimeout)]);
|
||||
$_[0]->SUPER::set($_[1],[qw(image linkTitle linkURL attachment convertCarriageReturns alignImage allowDiscussion)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_approvePost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::approvePost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -124,7 +112,7 @@ sub www_deleteImage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessage {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -133,13 +121,22 @@ sub www_deleteMessage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessageConfirm {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessageConfirm();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_denyPost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::denyPost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my ($output, $editTimeout, $groupToModerate, %hash, $f);
|
||||
|
|
@ -177,14 +174,7 @@ sub www_edit {
|
|||
$f->yesNo("convertCarriageReturns",WebGUI::International::get(10,$namespace),$_[0]->get("convertCarriageReturns")
|
||||
,'',' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
|
||||
$f->yesNo("allowDiscussion",WebGUI::International::get(18,$namespace),$_[0]->get("allowDiscussion"));
|
||||
$f->group("groupToPost",WebGUI::International::get(19,$namespace),[$_[0]->get("groupToPost")]);
|
||||
$f->group("groupToModerate",WebGUI::International::get(20,$namespace),[$groupToModerate]);
|
||||
$f->integer("editTimeout",WebGUI::International::get(21,$namespace),$editTimeout);
|
||||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaPerPost",WebGUI::International::get(541),$_[0]->get("karmaPerPost"));
|
||||
} else {
|
||||
$f->hidden("karmaPerPost",$_[0]->get("karmaPerPost"));
|
||||
}
|
||||
$f->raw($_[0]->SUPER::discussionProperties);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -208,10 +198,6 @@ sub www_editSave {
|
|||
$property{linkTitle} = $session{form}{linkTitle};
|
||||
$property{linkURL} = $session{form}{linkURL};
|
||||
$property{allowDiscussion} = $session{form}{allowDiscussion};
|
||||
$property{groupToModerate} = $session{form}{groupToModerate};
|
||||
$property{karmaPerPost} = $session{form}{karmaPerPost};
|
||||
$property{groupToPost} = $session{form}{groupToPost};
|
||||
$property{editTimeout} = $session{form}{editTimeout};
|
||||
$_[0]->set(\%property);
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -219,9 +205,19 @@ sub www_editSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_lockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::lockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_post {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
return WebGUI::Discussion::post();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -230,8 +226,8 @@ sub www_post {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_postSave {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
WebGUI::Discussion::postSave($_[0]->get("karmaPerPost"));
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
WebGUI::Discussion::postSave($_[0]);
|
||||
return $_[0]->www_showMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -243,20 +239,22 @@ sub www_showMessage {
|
|||
my ($submenu, $output, $defaultMid);
|
||||
($defaultMid) = WebGUI::SQL->quickArray("select min(messageId) from discussion where wobjectId=$session{form}{wid}");
|
||||
$session{form}{mid} = $defaultMid if ($session{form}{mid} eq "");
|
||||
$submenu = '<a href="'.WebGUI::URL::page('func=post&replyTo='.$session{form}{mid}.'&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(24,$namespace).'</a><br>';
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=post&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(25,$namespace).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(26,$namespace).'</a><br>';
|
||||
}
|
||||
$submenu .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(27,$namespace).'</a><br>';
|
||||
$output = WebGUI::Discussion::showMessage($submenu);
|
||||
$submenu = '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(27,$namespace).'</a><br>';
|
||||
$output = WebGUI::Discussion::showMessage($submenu,$_[0]);
|
||||
$output .= WebGUI::Discussion::showThreads();
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_unlockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::unlockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($file, $output, $image, $replies, $body);
|
||||
|
|
|
|||
|
|
@ -29,21 +29,11 @@ our @ISA = qw(WebGUI::Wobject);
|
|||
our $namespace = "MessageBoard";
|
||||
our $name = WebGUI::International::get(2,$namespace);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _canEditMessage {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = WebGUI::Discussion::getMessage($_[1]);
|
||||
if (
|
||||
(time()-$message{dateOfPost}) < 3600*$_[0]->get("editTimeout")
|
||||
&& $message{userId} eq $session{user}{userId}
|
||||
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))
|
||||
) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
our %status =("Approved"=>WebGUI::International::get(560),
|
||||
"Denied"=>WebGUI::International::get(561),
|
||||
"Pending"=>WebGUI::International::get(562));
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
|
|
@ -51,11 +41,7 @@ sub duplicate {
|
|||
$w = $_[0]->SUPER::duplicate($_[1]);
|
||||
$w = WebGUI::Wobject::MessageBoard->new({wobjectId=>$w,namespace=>$namespace});
|
||||
$w->set({
|
||||
groupToPost=>$_[0]->get("groupToPost"),
|
||||
messagesPerPage=>$_[0]->get("messagesPerPage"),
|
||||
editTimeout=>$_[0]->get("editTimeout"),
|
||||
groupToModerate=>$_[0]->get("groupToModerate"),
|
||||
karmaPerPost=>$_[0]->get("karmaPerPost")
|
||||
messagesPerPage=>$_[0]->get("messagesPerPage")
|
||||
});
|
||||
WebGUI::Discussion::duplicate($_[0]->get("wobjectId"),$w->get("wobjectId"));
|
||||
}
|
||||
|
|
@ -77,7 +63,16 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub set {
|
||||
$_[0]->SUPER::set($_[1],[qw(editTimeout karmaPerPost groupToPost groupToModerate messagesPerPage)]);
|
||||
$_[0]->SUPER::set($_[1],[qw(messagesPerPage)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_approvePost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::approvePost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -92,7 +87,7 @@ sub www_copy {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessage {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -101,36 +96,32 @@ sub www_deleteMessage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessageConfirm {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessageConfirm();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_denyPost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::denyPost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my ($output, $f, $groupToModerate, $messagesPerPage, $editTimeout);
|
||||
my ($output, $f, $messagesPerPage);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
if ($_[0]->get("wobjectId") eq "new") {
|
||||
$editTimeout = 1;
|
||||
} else {
|
||||
$editTimeout = $_[0]->get("editTimeout");
|
||||
}
|
||||
$groupToModerate = $_[0]->get("groupToModerate") || 4;
|
||||
$messagesPerPage = $_[0]->get("messagesPerPage") || 50;
|
||||
$output = helpIcon(1,$namespace);
|
||||
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->group("groupToPost",WebGUI::International::get(3,$namespace),[$_[0]->get("groupToPost")]);
|
||||
$f->group("groupToModerate",WebGUI::International::get(21,$namespace),[$groupToModerate]);
|
||||
$f->integer("messagesPerPage",WebGUI::International::get(4,$namespace),$messagesPerPage);
|
||||
$f->integer("editTimeout",WebGUI::International::get(5,$namespace),$editTimeout);
|
||||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaPerPost",WebGUI::International::get(541),$_[0]->get("karmaPerPost"));
|
||||
} else {
|
||||
$f->hidden("karmaPerPost",$_[0]->get("karmaPerPost"));
|
||||
}
|
||||
$f->raw($_[0]->SUPER::discussionProperties);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -144,11 +135,7 @@ sub www_editSave {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$_[0]->SUPER::www_editSave();
|
||||
$_[0]->set({
|
||||
messagesPerPage=>$session{form}{messagesPerPage},
|
||||
groupToPost=>$session{form}{groupToPost},
|
||||
editTimeout=>$session{form}{editTimeout},
|
||||
karmaPerPost=>$session{form}{karmaPerPost},
|
||||
groupToModerate=>$session{form}{groupToModerate}
|
||||
messagesPerPage=>$session{form}{messagesPerPage}
|
||||
});
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -156,9 +143,19 @@ sub www_editSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_lockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::lockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_post {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
return WebGUI::Discussion::post();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -167,8 +164,8 @@ sub www_post {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_postSave {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
WebGUI::Discussion::postSave($_[0]->get("karmaPerPost"));
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
WebGUI::Discussion::postSave($_[0]);
|
||||
return $_[0]->www_showMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -183,21 +180,22 @@ sub www_search {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_showMessage {
|
||||
my ($output, $submenu);
|
||||
$submenu = '<a href="'.WebGUI::URL::page('func=post&replyTo='.$session{form}{mid}.'&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(13,$namespace).'</a><br>';
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=post&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(12,$namespace).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(22,$namespace).'</a><br>';
|
||||
}
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=search&wid='.$_[0]->get("wobjectId")).'">'.WebGUI::International::get(364).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(11,$namespace).'</a><br>';
|
||||
$output = WebGUI::Discussion::showMessage($submenu);
|
||||
$submenu = '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(11,$namespace).'</a><br>';
|
||||
$output = WebGUI::Discussion::showMessage($submenu,$_[0]);
|
||||
$output .= WebGUI::Discussion::showReplyTree();
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_unlockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::unlockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($sth, %data, $html, $i, $pn, $lastId, @last, $replies);
|
||||
|
|
@ -225,27 +223,36 @@ sub www_view {
|
|||
<td class="tableHeader">'.WebGUI::International::get(514).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(19,$namespace).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(20,$namespace).'</td></tr>';
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId,views
|
||||
from discussion where wobjectId=".$_[0]->get("wobjectId")." and pid=0 order by messageId desc");
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId,views,status
|
||||
from discussion where wobjectId=".$_[0]->get("wobjectId")." and pid=0
|
||||
and (status='Approved' or userId=$session{user}{userId}) order by messageId desc");
|
||||
while (%data = $sth->hash) {
|
||||
$data{subject} = WebGUI::Discussion::formatSubject($data{subject});
|
||||
if ($i >= ($_[0]->get("messagesPerPage")*$pn) && $i < ($_[0]->get("messagesPerPage")*($pn+1))) {
|
||||
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId
|
||||
from discussion where wobjectId=".$_[0]->get("wobjectId")." and rid=$data{messageId} order by dateOfPost desc");
|
||||
from discussion where wobjectId=".$_[0]->get("wobjectId")." and rid=$data{messageId}
|
||||
and status='Approved' order by dateOfPost desc");
|
||||
$last[3] = WebGUI::HTML::filter($last[3],'all');
|
||||
($replies) = WebGUI::SQL->quickArray("select count(*) from discussion where rid=$data{messageId}");
|
||||
($replies) = WebGUI::SQL->quickArray("select count(*) from discussion
|
||||
where rid=$data{messageId} and status='Approved'");
|
||||
$replies--;
|
||||
$html .= '<tr><td class="tableData"><a
|
||||
href="'.WebGUI::URL::page('func=showMessage&mid='.$data{messageId}.'&wid='.$_[0]->get("wobjectId"))
|
||||
.'">'.substr($data{subject},0,30).'</a></td>
|
||||
<td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data{userId}).'">'.$data{username}.'</a></td>
|
||||
.'">'.substr($data{subject},0,30).'</a>';
|
||||
if ($data{userId} == $session{user}{userId}) {
|
||||
$html .= ' ('.$status{$data{status}}.')';
|
||||
}
|
||||
$html .= '</td>
|
||||
<td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data{userId}).'">'
|
||||
.$data{username}.'</a></td>
|
||||
<td class="tableData">'.epochToHuman($data{dateOfPost},"%z %Z").'</td>
|
||||
<td class="tableData">'.$data{views}.'</td>
|
||||
<td class="tableData">'.$replies.'</td>
|
||||
<td class="tableData"><span style="font-size: 8pt;"><a
|
||||
href="'.WebGUI::URL::page('func=showMessage&mid='.$last[0].'&wid='.$_[0]->get("wobjectId")).'">'
|
||||
.substr($last[3],0,30).'</a>
|
||||
@ '.epochToHuman($last[1],"%z %Z").' by <a href="'.WebGUI::URL::page('op=viewProfile&uid='.$last[4]).'">'.$last[2].'</a>
|
||||
@ '.epochToHuman($last[1],"%z %Z").' by <a href="'
|
||||
.WebGUI::URL::page('op=viewProfile&uid='.$last[4]).'">'.$last[2].'</a>
|
||||
</span></td></tr>';
|
||||
}
|
||||
$i++;
|
||||
|
|
|
|||
|
|
@ -34,25 +34,9 @@ our @ISA = qw(WebGUI::Wobject);
|
|||
our $namespace = "UserSubmission";
|
||||
our $name = WebGUI::International::get(29,$namespace);
|
||||
|
||||
our %submissionStatus =("Approved"=>WebGUI::International::get(7,$namespace),
|
||||
"Denied"=>WebGUI::International::get(8,$namespace),
|
||||
"Pending"=>WebGUI::International::get(9,$namespace));
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _canEditMessage {
|
||||
my (%message);
|
||||
tie %message, 'Tie::CPHash';
|
||||
%message = WebGUI::Discussion::getMessage($_[1]);
|
||||
if (
|
||||
(time()-$message{dateOfPost}) < 3600*$_[0]->get("editTimeout")
|
||||
&& $message{userId} eq $session{user}{userId}
|
||||
|| WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))
|
||||
) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
our %submissionStatus =("Approved"=>WebGUI::International::get(560),
|
||||
"Denied"=>WebGUI::International::get(561),
|
||||
"Pending"=>WebGUI::International::get(562));
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _photogalleryView {
|
||||
|
|
@ -213,13 +197,9 @@ sub duplicate {
|
|||
defaultStatus=>$_[0]->get("defaultStatus"),
|
||||
groupToApprove=>$_[0]->get("groupToApprove"),
|
||||
allowDiscussion=>$_[0]->get("allowDiscussion"),
|
||||
editTimeout=>$_[0]->get("editTimeout"),
|
||||
karmaPerPost=>$_[0]->get("karmaPerPost"),
|
||||
karmaPerSubmission=>$_[0]->get("karmaPerSubmission"),
|
||||
groupToPost=>$_[0]->get("groupToPost"),
|
||||
layout=>$_[0]->get("layout"),
|
||||
displayThumbnails=>$_[0]->get("displayThumbnails"),
|
||||
groupToModerate=>$_[0]->get("groupToModerate")
|
||||
displayThumbnails=>$_[0]->get("displayThumbnails")
|
||||
});
|
||||
$sth = WebGUI::SQL->read("select * from UserSubmission_submission where wobjectId=".$_[0]->get("wobjectId"));
|
||||
while (%row = $sth->hash) {
|
||||
|
|
@ -254,8 +234,17 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub set {
|
||||
$_[0]->SUPER::set($_[1],[qw(submissionsPerPage groupToContribute groupToApprove defaultStatus groupToModerate
|
||||
groupToPost displayThumbnails editTimeout karmaPerPost karmaPerSubmission layout allowDiscussion)]);
|
||||
$_[0]->SUPER::set($_[1],[qw(submissionsPerPage groupToContribute groupToApprove defaultStatus
|
||||
displayThumbnails karmaPerSubmission layout allowDiscussion)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_approvePost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::approvePost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -310,7 +299,7 @@ sub www_deleteImage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessage {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -319,7 +308,7 @@ sub www_deleteMessage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessageConfirm {
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
if (WebGUI::Discussion::canEditMessage($_[0],$session{form}{mid})) {
|
||||
return WebGUI::Discussion::deleteMessageConfirm();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -356,6 +345,15 @@ sub www_deleteSubmissionConfirm {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_denyPost {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
return WebGUI::Discussion::denyPost();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_denySubmission {
|
||||
my (%submission);
|
||||
|
|
@ -374,13 +372,12 @@ sub www_denySubmission {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my (%layout, $layout, $output, $f, $defaultStatus, $submissionsPerPage, $groupToApprove, $groupToModerate);
|
||||
my (%layout, $layout, $output, $f, $defaultStatus, $submissionsPerPage, $groupToApprove);
|
||||
%layout = (traditional=>WebGUI::International::get(55,$namespace),
|
||||
weblog=>WebGUI::International::get(54,$namespace),
|
||||
photogallery=>WebGUI::International::get(56,$namespace));
|
||||
$layout = $_[0]->get("layout") || "traditional";
|
||||
$groupToApprove = $_[0]->get("groupToApprove") || 4;
|
||||
$groupToModerate = $_[0]->get("groupToModerate") || 4;
|
||||
$submissionsPerPage = $_[0]->get("submissionsPerPage") || 50;
|
||||
$defaultStatus = $_[0]->get("defaultStatus") || "Approved";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
|
|
@ -391,7 +388,7 @@ sub www_edit {
|
|||
$f->group("groupToApprove",WebGUI::International::get(1,$namespace),[$groupToApprove]);
|
||||
$f->group("groupToContribute",WebGUI::International::get(2,$namespace),[$_[0]->get("groupToContribute")]);
|
||||
$f->integer("submissionsPerPage",WebGUI::International::get(6,$namespace),$submissionsPerPage);
|
||||
$f->select("defaultStatus",\%submissionStatus,WebGUI::International::get(10,$namespace),[$defaultStatus]);
|
||||
$f->select("defaultStatus",\%submissionStatus,WebGUI::International::get(563),[$defaultStatus]);
|
||||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaPerSubmission",WebGUI::International::get(30,$namespace),$_[0]->get("karmaPerSubmission"));
|
||||
} else {
|
||||
|
|
@ -399,14 +396,7 @@ sub www_edit {
|
|||
}
|
||||
$f->yesNo("displayThumbnails",WebGUI::International::get(51,$namespace),$_[0]->get("displayThumbnails"));
|
||||
$f->yesNo("allowDiscussion",WebGUI::International::get(48,$namespace),$_[0]->get("allowDiscussion"));
|
||||
$f->integer("editTimeout",WebGUI::International::get(49,$namespace),$_[0]->get("editTimeout"));
|
||||
$f->group("groupToPost",WebGUI::International::get(50,$namespace),[$_[0]->get("groupToPost")]);
|
||||
$f->group("groupToModerate",WebGUI::International::get(44,$namespace),[$groupToModerate]);
|
||||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaPerPost",WebGUI::International::get(541),$_[0]->get("karmaPerPost"));
|
||||
} else {
|
||||
$f->hidden("karmaPerPost",$_[0]->get("karmaPerPost"));
|
||||
}
|
||||
$f->raw($_[0]->SUPER::discussionProperties);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -423,11 +413,7 @@ sub www_editSave {
|
|||
groupToContribute=>$session{form}{groupToContribute},
|
||||
groupToApprove=>$session{form}{groupToApprove},
|
||||
defaultStatus=>$session{form}{defaultStatus},
|
||||
groupToModerate=>$session{form}{groupToModerate},
|
||||
groupToPost=>$session{form}{groupToPost},
|
||||
karmaPerPost=>$session{form}{karmaPerPost},
|
||||
karmaPerSubmission=>$session{form}{karmaPerSubmission},
|
||||
editTimeout=>$session{form}{editTimeout},
|
||||
allowDiscussion=>$session{form}{allowDiscussion},
|
||||
layout=>$session{form}{layout},
|
||||
displayThumbnails=>$session{form}{displayThumbnails}
|
||||
|
|
@ -530,9 +516,19 @@ sub www_editSubmissionSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_lockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::lockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_post {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
return WebGUI::Discussion::post();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -541,8 +537,8 @@ sub www_post {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_postSave {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"),$session{user}{userId})) {
|
||||
WebGUI::Discussion::postSave($_[0]->get("karmaPerPost"));
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"))) {
|
||||
WebGUI::Discussion::postSave($_[0]);
|
||||
return $_[0]->www_showMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -611,24 +607,24 @@ sub www_search {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_showMessage {
|
||||
my ($submenu, $output);
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=post&replyTo='.$session{form}{mid}.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid})
|
||||
.'">'.WebGUI::International::get(39,$namespace).'</a><br>';
|
||||
if (_canEditMessage($_[0],$session{form}{mid})) {
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=post&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.WebGUI::International::get(42,$namespace).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.WebGUI::International::get(43,$namespace).'</a><br>';
|
||||
}
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=search&sid='.$session{form}{sid}.'&wid='.$_[0]->get("wobjectId")).'">'
|
||||
.WebGUI::International::get(364).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page('func=viewSubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}).'">'.WebGUI::International::get(45,$namespace).'</a><br>';
|
||||
$submenu .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(28,$namespace).'</a><br>';
|
||||
$output = WebGUI::Discussion::showMessage($submenu);
|
||||
$output = WebGUI::Discussion::showMessage($submenu,$_[0]);
|
||||
$output .= WebGUI::Discussion::showThreads();
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_unlockThread {
|
||||
if (WebGUI::Privilege::isInGroup($_[0]->get("groupToModerate"))) {
|
||||
WebGUI::Discussion::unlockThread();
|
||||
return $_[0]->www_showMessage;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($output);
|
||||
|
|
@ -671,15 +667,15 @@ sub www_viewSubmission {
|
|||
$output .= '<a href="'.WebGUI::URL::page('func=editSubmission&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}).'">'.WebGUI::International::get(27,$namespace).'</a><br>';
|
||||
}
|
||||
if ($submission{status} eq "Pending" && WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId})) {
|
||||
if ($submission{status} ne "Approved" && WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId})) {
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=approveSubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(24,$namespace).'</a><br>';
|
||||
WebGUI::International::get(572).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('op=viewMessageLog').'">'.
|
||||
WebGUI::International::get(25,$namespace).'</a><br>';
|
||||
WebGUI::International::get(573).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=denySubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(26,$namespace).'</a><br>';
|
||||
WebGUI::International::get(574).'</a><br>';
|
||||
}
|
||||
if ($_[0]->get("allowDiscussion")) {
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue