Database efficiency improvements.
This commit is contained in:
parent
547e10affd
commit
f0ebc98582
12 changed files with 100 additions and 52 deletions
|
|
@ -37,16 +37,24 @@ sub _generateDebug {
|
||||||
$debug .= '<div style="background-color: #ffffdd;color: #000000;">'.$session{debug}{audit}.'</div>';
|
$debug .= '<div style="background-color: #ffffdd;color: #000000;">'.$session{debug}{audit}.'</div>';
|
||||||
$debug .= '<table bgcolor="#ffffff" style="color: #000000; font-size: 10pt; font-family: helvetica;">';
|
$debug .= '<table bgcolor="#ffffff" style="color: #000000; font-size: 10pt; font-family: helvetica;">';
|
||||||
while (my ($section, $hash) = each %session) {
|
while (my ($section, $hash) = each %session) {
|
||||||
while (my ($key, $value) = each %$hash) {
|
if (ref $hash eq 'HASH') {
|
||||||
if (ref $value eq 'ARRAY') {
|
while (my ($key, $value) = each %$hash) {
|
||||||
$value = '['.join(', ',@$value).']';
|
if (ref $value eq 'ARRAY') {
|
||||||
} elsif (ref $value eq 'HASH') {
|
$value = '['.join(', ',@$value).']';
|
||||||
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
|
} elsif (ref $value eq 'HASH') {
|
||||||
|
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
|
||||||
|
}
|
||||||
|
unless (lc($key) eq "password" || lc($key) eq "identifier") {
|
||||||
|
$debug .= '<tr><td align="right"><b>'.$section.'.'.$key.':</b></td><td>'.$value.'</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif (ref $hash eq 'ARRAY') {
|
||||||
|
my $i = 1;
|
||||||
|
foreach (@$hash) {
|
||||||
|
$debug .= '<tr><td align="right"><b>'.$section.'.'.$i.':</b></td><td>'.$_.'</td>';
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
unless (lc($key) eq "password" || lc($key) eq "identifier") {
|
}
|
||||||
$debug .= '<tr><td align="right"><b>'.$section.'.'.$key.':</b></td><td>'.$value.'</td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$debug .= '<tr><td colspan="2"> </td></tr>';
|
$debug .= '<tr><td colspan="2"> </td></tr>';
|
||||||
}
|
}
|
||||||
$debug .='</table>';
|
$debug .='</table>';
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,6 @@ use WebGUI::SQL;
|
||||||
use WebGUI::URL;
|
use WebGUI::URL;
|
||||||
use WebGUI::User;
|
use WebGUI::User;
|
||||||
|
|
||||||
our %status =("Approved"=>WebGUI::International::get(560),
|
|
||||||
"Denied"=>WebGUI::International::get(561),
|
|
||||||
"Pending"=>WebGUI::International::get(562));
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _deleteReplyTree {
|
sub _deleteReplyTree {
|
||||||
my ($sth, %data, $messageId);
|
my ($sth, %data, $messageId);
|
||||||
|
|
@ -474,7 +470,7 @@ sub showReplyTree {
|
||||||
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
||||||
$message{wobjectId}).'">'.substr($data[1],0,30).'</a>';
|
$message{wobjectId}).'">'.substr($data[1],0,30).'</a>';
|
||||||
if ($data[4] == $session{user}{userId}) {
|
if ($data[4] == $session{user}{userId}) {
|
||||||
$html .= ' ('.$status{$data[5]}.')';
|
$html .= ' ('.status($data[5]).')';
|
||||||
}
|
}
|
||||||
$html .= '</td><td class="tableData"><a href="'.
|
$html .= '</td><td class="tableData"><a href="'.
|
||||||
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
|
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
|
||||||
|
|
@ -533,7 +529,7 @@ sub showThreads {
|
||||||
$data{messageId}.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data{subject},0,30).
|
$data{messageId}.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data{subject},0,30).
|
||||||
'</a>';
|
'</a>';
|
||||||
if ($data{userId} == $session{user}{userId}) {
|
if ($data{userId} == $session{user}{userId}) {
|
||||||
$html .= ' ('.$status{$data{status}}.')';
|
$html .= ' ('.status($data{status}).')';
|
||||||
}
|
}
|
||||||
$html .= '</td><td class="tableData"><a href="'.
|
$html .= '</td><td class="tableData"><a href="'.
|
||||||
WebGUI::URL::page('op=viewProfile&uid='.$data{userId}).'">'.$data{username}.
|
WebGUI::URL::page('op=viewProfile&uid='.$data{userId}).'">'.$data{username}.
|
||||||
|
|
@ -561,6 +557,17 @@ sub showThreads {
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub status {
|
||||||
|
if ($_[0] eq "Approved") {
|
||||||
|
return WebGUI::International::get(560);
|
||||||
|
} elsif ($_[0] eq "Denied") {
|
||||||
|
return WebGUI::International::get(561);
|
||||||
|
} elsif ($_[0] eq "Pending") {
|
||||||
|
return WebGUI::International::get(562);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub traverseReplyTree {
|
sub traverseReplyTree {
|
||||||
my ($sth, @data, $html, $depth, $i);
|
my ($sth, @data, $html, $depth, $i);
|
||||||
|
|
@ -578,7 +585,7 @@ sub traverseReplyTree {
|
||||||
$html .= '><td class="tableData">'.$depth.'<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0]
|
$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>';
|
.'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.substr($data[1],0,30).'</a>';
|
||||||
if ($data[4] == $session{user}{userId}) {
|
if ($data[4] == $session{user}{userId}) {
|
||||||
$html .= ' ('.$status{$data[5]}.')';
|
$html .= ' ('.status($data[5]).')';
|
||||||
}
|
}
|
||||||
$html .= '</td><td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'
|
$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>';
|
.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%z %Z").'</td></tr>';
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package WebGUI::Macro::AdminBar;
|
||||||
# http://www.plainblack.com info@plainblack.com
|
# http://www.plainblack.com info@plainblack.com
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
use strict;
|
use strict qw(refs vars);
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
use WebGUI::Form;
|
use WebGUI::Form;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
|
|
@ -31,7 +31,10 @@ sub _replacement {
|
||||||
$hash{WebGUI::URL::page('op=selectPackageToDeploy')} = WebGUI::International::get(376);
|
$hash{WebGUI::URL::page('op=selectPackageToDeploy')} = WebGUI::International::get(376);
|
||||||
}
|
}
|
||||||
foreach $key (keys %{$session{wobject}}) {
|
foreach $key (keys %{$session{wobject}}) {
|
||||||
$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = $session{wobject}{$key};
|
my $cmd = "\$WebGUI::Wobject::".$key."::name";
|
||||||
|
#$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = $session{wobject}{$key};
|
||||||
|
$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = eval($cmd);
|
||||||
|
WebGUI::ErrorHandler::warn("Could use wobject $key because: ".$@) if ($@);
|
||||||
}
|
}
|
||||||
%hash = sortHash(%hash);
|
%hash = sortHash(%hash);
|
||||||
%hash = (%{{WebGUI::URL::page()=>WebGUI::International::get(1)}},%hash);
|
%hash = (%{{WebGUI::URL::page()=>WebGUI::International::get(1)}},%hash);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,11 @@ use WebGUI::SQL;
|
||||||
sub _replacement {
|
sub _replacement {
|
||||||
my (@param, $temp);
|
my (@param, $temp);
|
||||||
@param = WebGUI::Macro::getParams($1);
|
@param = WebGUI::Macro::getParams($1);
|
||||||
($temp) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=$session{setting}{defaultPage}");
|
if ($session{setting}{defaultPage} == $session{page}{pageId}) {
|
||||||
|
$temp = $session{page}{urlizedTitle};
|
||||||
|
} else {
|
||||||
|
($temp) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=$session{setting}{defaultPage}");
|
||||||
|
}
|
||||||
$temp = WebGUI::URL::gateway($temp);
|
$temp = WebGUI::URL::gateway($temp);
|
||||||
if ($param[0] ne "linkonly") {
|
if ($param[0] ne "linkonly") {
|
||||||
$temp = '<a class="homeLink" href="'.$temp.'">';
|
$temp = '<a class="homeLink" href="'.$temp.'">';
|
||||||
|
|
@ -36,7 +40,7 @@ sub _replacement {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub process {
|
sub process {
|
||||||
my ($output, $temp, @param);
|
my ($output);
|
||||||
$output = $_[0];
|
$output = $_[0];
|
||||||
$output =~ s/\^H\((.*?)\)\;/_replacement($1)/ge;
|
$output =~ s/\^H\((.*?)\)\;/_replacement($1)/ge;
|
||||||
$output =~ s/\^H\;/_replacement()/ge;
|
$output =~ s/\^H\;/_replacement()/ge;
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,21 @@ use WebGUI::Session;
|
||||||
use WebGUI::URL;
|
use WebGUI::URL;
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub process {
|
sub _replacement {
|
||||||
my ($output, $temp, $f);
|
my ($f);
|
||||||
$output = $_[0];
|
|
||||||
$f = WebGUI::HTMLForm->new(1);
|
$f = WebGUI::HTMLForm->new(1);
|
||||||
$f->hidden("op","search");
|
$f->hidden("op","search");
|
||||||
$f->text("atLeastOne",'',$session{form}{atLeastOne});
|
$f->text("atLeastOne",'',$session{form}{atLeastOne});
|
||||||
$f->submit(WebGUI::International::get(364));
|
$f->submit(WebGUI::International::get(364));
|
||||||
$temp = $f->print;
|
return $f->print;
|
||||||
$output =~ s/\^\?\;/$temp/g;
|
|
||||||
return $output;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub process {
|
||||||
|
my ($output);
|
||||||
|
$output = $_[0];
|
||||||
|
$output =~ s/\^\?\;/_replacement()/ge;
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -307,6 +307,9 @@ sub new {
|
||||||
$class = shift;
|
$class = shift;
|
||||||
$sql = shift;
|
$sql = shift;
|
||||||
$dbh = shift || $WebGUI::Session::session{dbh};
|
$dbh = shift || $WebGUI::Session::session{dbh};
|
||||||
|
if ($WebGUI::Session::session{setting}{showDebug}) {
|
||||||
|
push(@{$WebGUI::Session::session{SQLquery}},$sql);
|
||||||
|
}
|
||||||
$sth = $dbh->prepare($sql) or WebGUI::ErrorHandler::fatalError("Couldn't prepare statement: ".$sql." : ". DBI->errstr);
|
$sth = $dbh->prepare($sql) or WebGUI::ErrorHandler::fatalError("Couldn't prepare statement: ".$sql." : ". DBI->errstr);
|
||||||
$sth->execute or WebGUI::ErrorHandler::fatalError("Couldn't execute statement: ".$sql." : ". DBI->errstr);
|
$sth->execute or WebGUI::ErrorHandler::fatalError("Couldn't execute statement: ".$sql." : ". DBI->errstr);
|
||||||
bless ({_sth => $sth}, $class);
|
bless ({_sth => $sth}, $class);
|
||||||
|
|
|
||||||
|
|
@ -185,12 +185,13 @@ sub _loadWobjects {
|
||||||
next if (isIn($namespace, split(/,/,$exclude)));
|
next if (isIn($namespace, split(/,/,$exclude)));
|
||||||
$cmd = "WebGUI::Wobject::".$namespace."::uiLevel";
|
$cmd = "WebGUI::Wobject::".$namespace."::uiLevel";
|
||||||
next if (eval($cmd) > $session{user}{uiLevel});
|
next if (eval($cmd) > $session{user}{uiLevel});
|
||||||
$cmd = "\$WebGUI::Wobject::".$namespace."::name";
|
# $cmd = "\$WebGUI::Wobject::".$namespace."::name";
|
||||||
$session{wobject}{$namespace} = eval($cmd);
|
# $session{wobject}{$namespace} = eval($cmd);
|
||||||
if ($@) {
|
$session{wobject}{$namespace} = $namespace;
|
||||||
WebGUI::ErrorHandler::warn("No name method in wobject: $namespace. ".$@);
|
# if ($@) {
|
||||||
$session{wobject}{$namespace} = "ERROR: ".$namespace;
|
# WebGUI::ErrorHandler::warn("No name method in wobject: $namespace. ".$@);
|
||||||
}
|
# $session{wobject}{$namespace} = "ERROR: ".$namespace;
|
||||||
|
# }
|
||||||
} else {
|
} else {
|
||||||
WebGUI::ErrorHandler::warn("Wobject failed to compile: $namespace. ".$@);
|
WebGUI::ErrorHandler::warn("Wobject failed to compile: $namespace. ".$@);
|
||||||
$session{wobject}{$namespace} = "ERROR: ".$namespace;
|
$session{wobject}{$namespace} = "ERROR: ".$namespace;
|
||||||
|
|
@ -226,8 +227,7 @@ sub end {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub httpHeader {
|
sub httpHeader {
|
||||||
unless ($session{header}{charset}) {
|
unless ($session{header}{charset}) {
|
||||||
my ($charset) = WebGUI::SQL->quickArray("select characterSet from language where languageId=".$session{user}{language});
|
$session{header}{charset} = $session{language}{characterSet} || "ISO-8859-1";
|
||||||
$session{header}{charset} = $charset || "ISO-8859-1";
|
|
||||||
}
|
}
|
||||||
if ($session{header}{filename} && $session{header}{mimetype} eq "text/html") {
|
if ($session{header}{filename} && $session{header}{mimetype} eq "text/html") {
|
||||||
$session{header}{mimetype} = "application/octet-stream";
|
$session{header}{mimetype} = "application/octet-stream";
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ sub process {
|
||||||
strict=>0
|
strict=>0
|
||||||
);
|
);
|
||||||
while (my ($section, $hash) = each %session) {
|
while (my ($section, $hash) = each %session) {
|
||||||
|
next unless (ref $hash eq 'HASH');
|
||||||
while (my ($key, $value) = each %$hash) {
|
while (my ($key, $value) = each %$hash) {
|
||||||
if (ref $value eq 'ARRAY') {
|
if (ref $value eq 'ARRAY') {
|
||||||
next;
|
next;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ use WebGUI::URL;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Wobject
|
Package WebGUI::Wobject
|
||||||
|
|
|
||||||
|
|
@ -158,13 +158,17 @@ sub www_view {
|
||||||
$var{"attachment.url"} = $file->getURL;
|
$var{"attachment.url"} = $file->getURL;
|
||||||
$var{"attachment.name"} = $file->getFilename;
|
$var{"attachment.name"} = $file->getFilename;
|
||||||
}
|
}
|
||||||
($var{"replies.count"}) = WebGUI::SQL->quickArray("select count(*) from discussion where wobjectId=".$_[0]->get("wobjectId"));
|
if ($_[0]->get("allowDiscussion")) {
|
||||||
$var{"replies.URL"} = WebGUI::URL::page('func=showMessage&wid='.$_[0]->get("wobjectId"));
|
($var{"replies.count"}) = WebGUI::SQL->quickArray("select count(*) from discussion
|
||||||
$var{"replies.label"} = WebGUI::International::get(28,$namespace);
|
where wobjectId=".$_[0]->get("wobjectId"));
|
||||||
$var{"post.URL"} = WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId"));
|
$var{"replies.URL"} = WebGUI::URL::page('func=showMessage&wid='.$_[0]->get("wobjectId"));
|
||||||
$var{"post.label"} = WebGUI::International::get(24,$namespace);
|
$var{"replies.label"} = WebGUI::International::get(28,$namespace);
|
||||||
|
$var{"post.URL"} = WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId"));
|
||||||
|
$var{"post.label"} = WebGUI::International::get(24,$namespace);
|
||||||
|
}
|
||||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,6 @@ our @ISA = qw(WebGUI::Wobject);
|
||||||
our $namespace = "MessageBoard";
|
our $namespace = "MessageBoard";
|
||||||
our $name = WebGUI::International::get(2,$namespace);
|
our $name = WebGUI::International::get(2,$namespace);
|
||||||
|
|
||||||
our %status =("Approved"=>WebGUI::International::get(560),
|
|
||||||
"Denied"=>WebGUI::International::get(561),
|
|
||||||
"Pending"=>WebGUI::International::get(562));
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub duplicate {
|
sub duplicate {
|
||||||
my ($w);
|
my ($w);
|
||||||
|
|
@ -50,6 +45,17 @@ sub set {
|
||||||
$_[0]->SUPER::set($_[1],[qw(templateId messagesPerPage)]);
|
$_[0]->SUPER::set($_[1],[qw(templateId messagesPerPage)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub status {
|
||||||
|
if ($_[0] eq "Approved") {
|
||||||
|
return WebGUI::International::get(560);
|
||||||
|
} elsif ($_[0] eq "Denied") {
|
||||||
|
return WebGUI::International::get(561);
|
||||||
|
} elsif ($_[0] eq "Pending") {
|
||||||
|
return WebGUI::International::get(562);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
|
|
@ -124,7 +130,7 @@ sub www_view {
|
||||||
"message.url" => WebGUI::URL::page('func=showMessage&mid='.$data->{messageId}.'&wid='.$_[0]->get("wobjectId")),
|
"message.url" => WebGUI::URL::page('func=showMessage&mid='.$data->{messageId}.'&wid='.$_[0]->get("wobjectId")),
|
||||||
"message.subject" => substr($data->{subject},0,30),
|
"message.subject" => substr($data->{subject},0,30),
|
||||||
"message.currentUser" => ($data->{userId} == $session{user}{userId}),
|
"message.currentUser" => ($data->{userId} == $session{user}{userId}),
|
||||||
"message.status" => $status{$data->{status}},
|
"message.status" => status($data->{status}),
|
||||||
"message.userProfile" => WebGUI::URL::page('op=viewProfile&uid='.$data->{userId}),
|
"message.userProfile" => WebGUI::URL::page('op=viewProfile&uid='.$data->{userId}),
|
||||||
"message.username" => $data->{username},
|
"message.username" => $data->{username},
|
||||||
"message.date" => epochToHuman($data->{dateOfPost}),
|
"message.date" => epochToHuman($data->{dateOfPost}),
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,6 @@ our @ISA = qw(WebGUI::Wobject);
|
||||||
our $namespace = "USS";
|
our $namespace = "USS";
|
||||||
our $name = WebGUI::International::get(29,$namespace);
|
our $name = WebGUI::International::get(29,$namespace);
|
||||||
|
|
||||||
our %submissionStatus =("Approved"=>WebGUI::International::get(560),
|
|
||||||
"Denied"=>WebGUI::International::get(561),
|
|
||||||
"Pending"=>WebGUI::International::get(562));
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub duplicate {
|
sub duplicate {
|
||||||
my ($sth, $file, %row, $newSubmissionId, $w);
|
my ($sth, $file, %row, $newSubmissionId, $w);
|
||||||
|
|
@ -82,6 +78,17 @@ sub set {
|
||||||
submissionTemplateId templateId karmaPerSubmission allowDiscussion)]);
|
submissionTemplateId templateId karmaPerSubmission allowDiscussion)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub status {
|
||||||
|
if ($_[0] eq "Approved") {
|
||||||
|
return WebGUI::International::get(560);
|
||||||
|
} elsif ($_[0] eq "Denied") {
|
||||||
|
return WebGUI::International::get(561);
|
||||||
|
} elsif ($_[0] eq "Pending") {
|
||||||
|
return WebGUI::International::get(562);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_approveSubmission {
|
sub www_approveSubmission {
|
||||||
my (%submission);
|
my (%submission);
|
||||||
|
|
@ -181,7 +188,8 @@ sub www_edit {
|
||||||
$f->group("groupToApprove",WebGUI::International::get(1,$namespace),[$groupToApprove]);
|
$f->group("groupToApprove",WebGUI::International::get(1,$namespace),[$groupToApprove]);
|
||||||
$f->group("groupToContribute",WebGUI::International::get(2,$namespace),[$_[0]->get("groupToContribute")]);
|
$f->group("groupToContribute",WebGUI::International::get(2,$namespace),[$_[0]->get("groupToContribute")]);
|
||||||
$f->integer("submissionsPerPage",WebGUI::International::get(6,$namespace),$submissionsPerPage);
|
$f->integer("submissionsPerPage",WebGUI::International::get(6,$namespace),$submissionsPerPage);
|
||||||
$f->select("defaultStatus",\%submissionStatus,WebGUI::International::get(563),[$defaultStatus]);
|
$f->select("defaultStatus",{Approved=>status('Approved'),Denied=>status('Denied'),Pending=>status('Pending')}
|
||||||
|
,WebGUI::International::get(563),[$defaultStatus]);
|
||||||
if ($session{setting}{useKarma}) {
|
if ($session{setting}{useKarma}) {
|
||||||
$f->integer("karmaPerSubmission",WebGUI::International::get(30,$namespace),$_[0]->get("karmaPerSubmission"));
|
$f->integer("karmaPerSubmission",WebGUI::International::get(30,$namespace),$_[0]->get("karmaPerSubmission"));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -395,7 +403,7 @@ sub www_viewSubmission {
|
||||||
$var{"date.epoch"} = $submission->{dateSubmitted};
|
$var{"date.epoch"} = $submission->{dateSubmitted};
|
||||||
$var{"date.human"} = epochToHuman($submission->{dateSubmitted});
|
$var{"date.human"} = epochToHuman($submission->{dateSubmitted});
|
||||||
$var{"status.label"} = WebGUI::International::get(14,$namespace);
|
$var{"status.label"} = WebGUI::International::get(14,$namespace);
|
||||||
$var{"status.status"} = $submissionStatus{$submission->{status}};
|
$var{"status.status"} = status($submission->{status});
|
||||||
$var{"views.label"} = WebGUI::International::get(514);
|
$var{"views.label"} = WebGUI::International::get(514);
|
||||||
$var{"views.count"} = $submission->{views};
|
$var{"views.count"} = $submission->{views};
|
||||||
$var{canPost} = WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute"));
|
$var{canPost} = WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue