Ejemplo n.º 1
0
$req_mgr = new requirement_mgr($db);
$req_spec_mgr = new requirement_spec_mgr($db);
$title_sep = config_get('gui_title_separator_1');
$charset = config_get('charset');
$req_cfg = config_get('req_cfg');
list($req_spec_type_labels, $req_type_labels, $status_labels, $labels) = setUpLabels($req_cfg);
list($results_cfg, $status_code_map, $code_status_map, $eval_status_map) = setUpReqStatusCfg();
$args = init_args($tproject_mgr, $tplan_mgr, $req_cfg);
$images = $smarty->getImages();
$gui = init_gui($args, $tplan_mgr);
$i2u = array('edit_icon', 'exec_icon', 'history_small');
foreach ($i2u as $ik) {
    $images[$ik] = $gui->baseHref . $images[$ik];
}
$reqContext = array('tproject_id' => $args->tproject_id, 'tplan_id' => $args->tplan_id, 'platform_id' => $args->platform);
$reqSetX = (array) $req_mgr->getAllByContext($reqContext);
$req_ids = array_keys($reqSetX);
$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . config_get('testcase_cfg')->glue_character;
$req_spec_map = array();
$testcases = array();
// first step: get the requirements and linked testcases with which we have to work,
// order them into $req_spec_map by spec
$gui->total_reqs = 0;
if (count($req_ids)) {
    list($gui->total_reqs, $req_spec_map, $testcases) = buildReqSpecMap($req_ids, $req_mgr, $req_spec_mgr, $tplan_mgr, $args->states_to_show->selected, $args);
    if (!count($req_spec_map)) {
        $gui->warning_msg = $labels['no_matching_reqs'];
    }
} else {
    $gui->warning_msg = $labels['no_srs_defined'];
}