示例#1
0
//@TODO this file seems not to be in use
include "../../third_party/charts/charts.php";
require_once '../functions/results.class.php';
require_once '../functions/testplan.class.php';
testlinkInitPage($db);
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$tplan_id = $_REQUEST['tplan_id'];
$tproject_id = $_SESSION['testprojectID'];
$tplan_info = $tplan_mgr->get_by_id($tplan_id);
$tproject_info = $tproject_mgr->get_by_id($tproject_id);
$re = new results($db, $tplan_mgr, $tproject_info, $tplan_info, ALL_TEST_SUITES, ALL_BUILDS);
/**
* KEYWORDS REPORT
*/
$arrDataKeys = $re->getAggregateKeywordResults();
$i = 0;
$arrDataKeys2 = null;
if ($arrDataKeys != null) {
    while ($keywordId = key($arrDataKeys)) {
        $arr = $arrDataKeys[$keywordId];
        $arrDataKeys2[$i] = $arr;
        $i++;
        next($arrDataKeys);
    }
}
$namesOfKeywordsArray = array();
$namesOfKeywordsArray[0] = "";
$passArray = array();
$passArray[0] = "pass";
$failArray = array();
示例#2
0
// ??
// $tplan_mgr->getStatusTotalsByPlatform($gui->tplan_id);
$gui->can_use_charts = checkLibGd();
$totals = $tplan_mgr->getStatusTotals($gui->tplan_id);
if ($gui->can_use_charts == 'OK') {
    $gui->tplan_name = $tplan_info['name'];
    $gui->tproject_name = $tproject_info['name'];
    $resultsCfg = config_get('results');
    // Save in session to improve perfomance.
    // This data will be used in different *chart.php to generate on the fly image
    unset($_SESSION['statistics']);
    $re = new results($db, $tplan_mgr, $tproject_info, $tplan_info, ALL_TEST_SUITES, ALL_BUILDS, ALL_PLATFORMS);
    $_SESSION['statistics']['getTopLevelSuites'] = $re->getTopLevelSuites();
    $_SESSION['statistics']['getAggregateMap'] = $re->getAggregateMap();
    $_SESSION['statistics']['getAggregateOwnerResults'] = $re->getAggregateOwnerResults();
    $_SESSION['statistics']['getAggregateKeywordResults'] = $re->getAggregateKeywordResults();
    $pathToScripts = "lib/results/";
    $tprojectTplanInfo = "?tproject_id={$gui->tproject_id}&tplan_id={$gui->tplan_id}";
    $chartsUrl = new stdClass();
    $chartsUrl->overallPieChart = $pathToScripts . "overallPieChart.php" . $tprojectTplanInfo;
    $chartsUrl->keywordBarChart = $pathToScripts . "keywordBarChart.php" . $tprojectTplanInfo;
    $chartsUrl->ownerBarChart = $pathToScripts . "ownerBarChart.php" . $tprojectTplanInfo;
    $chartsUrl->topLevelSuitesBarChart = $pathToScripts . "topLevelSuitesBarChart.php" . $tprojectTplanInfo;
    $platformSet = $tplan_mgr->getPlatforms($gui->tplan_id, array('outputFormat' => 'map'));
    $platformIDSet = is_null($platformSet) ? array(0) : array_keys($platformSet);
    $gui->charts = array(lang_get('overall_metrics') => $chartsUrl->overallPieChart);
    if (!is_null($platformSet)) {
        $label = lang_get('overall_metrics_for_platform');
        foreach ($platformIDSet as $platform_id) {
            $description = $label . ' ' . $platformSet[$platform_id];
            $gui->charts[$description] = $pathToScripts . "platformPieChart.php" . $tprojectTplanInfo . "&platform_id={$platform_id}";