Example #1
0
require_once "../../config.inc.php";
require_once "common.php";
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$args = init_args();
$platform_mgr = new tlPlatform($db, $args->testproject_id);
$gui = new stdClass();
$gui->vars = $platform_mgr->getAllVars();
$total_vars = count($gui->vars);
$gui->suites = $platform_mgr->getAllSuites();
$gui->current_var = 0;
$gui->current_suite = 0;
if (isset($_GET['suite_id'])) {
    $gui->current_suite = $_GET['suite_id'];
    if (isset($_GET['add_var_name'])) {
        $addresult = $platform_mgr->addNewVar($_GET['suite_id'], $_GET['add_var_name']);
        if ($addresult == 0) {
            echo "<script>alert('分支名称已经存在,请检查!');</script>";
        }
    }
}
if (isset($_GET['var_id'])) {
    if (isset($_GET['deletecase'])) {
        $platform_mgr->deleteVarTcversion($_GET['var_id'], $_GET['deletecase']);
    }
    if (isset($_GET['add_case_script'])) {
        $result = $platform_mgr->addVarTcversion($_GET['var_id'], $_GET['add_case_script'], $args->login_username);
        echo "<script>alert('{$result}');</script>";
    }
    $gui->var_tcversion = $platform_mgr->getVarTcversions($_GET['suite_id'], $_GET['var_id']);
    $gui->current_var = $_GET['var_id'];