function initializeGui(&$dbHandler, $argsObj, &$tplanMgr, &$tcaseMgr)
{
    $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id);
    $tcase_cfg = config_get('testcase_cfg');
    $gui = new stdClass();
    $gui->platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
    $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan($argsObj->tplan_id);
    $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
    $gui->bulk_platforms[0] = lang_get("all_platforms");
    ksort($gui->bulk_platforms);
    $gui->send_mail = $argsObj->send_mail;
    $gui->send_mail_checked = "";
    if ($gui->send_mail) {
        $gui->send_mail_checked = ' checked="checked" ';
    }
    $gui->glueChar = $tcase_cfg->glue_character;
    if ($argsObj->level != 'testproject') {
        $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id);
        $gui->testCasePrefix .= $tcase_cfg->glue_character;
        $gui->keywordsFilterType = $argsObj->keywordsFilterType;
        $gui->build_id = $argsObj->build_id;
        $gui->tplan_id = $argsObj->tplan_id;
        $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id);
        $gui->testPlanName = $tplan_info['name'];
        $build_info = $tplanMgr->get_build_by_id($argsObj->tplan_id, $argsObj->build_id);
        $gui->buildName = $build_info['name'];
        $gui->main_descr = sprintf(lang_get('title_tc_exec_assignment'), $gui->buildName, $gui->testPlanName);
        $tproject_mgr = new testproject($dbHandler);
        $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id);
        $gui->all_users = tlUser::getAll($dbHandler, null, "id", null);
        $gui->users = getUsersForHtmlOptions($dbHandler, null, null, null, $gui->all_users);
        $gui->testers = getTestersForHtmlOptions($dbHandler, $argsObj->tplan_id, $tproject_info, $gui->all_users);
    }
    return $gui;
}
Example #2
0
function initializeGui(&$dbHandler, $argsObj, &$tplanMgr, &$tcaseMgr)
{
    $tcase_cfg = config_get('testcase_cfg');
    $title_separator = config_get('gui_title_separator_1');
    $gui = new stdClass();
    $gui->tproject_id = $argsObj->tproject_id;
    $gui->tplan_id = $argsObj->tplan_id;
    $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id);
    $gui->testCasePrefix .= $tcase_cfg->glue_character;
    $gui->can_remove_executed_testcases = $argsObj->user->hasRight($dbHandler, "testplan_unlink_executed_testcases", $argsObj->tproject_id);
    $gui->can_remove_executed_testcases = $gui->can_remove_executed_testcases == 'yes';
    $tprojectInfo = $tcaseMgr->tproject_mgr->get_by_id($argsObj->tproject_id);
    $gui->priorityEnabled = $tprojectInfo['opt']->testPriorityEnabled;
    $gui->keywordsFilterType = $argsObj->keywordsFilterType;
    $gui->keywords_filter = '';
    $gui->has_tc = 0;
    $gui->items = null;
    $gui->has_linked_items = false;
    $gui->keywordsFilterType = new stdClass();
    $gui->keywordsFilterType->options = array('OR' => 'Or', 'AND' => 'And');
    $gui->keywordsFilterType->selected = $argsObj->keywordsFilterType;
    // full_control, controls the operations planAddTC_m1.tpl will allow
    // 1 => add/remove
    // 0 => just remove
    $gui->full_control = 1;
    $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id);
    $gui->testPlanName = $tplan_info['name'];
    $gui->pageTitle = lang_get('test_plan') . $title_separator . $gui->testPlanName;
    $gui->refreshTree = $argsObj->refreshTree;
    $tproject_mgr = new testproject($dbHandler);
    $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id);
    $userSet = $argsObj->user->getAll($dbHandler);
    $gui->testers = tlUser::getTestersForHtmlOptions($tplan_info, $tproject_info, $userSet);
    $gui->testerID = $argsObj->testerID;
    $gui->send_mail = $argsObj->send_mail;
    $gui->send_mail_checked = '';
    if ($gui->send_mail) {
        $gui->send_mail_checked = ' checked="checked" ';
    }
    $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id);
    $gui->platforms = $platform_mgr->getLinkedToTestplan($argsObj->tplan_id);
    $gui->platformsForHtmlOptions = null;
    $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan($argsObj->tplan_id);
    if ($gui->usePlatforms) {
        // Create options for two different select boxes. $bulk_platforms
        // has "All platforms" on top and "$platformsForHtmlOptions" has an
        // empty item
        $gui->platformsForHtmlOptions[0] = '';
        foreach ($gui->platforms as $elem) {
            $gui->platformsForHtmlOptions[$elem['id']] = $elem['name'];
        }
        $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
        $gui->bulk_platforms[0] = lang_get("all_platforms");
        ksort($gui->bulk_platforms);
    }
    //
    $gui->warning_msg = new stdClass();
    $gui->warning_msg->executed = lang_get('executed_can_not_be_removed');
    if ($gui->can_remove_executed_testcases) {
        $gui->warning_msg->executed = lang_get('has_been_executed');
    }
    // BUGID 3406
    $gui->build = init_build_selector($tplanMgr, $argsObj);
    return $gui;
}