Example #1
0
if ($gui->row_qty > 0) {
    if ($map) {
        $tcase_mgr = new testcase($db);
        $tcase_set = array_keys($map);
        $options = array('output_format' => 'path_as_string');
        $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose($tcase_set, $options);
        $gui->resultSet = $map;
    }
} else {
    if ($emptyTestProject) {
        $gui->warning_msg = lang_get('empty_testproject');
    } else {
        $gui->warning_msg = lang_get('no_records_found');
    }
}
$img = $smarty->getImages();
$table = buildExtTable($gui, $charset, $img['edit_icon'], $img['history_small']);
if (!is_null($table)) {
    $gui->tableSet[] = $table;
}
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $tpl);
/**
 * 
 *
 */
function buildExtTable($gui, $charset, $edit_icon, $history_icon)
{
    $table = null;
    if (count($gui->resultSet) > 0) {
        $labels = array('test_suite' => lang_get('test_suite'), 'test_case' => lang_get('test_case'));
Example #2
0
 case 'disableRequirements':
     if ($addIssueTracker = $addReqMgrSystem = is_null($template)) {
         $template = 'projectView.tpl';
         $gui->name = '';
         // needed after addition of search function on test project view
     }
     $gui->doAction = $reloadType;
     $opt = array('output' => 'array_of_map', 'order_by' => " ORDER BY nodes_hierarchy.name ", 'add_issuetracker' => $addIssueTracker, 'add_reqmgrsystem' => $addReqMgrSystem);
     $gui->tprojects = $tproject_mgr->get_accessible_for_user($args->userID, $opt);
     $gui->pageTitle = lang_get('title_testproject_management');
     $gui->itemQty = count($gui->tprojects);
     if ($gui->itemQty > 0) {
         $gui->pageTitle .= ' ' . sprintf(lang_get('available_test_projects'), $gui->itemQty);
     }
     if ($addIssueTracker) {
         $imgSet = $smarty->getImages();
         $loop2do = count($gui->tprojects);
         $labels = init_labels(array('active_integration' => null, 'inactive_integration' => null));
         for ($idx = 0; $idx < $loop2do; $idx++) {
             $gui->tprojects[$idx]['itstatusImg'] = '';
             if ($gui->tprojects[$idx]['itname'] != '') {
                 $ak = $gui->tprojects[$idx]['issue_tracker_enabled'] ? 'active' : 'inactive';
                 $gui->tprojects[$idx]['itstatusImg'] = ' <img title="' . $labels[$ak . '_integration'] . '" ' . ' alt="' . $labels[$ak . '_integration'] . '" ' . ' src="' . $imgSet[$ak] . '"/>';
             }
         }
     }
     if ($addReqMgrSystem) {
         $imgSet = $smarty->getImages();
         $loop2do = count($gui->tprojects);
         $labels = init_labels(array('active_integration' => null, 'inactive_integration' => null));
         for ($idx = 0; $idx < $loop2do; $idx++) {
Example #3
0
require_once 'requirements.inc.php';
require_once 'exttable.class.php';
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$tproject_mgr = new testproject($db);
$tplan_mgr = new testplan($db);
$req_mgr = new requirement_mgr($db);
$req_spec_mgr = new requirement_spec_mgr($db);
$title_sep = config_get('gui_title_separator_1');
$charset = config_get('charset');
$req_cfg = config_get('req_cfg');
list($req_spec_type_labels, $req_type_labels, $status_labels, $labels) = setUpLabels($req_cfg);
list($results_cfg, $status_code_map, $code_status_map, $eval_status_map) = setUpReqStatusCfg();
$args = init_args($tproject_mgr, $tplan_mgr, $req_cfg);
$images = $smarty->getImages();
$gui = init_gui($args, $tplan_mgr);
$i2u = array('edit_icon', 'exec_icon', 'history_small');
foreach ($i2u as $ik) {
    $images[$ik] = $gui->baseHref . $images[$ik];
}
$reqContext = array('tproject_id' => $args->tproject_id, 'tplan_id' => $args->tplan_id, 'platform_id' => $args->platform);
$reqSetX = (array) $req_mgr->getAllByContext($reqContext);
$req_ids = array_keys($reqSetX);
$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . config_get('testcase_cfg')->glue_character;
$req_spec_map = array();
$testcases = array();
// first step: get the requirements and linked testcases with which we have to work,
// order them into $req_spec_map by spec
$gui->total_reqs = 0;
if (count($req_ids)) {
Example #4
0
    $context = new stdClass();
    $context->tproject_id = $args->tproject_id;
    $context->tplan_id = $args->tplan_id;
    $tplan_mgr = new testplan($db);
    $dmy = $tplan_mgr->get_by_id($context->tplan_id);
    $gui->buildInfoSet = $tplan_mgr->get_builds($gui->tplan_id);
    $report_plans = $tplan_mgr->report_get_plans($args->tproject_id);
    $report_suites = $tplan_mgr->report_get_suites($args->tproject_id);
    $report_builds = $tplan_mgr->report_get_builds();
    $report_build_total = count($report_builds);
    $report_devices = $tplan_mgr->report_get_devices($args->tproject_id);
    $report_device_total = count($report_devices);
    unset($tplan_mgr);
    $context->apikey = $dmy['api_key'];
    // $context->apikey = $_SESSION['currentUser']->userApiKey;
    $context->imgSet = $smarty->getImages();
    $gui->menuItems = $reports_mgr->get_list_reports($context, $gui->btsEnabled, $args->optReqs, $tlCfg->reports_formats[$args->format]);
}
$smarty->assign('gui', $gui);
$smarty->assign('report_plans', $report_plans);
$smarty->assign('report_suites', $report_suites);
$smarty->assign('report_builds', json_encode($report_builds));
$smarty->assign('report_build_total', $report_build_total);
$smarty->assign('report_devices', json_encode($report_devices));
$smarty->assign('report_device_total', $report_device_total);
$smarty->assign('arrReportTypes', localize_array($tlCfg->reports_formats));
$smarty->assign('selectedReportType', $args->format);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * 
 *
$templateCfg = templateConfiguration();
$tplan_mgr = new testplan($db);
$args = init_args($tplan_mgr);
$gui = initializeGui($db, $args);
// create it here, in order to be able to get tlImages
$smarty = new TLSmarty();
$msg_key = 'no_linked_tcversions';
if ($tplan_mgr->count_testcases($args->tplan_id) > 0) {
    $platformCache = null;
    $msg_key = 'all_testcases_have_tester';
    $cfg = config_get('results');
    $metricsMgr = new tlTestPlanMetrics($db);
    $metrics = $metricsMgr->getNotRunWoTesterAssigned($args->tplan_id, null, null, array('output' => 'array', 'ignoreBuild' => true));
    if (($gui->row_qty = count($metrics)) > 0) {
        $msg_key = '';
        $links = featureLinks($gui->labels, $smarty->getImages());
        $gui->pageTitle .= " - " . $gui->labels['match_count'] . ":" . $gui->row_qty;
        if ($args->show_platforms) {
            $platformCache = $tplan_mgr->getPlatforms($args->tplan_id, array('outputFormat' => 'mapAccessByID'));
        }
        // Collect all tcases id and get all test suite paths
        $targetSet = array();
        foreach ($metrics as &$item) {
            $targetSet[] = $item['tcase_id'];
        }
        $tree_mgr = new tree($db);
        $path_info = $tree_mgr->get_full_path_verbose($targetSet);
        unset($tree_mgr);
        unset($targetSet);
        $data = array();
        foreach ($metrics as &$item) {
                $gui->result = $user->setActive($db, 0);
                if ($gui->result >= tl::OK) {
                    logAuditEvent(TLS("audit_user_disabled", $user->login), "DISABLE", $args->user_id, "users");
                    $gui->user_feedback = sprintf(lang_get('user_disabled'), $user->login);
                }
            }
        }
        if ($gui->result != tl::OK) {
            $gui->user_feedback = lang_get('error_user_not_disabled');
        }
        break;
    default:
        break;
}
$gui->matrix = $users = getAllUsersForGrid($db);
$gui->images = $smarty->getImages();
$gui->tableSet[] = buildMatrix($gui, $args);
$highlight = initialize_tabsmenu();
$highlight->view_users = 1;
$smarty->assign('highlight', $highlight);
$smarty->assign('update_title_bar', 0);
$smarty->assign('reload', 0);
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 *
 */
function initEnv(&$dbHandler)
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    // input from GET['HelloString3'],
Example #7
0
* @since 1.9.15
*/
require '../../config.inc.php';
require_once '../../third_party/codeplex/PHPExcel.php';
// Must be included BEFORE common.php
require_once 'common.php';
require_once 'displayMgr.php';
$timerOn = microtime(true);
// will be used to compute elapsed time
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$args = init_args($db);
$metricsMgr = new tlTestPlanMetrics($db);
$tplan_mgr =& $metricsMgr;
// displayMemUsage('START' . __FILE__);
list($gui, $labels, $cfg) = initializeGui($db, $args, $smarty->getImages(), $tplan_mgr);
$args->cfg = $cfg;
$mailCfg = buildMailCfg($gui);
// We have faced a performance block due to an environment with
// 700 Builds and 1300 Test Cases on Test Plan
// This created a block on NOT RUN QUERY, but anyway will produce an enormous and
// unmanageable matrix on screen
//
// New way to process:
// ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use
// Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry
//
if ($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit || $args->do_action == 'result') {
    setUpBuilds($args, $gui);
    $tpl = $templateCfg->default_template;
    $opt = null;