diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index c972bf05c..5b51c20f0 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -32,6 +32,7 @@ - Increased the performance of CS Thread viewing by 500%. - Changed the CS post rating mechinism to thumbs up/down to be less confusing. + - Added CS templates to run a request tracker (trouble ticket) style system. - Updated TinyMCE rich text editor to version 2.0.5.1. - Disabled the rich editor for Safari because it doesn't work correctly. - Added install/uninstall functions to the asset and wobject skeletons to diff --git a/docs/upgrades/7fixup.pl b/docs/upgrades/7fixup.pl index 07cc9aa25..2bfb87334 100644 --- a/docs/upgrades/7fixup.pl +++ b/docs/upgrades/7fixup.pl @@ -485,6 +485,24 @@ sub addPrototypes { threadTemplateId=>"PBtmpl0000000000000067", postFormTemplateId=>"PBtmpl0000000000000068" },"pbproto000000000000001"); + $importNode->addChild({ + title=>"Request Tracker", + menuTitle=>"Request Tracker", + url=>"request-tracker-prototype", + groupIdView=>'7', + groupIdEdit=>'12', + className=>'WebGUI::Asset::Wobject::Collaboration', + assetId=>"new", + allowReplies=>1, + attachmentsPerPost=>10, + isPrototype=>1, + usePreview=>0, + archiveAfter=>60*60*24*30, + defaultKarmaScale=>100, + collaborationTemplateId=>"PBtmpl0000000000000208", + threadTemplateId=>"PBtmpl0000000000000209", + postFormTemplateId=>"PBtmpl0000000000000210" + },"pbproto000000000000001"); } diff --git a/docs/upgrades/templates-6.99.0/requesttracker.tmpl b/docs/upgrades/templates-6.99.0/requesttracker.tmpl new file mode 100644 index 000000000..be422fd03 --- /dev/null +++ b/docs/upgrades/templates-6.99.0/requesttracker.tmpl @@ -0,0 +1,110 @@ +#PBtmpl0000000000000208 +#create +#namespace:Collaboration +#url:request-tracker-template +#title:Request Tracker +#menuTitle:Request Tracker + + + +

+
+ + +

+
+ + + + + +

+ + + • + + + + + + + + • + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@ + + by + + + + + + on @ +
+ + + + + +~~~ + + + + + diff --git a/docs/upgrades/templates-6.99.0/requesttrackerpost.tmpl b/docs/upgrades/templates-6.99.0/requesttrackerpost.tmpl new file mode 100644 index 000000000..2df3184a1 --- /dev/null +++ b/docs/upgrades/templates-6.99.0/requesttrackerpost.tmpl @@ -0,0 +1,343 @@ +#PBtmpl0000000000000209 +#create +#namespace:Collaboration/Thread +#url:request-tracker-post-template +#title:Request Tracker Post +#menuTitle:Request Tracker Post + + + +

+
+ +

+ +
+ : + + + + + +
+ :
+ :
+ :
+ : + +     [

+

|

-

] +
+
+ + :     [     [ ]
+ + + :
+
+
+ + :
+: + +
+
+ +
+ +
+ + +
+ +
+ <tmpl_var filename><tmpl_var filename> +
+
+
+
+
+ + + + +
+ + + • + + + + • + + +
+
+ + + + +
+

+
+
+ + + + + +
+
+ + + + + +
+ +
+ +
+
+
+ : + + + + + +
+ :
+
+
+ : + +     [

+

|

-

] +
+ +
+
+
+ + + + +
+
+ +
+ + + • + + + + • + + +
+
+
+
+
+ +
+ + + + + +
+
+ +
+ +
+
+
+ : + + + + + +
+ :
+
+
+ : + +     [

+

|

-

] +
+
+
+
+
+ + + + +
+
+ +
+ + + • + + + + • + + +
+
+
+
+
+
+ +
+ + + + +
+ +
+ + + • + + + + + • + + + + • + + • + + + + + • + + + • + + + + • + + + • + + + + + + + + + +
+~~~ + diff --git a/docs/upgrades/templates-6.99.0/requesttrackerpostform.tmpl b/docs/upgrades/templates-6.99.0/requesttrackerpostform.tmpl new file mode 100644 index 000000000..c9b5b5195 --- /dev/null +++ b/docs/upgrades/templates-6.99.0/requesttrackerpostform.tmpl @@ -0,0 +1,111 @@ +#PBtmpl0000000000000210 +#create +#namespace:Collaboration/PostForm +#url:request-tracker-template +#title:Request Tracker +#menuTitle:Request Tracker + + + +

+
+ + +

+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +

+ +
+~~~ + + 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' => {