// redirect if a user doesn't choose test case
if ($edit == 'testproject' || $edit == 'testsuite')
{
redirect($_SESSION['basehref'] . "/lib/general/show_help.php?help=assignReqs&locale={$_SESSION['locale']}");
exit();
}
else if($edit == 'testcase')
{
//get list of ReqSpec (not_empty)
$get_not_empty=1;
$arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);
$SRS_qty=count($arrReqSpec);
if( $SRS_qty > 0 )
{
$tc_mgr = new testcase($db);
$arrTc = $tc_mgr->get_by_id($tc_id);
if ($arrTc)
{
$tcTitle = $arrTc[0]['name'];
//get first ReqSpec if not defined
if (!$idReqSpec && $SRS_qty > 0)
{
reset($arrReqSpec);
$idReqSpec = key($arrReqSpec);
tLog('Set first SRS ID: ' . $idReqSpec);
}
if($edit == 'testcase')
{
//get list of ReqSpec (not_empty)
$get_not_empty=1;
$arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);
$SRS_qty=count($arrReqSpec);
if( $SRS_qty > 0 )
{
$tc_mgr = new testcase($db);
$arrTc = $tc_mgr->get_by_id($tc_id);
if ($arrTc)
{
$tcTitle = $arrTc[0]['name'];
//get first ReqSpec if not defined
if (!$idReqSpec && $SRS_qty > 0)
{
reset($arrReqSpec);
$idReqSpec = key($arrReqSpec);
tLog('Set first SRS ID: ' . $idReqSpec);
}
#-------testproject------------
else if($edit == 'testproject' )
{
//get list of ReqSpec (not_empty)
$get_not_empty=1;
$arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);
$SRS_qty=count($arrReqSpec);
if( $SRS_qty > 0 )
{
$tproject_mgr = new testproject($db);
$arrTproject = $tproject_mgr->get_by_id($tproject_id);
if ($arrTproject)
{
$tprojectTitle = $arrTproject[0]['name'];
//get first ReqSpec if not defined
if (!$idReqSpec && $SRS_qty > 0)
{
reset($arrReqSpec);
$idReqSpec = key($arrReqSpec);
tLog('Set first SRS ID: ' . $idReqSpec);
}
else if($edit == 'testsuite')
{
//get list of ReqSpec (not_empty)
$get_not_empty=1;
$arrReqSpec = getOptionReqSpec($db,$tproject_id,$get_not_empty);
$SRS_qty=count($arrReqSpec);
if( $SRS_qty > 0 )
{
$tsuite_mgr = new testsuite($db);
$arrTsuite = $tsuite_mgr->get_by_id($tsuite_id);
if ($arrTsuite)
{
$tsuiteTitle = $arrTsuite[0]['name'];
//get first ReqSpec if not defined
if (!$idReqSpec && $SRS_qty > 0)
{
reset($arrReqSpec);
$idReqSpec = key($arrReqSpec);
tLog('Set first SRS ID: ' . $idReqSpec);
}