Esempio n. 1
0
<?php 
require_once "../../config.inc.php";
require_once "common.php";
testlinkInitPage($db, false, false, "checkRights");
$args = init_args();
$platform_mgr = new tlPlatform($db, $args->testproject_id);
$var_id = $_GET['varid'];
$suite_id = $_GET['suiteid'];
$all = $_GET['all'];
$verify = isset($_GET['verify']) ? $_GET['verify'] : 0;
$devices = $platform_mgr->getVarDevices($var_id, $suite_id);
$a = count($devices[0]);
echo "<p align='center'>共有<span style='color:red'>{$a}</span>款设备:<b>{$devices['all']}</b></p>";
if ($a == 0) {
    echo "<p align='center'><a href='viewVar.php?var_id={$var_id}&suite_id={$suite_id}'>返     回</a></p>";
} else {
    echo "<form name='form1' action='/lib/dcnVars/assign2AllPlan_delete.php?varid={$var_id}&suiteid={$suite_id}&all={$all}' method='post'>";
    echo "<table align='center'><tbody>";
    foreach ($devices[0] as $device) {
        $tplans = $platform_mgr->getDeviceTplan($device['id'], $all);
        foreach ($tplans[0] as $nn => $tplan) {
            $needdelete[$device['id'] . '-' . $tplan['id']] = $platform_mgr->modifyTplanCasesFromVar($tplan['id'], $device['id'], $var_id, $suite_id, $args->login_username, 'add');
            if ($needdelete[$device['id'] . '-' . $tplan['id']] != null) {
                echo "<tr><td align='center'>{$tplan['name']}-{$device['name']}:<input type='checkbox' id='{$tplan['id']}-{$device['id']}' name='{$tplan['id']}-{$device['id']}'></input></td></tr>";
            }
        }
    }
    $allneed = 0;
    foreach ($needdelete as $tt) {
        if ($tt != null) {
            $allneed++;