+
+
+
+
+
+~~~
+
+
diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm
index 5bed25429..c624a845e 100644
--- a/lib/WebGUI/Asset/Post.pm
+++ b/lib/WebGUI/Asset/Post.pm
@@ -687,7 +687,6 @@ sub postProcess {
$size += $storage->getFileSize($file);
}
$self->setSize($size);
-
}
#-------------------------------------------------------------------
@@ -946,6 +945,7 @@ sub www_edit {
$content .= "\n\n".$self->session->user->profileField("signature") if ($self->session->user->profileField("signature") && !$self->session->form->process("content"));
} else { # edit
return $self->session->privilege->insufficient() unless ($self->canEdit);
+ $var{isThread} = !$self->isReply;
$var{'form.header'} = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl})
.WebGUI::Form::hidden($self->session, {
name=>"func",
@@ -1030,9 +1030,10 @@ sub www_edit {
});
$var{'karmaScale.form'} = WebGUI::Form::integer($self->session, {
name=>"karmaScale",
+ defaultValue=>$self->getThread->getParent->get("defaultKarmaScale"),
value=>$self->getValue("karmaScale"),
- defaultValue=>1
});
+ $var{karmaIsEnabled} = $self->session->setting->get("useKarma");
$var{'form.preview'} = WebGUI::Form::submit($self->session, {
value=>$i18n->get("preview","Asset_Collaboration")
});
diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm
index 5748e2ba0..206296ece 100644
--- a/lib/WebGUI/Asset/Post/Thread.pm
+++ b/lib/WebGUI/Asset/Post/Thread.pm
@@ -118,13 +118,13 @@ sub definition {
},
karmaRank => {
noFormPost=>1,
- fieldType=>"hidden",
+ fieldType=>"float",
defaultValue=>0
},
karmaScale => {
noFormPost=>1,
fieldType=>"integer",
- defaultValue=>1
+ defaultValue=>10
}
},
});
@@ -521,8 +521,9 @@ sub processPropertiesFromFormPost {
$self->getParent->incrementThreads($self->get("dateUpdated"),$self->getId) unless ($self->isReply);
}
if ($self->getParent->canEdit) {
- my $karmaScale = $self->session->form("karmaScale","integer") || 1;
- $self->update({karmaScale=>$karmaScale, karmaRank=>$self->get("karma")/$karmaScale});
+ my $karmaScale = $self->session->form->process("karmaScale","integer") || $self->getParent->get("defaultKarmaScale");
+ my $karmaRank = $self->get("karma")/$karmaScale;
+ $self->update({karmaScale=>$karmaScale, karmaRank=>$karmaRank});
}
}
@@ -742,7 +743,7 @@ sub view {
$self->session->scratch->set("discussionLayout",$self->session->form->process("layout"));
my $var = $self->getTemplateVars;
$self->getParent->appendTemplateLabels($var);
-
+ $var->{karmaIsEnabled} = $self->session->setting->get("useKarma");
$var->{'user.isVisitor'} = ($self->session->user->userId eq '1');
$var->{'user.isModerator'} = $self->getParent->canEdit;
$var->{'user.canPost'} = $self->getParent->canPost;
@@ -947,7 +948,8 @@ sub www_transferKarma {
if ($amount <= $self->session->user->karma) {
$self->session->user->karma($amount, "Thread ".$self->getId, "Transferring karma to a thread.");
my $newKarma = $self->get("karma")+$amount;
- $self->update({karma=>$newKarma,karmaRank=>$newKarma/$self->get("karmaScale")});
+ my $karmaScale = $self->get("karmaScale") || 1;
+ $self->update({karma=>$newKarma,karmaRank=>$newKarma/$karmaScale});
}
return $self->www_view;
}
diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm
index 09c9c23c9..f69795932 100644
--- a/lib/WebGUI/Asset/Wobject/Collaboration.pm
+++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm
@@ -105,6 +105,16 @@ sub appendTemplateLabels {
my $self = shift;
my $var = shift;
my $i18n = WebGUI::International->new($self->session, "Asset_Collaboration");
+ $var->{"transferkarma.label"} = $i18n->get("transfer karma");
+ $var->{"karmaScale.label"} = $i18n->get("karma scale");
+ $var->{"close.label"} = $i18n->get("close");
+ $var->{"closed.label"} = $i18n->get("closed");
+ $var->{"open.label"} = $i18n->get("open");
+ $var->{"critical.label"} = $i18n->get("critical");
+ $var->{"cosmetic.label"} = $i18n->get("cosmetic");
+ $var->{"minor.label"} = $i18n->get("minor");
+ $var->{"fatal.label"} = $i18n->get("fatal");
+ $var->{"severity.label"} = $i18n->get("severity");
$var->{"add.label"} = $i18n->get("add");
$var->{"addlink.label"} = $i18n->get("addlink");
$var->{"addquestion.label"} = $i18n->get("addquestion");
@@ -126,6 +136,7 @@ sub appendTemplateLabels {
$var->{"job.title.label"} = $i18n->get("job title");
$var->{"job.description.label"} = $i18n->get("job description");
$var->{"job.requirements.label"} = $i18n->get("job requirements");
+ $var->{"karmaRank.label"} = $i18n->get("karma rank");
$var->{"location.label"} = $i18n->get("location");
$var->{"layout.flat.label"} = $i18n->get("flatLayout");
$var->{'link.header.label'} = $i18n->get("edit link");
@@ -614,14 +625,16 @@ sub getEditForm {
);
$tabform->getTab("properties")->integer(
-name=>"karmaRatingMultiplier",
- $i18n->get('karma rating multiplier'),
+ -label=>$i18n->get('karma rating multiplier'),
-hoverHelp=>$i18n->get('karma rating multiplier description'),
+ -defaultValue=>1,
-value=>$self->getValue("karmaRatingMultiplier")
);
$tabform->getTab("properties")->integer(
-name=>"defaultKarmaScale",
- $i18n->get("default karma scale"),
+ -label=>$i18n->get("default karma scale"),
-hoverHelp=>$i18n->get('default karma scale help'),
+ -defaultValue=>10,
-value=>$self->getValue("defaultKarmaScale")
);
} else {
@@ -1058,6 +1071,8 @@ sub view {
$var{'user.isSubscribed'} = $self->isSubscribed;
$var{'sortby.title.url'} = $self->getSortByUrl("title");
$var{'sortby.username.url'} = $self->getSortByUrl("username");
+ $var{'karmaIsEnabled'} = $self->session->setting->get("useKarma");
+ $var{'sortby.karmaRank.url'} = $self->getSortByUrl("karmaRank");
$var{'sortby.date.url'} = $self->getSortByUrl("dateSubmitted");
$var{'sortby.lastreply.url'} = $self->getSortByUrl("lastPostDate");
$var{'sortby.views.url'} = $self->getSortByUrl("views");
diff --git a/lib/WebGUI/i18n/English/Asset_Collaboration.pm b/lib/WebGUI/i18n/English/Asset_Collaboration.pm
index f65716065..9bd0dbd65 100644
--- a/lib/WebGUI/i18n/English/Asset_Collaboration.pm
+++ b/lib/WebGUI/i18n/English/Asset_Collaboration.pm
@@ -272,8 +272,53 @@ our $I18N = {
lastUpdated => 1109618544,
},
- 'contentType' => {
- message => q|Content Type|,
+ 'open' => {
+ message => q|Open|,
+ lastUpdated => 1109618544,
+ },
+
+ 'closed' => {
+ message => q|Closed|,
+ lastUpdated => 1109618544,
+ },
+
+ 'transfer karma' => {
+ message => q|Transfer Karma|,
+ lastUpdated => 1109618544,
+ },
+
+ 'karma scale' => {
+ message => q|Karma Scale|,
+ lastUpdated => 1109618544,
+ },
+
+ 'close' => {
+ message => q|Close|,
+ lastUpdated => 1109618544,
+ },
+
+ 'critical' => {
+ message => q|Critical (mostly not working)|,
+ lastUpdated => 1109618544,
+ },
+
+ 'cosmetic' => {
+ message => q|Cosmetic (misspelling, formatting problems)|,
+ lastUpdated => 1109618544,
+ },
+
+ 'minor' => {
+ message => q|Minor (annoying, but not harmful)|,
+ lastUpdated => 1109618544,
+ },
+
+ 'fatal' => {
+ message => q|Fatal (can't continue until this is resolved)|,
+ lastUpdated => 1109618544,
+ },
+
+ 'severity' => {
+ message => q|Severity|,
lastUpdated => 1109618544,
},
@@ -675,8 +720,36 @@ our $I18N = {
^International("word","Asset_Collaboration"); "^International("compensation","Asset_Collaboration");".
-contentType.label
-^International("phrase","Asset_Collaboration"); "^International("contentType","Asset_Collaboration");".
+open.label
+^International("word","Asset_Collaboration"); "^International("open","Asset_Collaboration");".
+
+
+close.label
+^International("word","Asset_Collaboration"); "^International("close","Asset_Collaboration");".
+
+
+closed.label
+^International("word","Asset_Collaboration"); "^International("closed","Asset_Collaboration");".
+
+
+critical.label
+^International("word","Asset_Collaboration"); "^International("critical","Asset_Collaboration");".
+
+
+minor.label
+^International("word","Asset_Collaboration"); "^International("minor","Asset_Collaboration");".
+
+
+cosmetic.label
+^International("word","Asset_Collaboration"); "^International("cosmetic","Asset_Collaboration");".
+
+
+fatal.label
+^International("word","Asset_Collaboration"); "^International("fatal","Asset_Collaboration");".
+
+
+severity.label
+^International("word","Asset_Collaboration"); "^International("severity","Asset_Collaboration");".
date.label
@@ -864,7 +937,7 @@ our $I18N = {
|,
- lastUpdated => 1145039922
+ lastUpdated => 1146153770
},
'collaboration add/edit title' => {
@@ -1228,6 +1301,14 @@ the Collaboration Asset, the user will be notified.
unsubscribe.url
A URL for unsubscribing the current user from this Asset.
+
+karmaIsEnabled
+A boolean indicating whether the use of karma is enabled or not.
+
+
+sortby.karmaRank.url
+A URL for sorting and displaying the list of posts by the amount of karma users have transfered to the thread.
+
sortby.title.url
A URL for sorting and displaying the list of posts by title.
@@ -1257,7 +1338,7 @@ A URL for sorting and displaying the list of posts by the number of replies to t
A URL for sorting and displaying the list of posts by their ratings.
|,
- lastUpdated => 1114466583,
+ lastUpdated => 1146150802,
},
'collaboration search template title' => {