$filters['testcaseFilter'] = isset($args->testcases_to_show) ? $args->testcases_to_show : null; $filters['assignedToFilter'] = property_exists($args, 'filter_assigned_to') ? $args->filter_assigned_to : null; $filters['executionTypeFilter'] = $args->control_panel['filter_execution_type']; $filters['cfieldsFilter'] = $args->control_panel['filter_custom_fields']; // ORDER IS CRITIC - Attention in refactoring $opt = array('assigned_on_build' => $args->build_id, 'addPriority' => true, 'addExecInfo' => false); $filters += $opt; $opt['accessKeyType'] = 'tcase+platform+stackOnUser'; $opt['useOptionalArrayFields'] = true; $opt['tlFeature'] = 'testCaseExecTaskAssignment'; // platform filter is generated inside getFilteredSpecView() using $args->control_panel['setting_platform']; // $out = getFilteredSpecView($db, $args, $tplan_mgr, $tcase_mgr, $filters, $opt); $out = getFilteredSpecViewFlat($db, $args, $tplan_mgr, $tcase_mgr, $filters, $opt); break; default: show_instructions('tc_exec_assignment'); break; } $gui->items = $out['spec_view']; // useful to avoid error messages on smarty template. $gui->items_qty = is_null($gui->items) ? 0 : count($gui->items); $gui->has_tc = $out['num_tc'] > 0 ? 1 : 0; $gui->support_array = array_keys($gui->items); if ($_SESSION['testprojectOptions']->testPriorityEnabled) { $urgencyCfg = config_get('urgency'); $gui->priority_labels = init_labels($urgencyCfg["code_label"]); } // Changing to _flat template $tpl = $templateCfg->template_dir . $templateCfg->default_template; $tpl = str_replace('.tpl', '_flat.tpl', $tpl); $smarty = new TLSmarty();
$bulkDone = true; $args->edit = 'testsuite'; if (!is_null($tcase_set) && count($tcase_set) > 0) { $bulkCounter = doBulkAssignment($db, $args, $tcase_set); } break; case 'switchspec': $args->edit = 'testsuite'; break; } if (!is_null($pfn)) { $gui = doSingleTestCaseOperation($db, $args, $gui, $pfn); } switch ($args->edit) { case 'testproject': show_instructions('assignReqs'); exit; break; case 'testsuite': $gui = processTestSuite($db, $args, $gui); $templateCfg->default_template = 'reqTcBulkAssignment.tpl'; if ($bulkDone) { $gui->user_feedback = sprintf(lang_get('bulk_assigment_done'), $bulkCounter); } break; case 'testcase': $gui = processTestCase($db, $args, $gui); break; default: tlog("Wrong GET/POST arguments.", 'ERROR'); exit;
$tcversion_id = null; $submitResult = null; $args = init_args($cfg); $smarty = new TLSmarty(); $tree_mgr = new tree($db); $tplan_mgr = new testplan($db); $tcase_mgr = new testcase($db); $exec_cfield_mgr = new exec_cfield_mgr($db, $args->tproject_id); $attachmentRepository = tlAttachmentRepository::create($db); $req_mgr = new requirement_mgr($db); $gui = initializeGui($db, $args, $cfg, $tplan_mgr, $tcase_mgr); $_SESSION['history_on'] = $gui->history_on; $attachmentInfos = null; $do_show_instructions = $args->level == "" || $args->level == 'testproject' ? 1 : 0; if ($do_show_instructions) { show_instructions('executeTest'); exit; } // --------------------------------------------------------- // Testplan executions and result archiving. Checks whether execute cases button was clicked // if ($args->doExec == 1) { /** @note get testcase ids in an array */ if (!is_null($args->tc_versions) && count($args->tc_versions)) { $status_and_notes = do_remote_execution($db, $args->tc_versions); // Need to be added to $_REQUEST, because we are using $_REQUEST as input // for the function responsible of writing exec results. write_execution() $status_map = $status_and_notes['status']; $notes_map = $status_and_notes['notes']; if (count($status_map)) { foreach ($status_map as $key => $value) {
* @package TestLink * @author Martin Havlat * @copyright 2003-2011, TestLink community * @link http://www.teamst.org/index.php * * @internal Revisions: * 20110415 - Julian - BUGID 4419: Add columns "Importance" and "Priority" * to "Set urgent Tests" **/ require '../../config.inc.php'; require_once 'common.php'; testlinkInitPage($db); $args = init_args($db); checkRights($db, $_SESSION['currentUser'], $args); if ($args->show_help) { show_instructions('test_urgency'); exit; } $templateCfg = templateConfiguration(); $tplan_mgr = new testPlanUrgency($db); $node_info = $tplan_mgr->tree_manager->get_node_hierarchy_info($args->node_id); $gui = new stdClass(); $gui->node_name = $node_info['name']; $gui->user_feedback = null; $gui->node_id = $args->node_id; $gui->tplan_id = $args->tplan_id; $gui->tplan_name = $args->tplan_name; $gui->tproject_id = $args->tproject_id; // Set urgency for test suite if ($args->urgency != OFF) { $gui->user_feedback['type'] = $tplan_mgr->setSuiteUrgency($args->tplan_id, $args->node_id, $args->urgency);
function init_args($cfgObj) { $_REQUEST = strings_stripSlashes($_REQUEST); $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; $args = new stdClass(); $args->user = $_SESSION['currentUser']; $args->user_id = $args->user->dbID; getFromSessionPool($args, $form_token); // can be a list, will arrive via form POST $args->tc_versions = isset($_REQUEST['tc_version']) ? $_REQUEST['tc_version'] : null; $args->cf_selected = isset($_REQUEST['cfields']) ? unserialize($_REQUEST['cfields']) : null; $args->doExec = isset($_REQUEST['execute_cases']) ? 1 : 0; $args->doDelete = isset($_REQUEST['do_delete']) ? $_REQUEST['do_delete'] : 0; $int2get = array('id', 'tproject_id', 'tplan_id'); foreach ($int2get as $prop) { $args->{$prop} = isset($_REQUEST[$prop]) ? intval($_REQUEST[$prop]) : 0; } $key2loop = array('level' => '', 'status' => null, 'do_bulk_save' => 0, 'save_results' => 0, 'save_and_next' => 0); foreach ($key2loop as $key => $value) { $args->{$key} = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; } // See details on: "When nullify filter_status - 20080504" in this file if (is_null($args->filter_status) || trim($args->filter_status) || $args->level == 'testcase') { $args->filter_status = null; } else { $args->filter_status = unserialize($args->filter_status); } switch ($args->level) { case 'testcase': $args->tc_id = $args->id; $args->tsuite_id = null; // some problems with $_GET that has impact on logic 'Save and Go to next test case'; if (!is_null($args->tc_versions)) { $args->tc_id = current($args->tc_versions); $args->id = $args->tc_id; $args->version_id = key($args->tc_versions); } break; case 'testsuite': $args->tsuite_id = $args->id; $args->tc_id = null; break; } buildCookies($args, $cfgObj); // Brute Force Exit if ($args->level == "" || $args->level == 'testproject') { show_instructions('executeTest'); exit; } foreach (array('tproject_id', 'tplan_id', 'build_id') as $prop) { if ($args->{$prop} <= 0) { // CRASH IMMEDIATELY throw new Exception("Execution Can NOT WORK with {$prop} <= 0"); } } return $args; }
checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $tplan_mgr, $tcase_mgr); //new dBug($gui);die(); $keywordsFilter = null; if (is_array($args->keyword_id)) { $keywordsFilter = new stdClass(); $keywordsFilter->items = $args->keyword_id; $keywordsFilter->type = $gui->keywordsFilterType->selected; } $do_display = 0; switch ($args->item_level) { case 'testsuite': $do_display = 1; break; case 'testproject': show_instructions('planAddTC'); exit; break; } switch ($args->doAction) { case 'doAddRemove': // Remember: checkboxes exist only if are checked if (!is_null($args->testcases2add)) { // items_to_link structure: // key: test case id , value: map // key: platform_id value: test case VERSION ID $items_to_link = null; foreach ($args->testcases2add as $tcase_id => $info) { foreach ($info as $platform_id => $tcase_id) { // $items_to_link[$tcase_id][$platform_id] = $args->tcversion_for_tcid[$tcase_id]; if (isset($args->tcversion_for_tcid[$tcase_id])) {
* * Purpose: Assign keywords to set of testcases in tree structure * * **/ require_once "../../config.inc.php"; require_once "common.php"; require_once "opt_transfer.php"; testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $opt_cfg = opt_transf_empty_cfg(); $opt_cfg->js_ot_name = 'ot'; $args = init_args($opt_cfg); if ($args->edit == 'testproject') { // We can NOT assign/remove keywords on a whole test project show_instructions('keywordsAssign'); exit; } $smarty = new TLSmarty(); $tproject_mgr = new testproject($db); $tcase_mgr = new testcase($db); $result = null; $keyword_assignment_subtitle = null; $can_do = 0; $itemID = null; $opt_cfg->global_lbl = ''; $opt_cfg->additional_global_lbl = null; $opt_cfg->from->lbl = lang_get('available_kword'); $opt_cfg->to->lbl = lang_get('assigned_kword'); $opt_cfg->from->map = $tproject_mgr->get_keywords_map($args->testproject_id); $opt_cfg->to->map = $tcase_mgr->get_keywords_map($args->id, " ORDER BY keyword ASC ");
* @link http://www.teamst.org/index.php * * @internal revisions * **/ require_once "../../config.inc.php"; require_once "common.php"; require_once "opt_transfer.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); $opt_cfg = opt_transf_empty_cfg(); $opt_cfg->js_ot_name = 'ot'; $args = init_args($opt_cfg); checkRights($db, $_SESSION['currentUser'], $args); if ($args->edit == 'testproject') { show_instructions('platformAssign'); exit; } $smarty = new TLSmarty(); $tplan_mgr = new testplan($db); $platform_mgr = new tlPlatform($db, $args->tproject_id); $gui = new stdClass(); $gui->platform_assignment_subtitle = null; $gui->tplan_id = $args->tplan_id; $gui->tproject_id = $args->tproject_id; $gui->can_do = isset($args->tplan_id); $gui->mainTitle = lang_get('add_remove_platforms'); $gui->warning = ''; if (isset($args->tplan_id)) { // do following check to give warning to user // if test plan has test case versions with platform_id=0