blob: 09c8a036fa2323ac7453258aae940b79306681d1 [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_project_licenses_epl(ChartContext $context) {
return ChartBuilder::named ( 'project_licenses_epl' )
->title ( "EPL License Use (:date)" )
->description ( "Use of the EPL by Eclipse Projects" )
->pieChart()
->query ('foundation', "
SELECT
if(LicenseId='EPL1.0','EPL-1.0', LicenseId) as license,
count(distinct pl.projectId) as count
FROM ProjectLicenses as pl
JOIN Projects as p on pl.ProjectId=p.ProjectId
AND p.IsActive
where LicenseId like 'EPL%'
group by LicenseId
" )
->substitute ( ':date', (new DateTime())->format('Y-m-d') )
->column ( 'License', 'license', 'string')
->column ( 'Count', 'count', 'number' );
}
?>