コード例 #1
0
ファイル: navBar.php プロジェクト: mokal/DCN_TestLink
testlinkInitPage($db, 'initProject' == 'initProject');
$tproject_mgr = new testproject($db);
$args = init_args();
$gui = new stdClass();
$gui_cfg = config_get("gui");
$gui->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
$gui->tcasePrefix = '';
$gui->searchSize = 8;
if ($gui->tprojectID > 0) {
    $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($gui->tprojectID) . config_get('testcase_cfg')->glue_character;
    $gui->searchSize = tlStringLen($gui->tcasePrefix) + $gui_cfg->dynamic_quick_tcase_search_input_size;
}
$gui->TestProjects = $tproject_mgr->get_accessible_for_user($args->user->dbID, array('output' => 'map_name_with_inactive_mark', 'order_by' => $tlCfg->gui->tprojects_combo_order_by));
$gui->TestProjectCount = sizeof($gui->TestProjects);
$gui->TestPlanCount = 0;
$tprojectQty = $tproject_mgr->getItemCount();
if ($gui->TestProjectCount == 0 && $tprojectQty > 0) {
    // User rights configurations does not allow access to ANY test project
    $_SESSION['testprojectTopMenu'] = '';
    $gui->tprojectID = 0;
}
if ($gui->tprojectID) {
    $testPlanSet = $args->user->getAccessibleTestPlans($db, $gui->tprojectID);
    $gui->TestPlanCount = sizeof($testPlanSet);
    $tplanID = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : null;
    if (!is_null($tplanID)) {
        // Need to set this info on session with first Test Plan from $testPlanSet
        // if this test plan is present on $testPlanSet
        //	  OK we will set it on $testPlanSet as selected one.
        // else
        //    need to set test plan on session