You are here: Foswiki>Tasks Web>Item5956 (25 Aug 2008, RafaelAlvarez)Edit Attach

Item5956: xpshowdevelopertasks: error in "Developer totals" when concatenate 2 developers

pencil
Priority: Normal
Current State: Confirmed
Released In:
Target Release: n/a
Applies To: Extension
Component: XpTrackerPlugin
Branches:
Reported By: TWiki:Main.AndresManeiro
Waiting For:
Last Change By: RafaelAlvarez

xpshowdevelopertasks: error in "Developer totals" when concatenate 2 developers

I'm trying something like this ...

%XPSHOWDEVELOPERTASKS{DeveloperName1}%
%XPSHOWDEVELOPERTASKS{DeveloperName2}%

But when i do it, i get "Developer totals" for second developer as (sum of all tasks for developer 2) and (sum of "developer totals" for developer 1).

This issue matters because the variables $totalSpent,$totalEtc,$totalEst within developerTasKByProject function are the same ones that variables $totalSpent,$totalEtc,$totalEst in developerTask function.

In order to solve this issue, i changed vars within developerTaskByProject in local vars and make all changes neccesary to get two functions work.

I have solved this issue applying next patch to code (maybe this patch would be commited by some xptrackerplugin developer to svn):

Index: lib/TWiki/Plugins/XpTrackerPlugin/Show.pm
===================================================================
--- lib/TWiki/Plugins/XpTrackerPlugin/Show.pm   (revisión: 17443)
+++ lib/TWiki/Plugins/XpTrackerPlugin/Show.pm   (copia de trabajo)
@@ -62,9 +62,13 @@
     # todo: build a list of projects/iterations sorted by date
    my ($totalSpent,$totalEtc,$totalEst)= (0,0,0);
     foreach my $project (@projects) {
-       my $text;
-      ($text,$totalSpent,$totalEtc,$totalEst) = &developerTasksByProject($developer,$project,$web);
+       my $text, $projectSpent, $projectEtc, $projectEst;
+   ($text,$projectSpent,$projectEtc,$projectEst) = &developerTasksByProject($developer,$project,$web);
 
+   $totalSpent += $projectSpent;
+   $totalEtc += $projectEtc;
+   $totalEst += $projectEst;
+
       if  (($totalEtc && $totalEtc>0) || ($totalSpent && $totalSpent>0)) {
          $list .= "\n\n\n";
           $list .= "---+++ Project: " . $web.".".$project ."\n\n";
@@ -104,6 +108,8 @@
     
     TWiki::Plugins::XpTrackerPlugin::Cache::initCache($web);
 
+    my ($totalSpent,$totalEtc,$totalEst)= (0,0,0);
+
     my $list="";
     my @teams = &TWiki::Plugins::XpTrackerPlugin::xpGetProjectTeams($project, $web);
     foreach my $team (@teams){

-- AndresManeiro - 24 Aug 2008

ItemTemplate edit

Summary xpshowdevelopertasks: error in "Developer totals" when concatenate 2 developers
ReportedBy TWiki:Main.AndresManeiro
Codebase ~twiki4
SVN Range TWiki-5.0.0, Mon, 18 Aug 2008, build 17431
AppliesTo Extension
Component XpTrackerPlugin
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r1 - 25 Aug 2008, RafaelAlvarez
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy