@@ -3548,7 +3548,7 @@ function getExecTimelineStats($id,$filters=null,$opt=null)
35483548 // day_hour -> sum by date & hour
35493549 // month -> sum by month
35503550 //
3551- $ options = array ('timeline ' => 'day ' );
3551+ $ options = array ('timeline ' => 'day ' , ' workforce ' => false );
35523552 $ options = array_merge ($ options ,(array )$ opt );
35533553
35543554 switch ($ options ['timeline ' ]) {
@@ -3567,11 +3567,12 @@ function getExecTimelineStats($id,$filters=null,$opt=null)
35673567 }
35683568
35693569 $ safeID = intval ($ id );
3570- $ sql = " SELECT COUNT(0) as qty, {$ fields }
3571- FROM {$ this ->views ['exec_by_date_time ' ]} EBDT
3572- WHERE EBDT.testplan_id = {$ safeID }
3573- GROUP BY {$ fields }
3574- ORDER BY {$ fields }" ;
3570+ $ sqlX = " SELECT COUNT(0) as qty, {$ fields },tester_id
3571+ FROM {$ this ->views ['exec_by_date_time ' ]} EBDT
3572+ WHERE EBDT.testplan_id = {$ safeID }
3573+ GROUP BY {$ fields },tester_id " ;
3574+ $ sqlA = str_ireplace (',tester_id ' ,'' , $ sqlX );
3575+ $ sql = $ sqlA . " ORDER BY {$ fields }" ;
35753576
35763577 switch ($ options ['timeline ' ]) {
35773578 case 'day_hour ' :
@@ -3588,7 +3589,33 @@ function getExecTimelineStats($id,$filters=null,$opt=null)
35883589 break ;
35893590 }
35903591
3591- return $ rs ;
3592+ $ rswf = null ;
3593+ if ($ options ['workforce ' ]) {
3594+ $ sqlwf = " SELECT COUNT(0) AS testers, {$ fields }
3595+ FROM ( $ sqlX) SQLBASE
3596+ GROUP BY {$ fields }" ;
3597+
3598+ switch ($ options ['timeline ' ]) {
3599+ case 'day_hour ' :
3600+ $ rswf = $ this ->db ->fetchMapRowsIntoMap ($ sqlwf ,'yyyy_mm_dd ' ,'hh ' );
3601+ break ;
3602+
3603+ case 'month ' :
3604+ $ rswf = $ this ->db ->fetchRowsIntoMap ($ sqlwf ,'yyyy_mm ' );
3605+ break ;
3606+
3607+ case 'day ' :
3608+ default :
3609+ $ rswf = $ this ->db ->fetchRowsIntoMap ($ sqlwf ,'yyyy_mm_dd ' );
3610+ break ;
3611+ }
3612+
3613+ foreach ($ rswf as $ rt => $ elem ) {
3614+ $ rs [$ rt ]['testers ' ] = $ elem ['testers ' ];
3615+ }
3616+ }
3617+
3618+ return array ($ rs ,$ rswf );
35923619 }
35933620
35943621 /**
0 commit comments