blob: e79672575dab94779a4426912f9ef523c32d64db [file] [log] [blame]
<?php
/********************************************************************************
* Copyright (c) 2018 The Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
require_once dirname ( __FILE__ ) . '/../charts.inc';
function chart_ip_progress_w($context) {
return ChartBuilder::named ( 'ip_progress_w' )
->title ( "IP Team Weekly Progress (:start to :end)" )
->description ( "The number of CQs resolved each week by type." )
->query ('ipzilla', "
select
date_format(ba.bug_when, '%Y-%U') as period,
sum(if(kd.name='projectcode', 1, 0)) as projectcode,
sum(if(kd.name='thirdparty',if(b.cf_type='Type_A',1,0),0)) as typeA,
sum(if(kd.name='thirdparty',if(b.cf_type='Type_B',1,0),0)) as typeB,
group_concat(b.bug_id) as cqs
from bugs_activity as ba
join bugs as b on ba.bug_id=b.bug_id
join components as c on b.component_id=c.id
join keywords as k on b.bug_id=k.bug_id
join keyworddefs as kd on k.keywordid=kd.id
and kd.name in ('projectcode','thirdparty')
where
added='RESOLVED'
and b.short_desc not regexp '\((PB( Orbit)?)\s*\d*\)'
and b.short_desc not regexp '\(ATO\s*\d*\)'
and c.name not in ('IP_Discussion')
and b.creation_ts between date(':start') and date(':end')
group by date_format(ba.bug_when, '%Y-%U')
" )
->substitute ( ':start', $context->getDateTime('sunday last week')->sub(new DateInterval('P10W'))->format('Y-m-d') )
->substitute ( ':end', $context->getDateTime('sunday last week')->format('Y-m-d') )
->column ( 'Month', 'period', 'string')
->column ( 'Project Code', 'projectcode', 'number' )
->column ( 'Type A', 'typeA', 'number' )
->column ( 'Type B', 'typeB', 'number' );
}
?>