예제 #1
0
function addIssue($dbHandler, $argsObj, $itsObj)
{
    $opOK = false;
    $msg = '';
    $resultsCfg = config_get('results');
    $tcaseMgr = new testcase($dbHandler);
    $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
    $auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
    $exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
    $dummy = $exec['status'];
    if (isset($resultsCfg['code_status'][$exec['status']])) {
        $dummy = $resultsCfg['code_status'][$exec['status']];
    }
    $exec['statusVerbose'] = sprintf(lang_get('issue_exec_result'), $dummy);
    unset($tcaseMgr);
    $signature = sprintf(lang_get('issue_generated_description'), $argsObj->exec_id, $exec['tester_login'], $exec['testplan_name']);
    if ($exec['platform_id'] > 0) {
        $signature .= sprintf(lang_get('issue_platform'), $exec['platform_name']);
    }
    $signature .= sprintf(lang_get('issue_build') . lang_get('execution_ts_iso'), $exec['build_name'], $exec['execution_ts']) . "\n" . $exec['statusVerbose'] . "\n\n" . $exec['execution_notes'];
    $rs = $itsObj->addIssue($auditSign . ' - ' . sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']), $signature);
    if ($rs['status_ok']) {
        $msg = $rs['msg'];
        $opOK = true;
        if (write_execution_bug($dbHandler, $argsObj->exec_id, $rs['id'])) {
            logAuditEvent(TLS("audit_executionbug_added", $rs['id']), "CREATE", $argsObj->exec_id, "executions");
        }
    } else {
        $msg = $rs['msg'];
    }
    return array($opOK, $msg);
}
예제 #2
0
$gui->interface_bugs = config_get('interface_bugs');
if ($gui->interface_bugs != 'NO') {
    require_once TL_ABS_PATH . 'lib' . DIRECTORY_SEPARATOR . 'bugtracking' . DIRECTORY_SEPARATOR . 'int_bugtracking.php';
}
require_once 'exec.inc.php';
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$args = init_args($g_bugInterface);
checkRights($db, $_SESSION['currentUser'], $args);
$msg = "";
if ($args->bug_id != "") {
    $msg = lang_get("error_wrong_BugID_format");
    if ($g_bugInterface->checkBugID($args->bug_id)) {
        $msg = lang_get("error_bug_does_not_exist_on_bts");
        if ($g_bugInterface->checkBugID_existence($args->bug_id)) {
            if (write_execution_bug($db, $args->exec_id, $args->bug_id)) {
                $msg = lang_get("bug_added");
                logAuditEvent(TLS("audit_executionbug_added", $args->bug_id), "CREATE", $args->exec_id, "executions");
            }
        }
    }
}
$smarty = new TLSmarty();
$smarty->assign('bugIDMaxLength', $g_bugInterface->getBugIDMaxLength());
$smarty->assign('bts_url', $g_bugInterface->getEnterBugURL());
$smarty->assign('msg', $msg);
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * 
 * @return object returns the arguments of the page
예제 #3
0
/**
 *
 */
function addIssue($dbHandler, $argsObj, $itsObj, $stepID = 0)
{
    static $my;
    if (!$my) {
        $my = new stdClass();
        $my->resultsCfg = config_get('results');
        $my->tcaseMgr = new testcase($dbHandler);
    }
    $ret = array();
    $ret['status_ok'] = true;
    $ret['msg'] = '';
    $issueText = generateIssueText($dbHandler, $argsObj, $itsObj);
    $opt = new stdClass();
    $opt->reporter = $argsObj->user->login;
    $p2check = array('issueType', 'issuePriority', 'issuePriority', 'artifactComponent', 'artifactVersion');
    foreach ($p2check as $prop) {
        if (property_exists($argsObj, $prop) && !is_null($argsObj->{$prop})) {
            $opt->{$prop} = $argsObj->{$prop};
        }
    }
    $rs = $itsObj->addIssue($issueText->summary, $issueText->description, $opt);
    $ret['msg'] = $rs['msg'];
    if ($ret['status_ok'] = $rs['status_ok']) {
        if (write_execution_bug($dbHandler, $argsObj->exec_id, $rs['id'])) {
            logAuditEvent(TLS("audit_executionbug_added", $rs['id']), "CREATE", $argsObj->exec_id, "executions");
        }
    }
    return $ret;
}
/**
 *
 */
function addIssue($dbHandler, $argsObj, $itsObj)
{
    $ret = array();
    $ret['status_ok'] = true;
    $ret['msg'] = '';
    $resultsCfg = config_get('results');
    $tcaseMgr = new testcase($dbHandler);
    $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
    $auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
    $exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
    $issueText = generateIssueText($dbHandler, $argsObj, $itsObj);
    if (property_exists($argsObj, 'bug_summary') && strlen(trim($argsObj->bug_summary)) != 0) {
        $issueText->summary = $argsObj->bug_summary;
    }
    $opt = new stdClass();
    $opt->reporter = $argsObj->user->login;
    $p2check = array('issueType', 'issuePriority', 'issuePriority', 'artifactComponent', 'artifactVersion');
    foreach ($p2check as $prop) {
        if (property_exists($argsObj, $prop) && !is_null($argsObj->{$prop})) {
            $opt->{$prop} = $argsObj->{$prop};
        }
    }
    $rs = $itsObj->addIssue($issueText->summary, $issueText->description, $opt);
    $ret['msg'] = $rs['msg'];
    if ($ret['status_ok'] = $rs['status_ok']) {
        if (write_execution_bug($dbHandler, $argsObj->exec_id, $rs['id'])) {
            logAuditEvent(TLS("audit_executionbug_added", $rs['id']), "CREATE", $argsObj->exec_id, "executions");
        }
    }
    return $ret;
}