Beispiel #1
0
        $doc_info->testplan_scope = $tplan_info['notes'];
        $doc_info->title = $doc_info->testplan_name;
        // Changed to get ALL platform attributes.
        $getOpt = array('outputFormat' => 'mapAccessByID', 'addIfNull' => true);
        $platforms = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt);
        $platformIDSet = array_keys($platforms);
        $printingOptions['priority'] = $doc_info->test_priority_enabled;
        $items2use = (object) array('estimatedExecTime' => null, 'realExecTime' => null);
        $treeForPlatform = array();
        $filters = null;
        switch ($doc_info->content_range) {
            case 'testproject':
                $treeForPlatform = buildContentForTestPlan($db, $subtree, $args->tplan_id, $platformIDSet, $decode, $tplan_mgr, $filters);
                break;
            case 'testsuite':
                list($treeForPlatform, $items2use) = buildContentForTestPlanBranch($db, $subtree, $args->itemID, $args->tplan_id, $platformIDSet, $doc_info, $decode, $tplan_mgr, $my['options']['prepareNode']);
                break;
        }
        // Create list of execution id, that will be used to compute execution time if
        // CF_EXEC_TIME custom field exists and is linked to current testproject
        $doc_data->statistics = null;
        if ($printingOptions['metrics']) {
            $doc_data->statistics = timeStatistics($items2use, $args->tplan_id, $decode, $tplan_mgr);
        }
        break;
}
// ----- rendering logic -----
$topText = renderHTMLHeader($doc_info->type . ' ' . $doc_info->title, $_SESSION['basehref'], $doc_info->type);
$topText .= renderFirstPage($doc_info);
// Init table of content (TOC) data
renderTOC($printingOptions);
        $ctx->platformIDSet = $platformIDSet;
        $opx = null;
        if ($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) {
            $ctx->build_id = $args->build_id > 0 ? $args->build_id : null;
            if ($ctx->build_id > 0 && $args->with_user_assignment) {
                $opx = array('setAssignedTo' => true);
            }
        }
        switch ($doc_info->content_range) {
            case 'testproject':
                $treeForPlatform = buildContentForTestPlan($db, $subtree, $ctx, $decode, $tplan_mgr, $filters, $opx);
                break;
            case 'testsuite':
                $ctx->branchRoot = $args->itemID;
                $opx = array_merge((array) $opx, $my['options']['prepareNode']);
                list($treeForPlatform, $items2use) = buildContentForTestPlanBranch($db, $subtree, $ctx, $doc_info, $decode, $tplan_mgr, $opx);
                break;
        }
        // Create list of execution id, that will be used to compute execution time if
        // CF_EXEC_TIME custom field exists and is linked to current testproject
        $doc_data->statistics = null;
        if ($printingOptions['metrics']) {
            $target = new stdClass();
            $target->tplan_id = $args->tplan_id;
            $target->build_id = $args->build_id;
            $target->platform_id = isset($args->platform_id) ? $args->platform_id : null;
            $doc_data->statistics = timeStatistics($items2use, $target, $decode, $tplan_mgr);
        }
        break;
}
// ----- rendering logic -----