예제 #1
0
function getReqDocIDs(&$db, $srs_id)
{
    $req_spec_mgr = new requirement_spec_mgr($db);
    $arrCurrentReq = $req_spec_mgr->get_requirements($srs_id);
    $result = null;
    if (count($arrCurrentReq)) {
        // only if some reqs exist
        foreach ($arrCurrentReq as $data) {
            $result[$data['id']] = $data['req_doc_id'];
        }
    }
    return $result;
}
예제 #2
0
$node = $tree_mgr->get_node_hierarchy_info($args->reqspec_id);
$gui = new stdClass();
$gui->object_name = '';
$gui->object_name = $node['name'];
$gui->page_title = sprintf(lang_get('print_requirement_specification'), $node['name']);
$gui->tproject_name = $args->tproject_name;
$gui->tproject_id = $args->tproject_id;
$gui->reqspec_id = $args->reqspec_id;
// Struture defined in printDocument.php
$options = array('toc' => 0, 'req_spec_scope' => 1, 'req_spec_author' => 1, 'req_spec_type' => 1, 'req_spec_cf' => 1, 'req_spec_overwritten_count_reqs' => 1, 'headerNumbering' => 0, 'docType' => SINGLE_REQSPEC);
$text2print = '';
$text2print .= renderHTMLHeader($gui->page_title, $_SESSION['basehref'], SINGLE_REQSPEC) . '<body>';
//$text2print .= '<div><h2>' . lang_get('req_specification') . '</h2></div>';
$text2print .= renderReqSpecNodeForPrinting($db, $node, $options, null, 0, $args->tproject_id);
// now get all it's children (just requirements).
$childrenReq = $reqspec_mgr->get_requirements($args->reqspec_id);
if (!is_null($childrenReq) && $req_cfg->show_child_reqs_on_reqspec_print_view) {
    // IMPORTANT NOTICE:
    // 'docType' => 'SINGLE_REQ' among other things remove the indent on req table
    // that is present by default.
    // That's why we need to pass any other value.
    $reqPrintOpts = array('toc' => 0, 'req_linked_tcs' => 1, 'req_cf' => 1, 'req_scope' => 1, 'req_relations' => 1, 'req_coverage' => 1, 'req_status' => 1, 'req_type' => 1, 'req_author' => 1, 'displayVersion' => 1, 'displayDates' => 1, 'displayLastEdit' => 1, 'docType' => SINGLE_REQ);
    $text2print .= '<div><h2>' . lang_get('reqs') . '</h2></div>';
    $loop2do = count($childrenReq);
    for ($rdx = 0; $rdx < $loop2do; $rdx++) {
        $text2print .= renderReqForPrinting($db, $childrenReq[$rdx], $reqPrintOpts, null, 0, $args->tproject_id);
    }
}
$text2print .= renderEOF();
echo $text2print;
/*
예제 #3
0
/**
 * processTestCase
 *
 */
function processTestCase(&$dbHandler, &$argsObj, &$guiObj)
{
    $tproject_mgr = new testproject($dbHandler);
    $guiObj->arrReqSpec = $tproject_mgr->genComboReqSpec($argsObj->tproject_id, 'dotted', "&nbsp;");
    $SRS_qty = count($guiObj->arrReqSpec);
    if ($SRS_qty > 0) {
        $tc_mgr = new testcase($dbHandler);
        $arrTc = $tc_mgr->get_by_id($argsObj->id);
        if ($arrTc) {
            $guiObj->tcTitle = $arrTc[0]['name'];
            // get first ReqSpec if not defined
            if (is_null($argsObj->idReqSpec)) {
                reset($guiObj->arrReqSpec);
                $argsObj->idReqSpec = key($guiObj->arrReqSpec);
            }
            if ($argsObj->idReqSpec) {
                $req_spec_mgr = new requirement_spec_mgr($dbHandler);
                $guiObj->arrAssignedReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec, 'assigned', $argsObj->id);
                if (!is_null($guiObj->arrAssignedReq)) {
                    $xc = $req_spec_mgr->getAssignedCoverage($argsObj->idReqSpec);
                    $l2d = count($guiObj->arrAssignedReq);
                    for ($xdx = 0; $xdx < $l2d; $xdx++) {
                        $guiObj->arrAssignedReq[$xdx]['coverageAuthor'] = $xc[$guiObj->arrAssignedReq[$xdx]['id']]['login'];
                        $guiObj->arrAssignedReq[$xdx]['coverageTS'] = $xc[$guiObj->arrAssignedReq[$xdx]['id']]['creation_ts'];
                    }
                }
                $guiObj->arrAllReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec);
                $guiObj->arrUnassignedReq = array_diff_byId($guiObj->arrAllReq, $guiObj->arrAssignedReq);
            }
        }
    }
    return $guiObj;
}
예제 #4
0
/**
 * processTestCase
 *
 */
function processTestCase(&$dbHandler, &$argsObj, &$guiObj)
{
    $tproject_mgr = new testproject($dbHandler);
    // $guiObj->arrReqSpec = $tproject_mgr->getOptionReqSpec($argsObj->tproject_id,testproject::GET_NOT_EMPTY_REQSPEC);
    $guiObj->arrReqSpec = $tproject_mgr->genComboReqSpec($argsObj->tproject_id);
    $SRS_qty = count($guiObj->arrReqSpec);
    if ($SRS_qty > 0) {
        $tc_mgr = new testcase($dbHandler);
        $arrTc = $tc_mgr->get_by_id($argsObj->id);
        if ($arrTc) {
            $guiObj->tcTitle = $arrTc[0]['name'];
            // get first ReqSpec if not defined
            if (is_null($argsObj->idReqSpec)) {
                reset($guiObj->arrReqSpec);
                $argsObj->idReqSpec = key($guiObj->arrReqSpec);
            }
            if ($argsObj->idReqSpec) {
                $req_spec_mgr = new requirement_spec_mgr($dbHandler);
                $guiObj->arrAssignedReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec, 'assigned', $argsObj->id);
                $guiObj->arrAllReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec);
                $guiObj->arrUnassignedReq = array_diff_byId($guiObj->arrAllReq, $guiObj->arrAssignedReq);
            }
        }
    }
    return $guiObj;
}