blob: bb8209837fd0a58ca2531e5acb1b53f9a18907a3 [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_q($context) {
return ChartBuilder::named ( 'ip_progress_q' )
->title ( "IP Team Quarterly Progress (:start to :end)" )
->description ( "The number of CQs resolved each quarter by type." )
->query ('ipzilla', "
select
concat(year(b.creation_ts),'Q',quarter(b.creation_ts)) 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 concat(year(b.creation_ts),'Q',quarter(b.creation_ts))
" )
->substitute(':start', $context->getStart()->format('Y-m-d'))
->substitute(':end', $context->getEnd()->format('Y-m-d'))
->column ( 'Month', 'period', 'string')
->column ( 'Project Code', 'projectcode', 'number' )
->column ( 'Type A', 'typeA', 'number' )
->column ( 'Type B', 'typeB', 'number' );
}
?>