Пример #1
0
require_once 'common.php';
if (config_get('interface_bugs') != 'NO') {
    require_once TL_ABS_PATH . 'lib' . DIRECTORY_SEPARATOR . 'bugtracking' . DIRECTORY_SEPARATOR . 'int_bugtracking.php';
}
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$gui = new stdClass();
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$gui->tplan_id = intval($_REQUEST['tplan_id']);
$gui->tproject_id = intval($_REQUEST['tproject_id']);
$tplan_info = $tplan_mgr->get_by_id($gui->tplan_id);
$tproject_info = $tproject_mgr->get_by_id($gui->tproject_id);
// ??
// $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}";
/**
 *
 */
function initializeGui($argsObj)
{
    $gui = new stdClass();
    $gui->tplan_id = $argsObj->tplan_id;
    $gui->can_use_charts = checkLibGd();
    return $gui;
}