function setUpForBulkExec($guiObj) { $guiObj->execStatusValues = testcase::createExecutionResultsMenu(); if (isset($guiObj->execStatusValues[$guiObj->cfg->tc_status['all']])) { unset($guiObj->execStatusValues[$guiObj->cfg->tc_status['all']]); } $of = web_editor("bulk_exec_notes", $_SESSION['basehref'], $guiObj->cfg->editorCfg); $of->Value = getItemTemplateContents('execution_template', $of->InstanceName, null); // Magic numbers that can be determined by trial and error $guiObj->bulk_exec_notes_editor = $of->CreateHTML(10, 60); unset($of); }
private function init_filter_result() { $result_key = 'filter_result_result'; $method_key = 'filter_result_method'; $build_key = 'filter_result_build'; if (is_null($this->testplan_mgr)) { $this->testplan_mgr = new testplan($this->db); } $tplan_id = $this->settings['setting_testplan']['selected']; $this->cfg->results = config_get('results'); // determine, which config to load and use for filter methods - depends on mode! $cfg = $this->mode == 'execution_mode' ? 'execution_filter_methods' : 'execution_assignment_filter_methods'; $this->cfg->filter_methods = config_get($cfg); // // CRITIC - Differences bewteen this configuration and // (file const.inc.php) // $tlCfg->execution_filter_methods['default_type'] // $tlCfg->execution_assignment_filter_methods['default_type'] // // Will create issues: you will see an string on HTML SELECT, but code // returned on submit will not code for string you are seeing.!!!! // // determine which filter method shall be selected by the JS function in template, // when only one build is selectable by the user $js_key_to_select = 0; if ($this->mode == 'execution_mode') { $js_key_to_select = $this->cfg->filter_methods['status_code']['current_build']; } else { if ($this->mode == 'plan_mode') { $js_key_to_select = $this->cfg->filter_methods['status_code']['specific_build']; } } // values selected by user $result_selection = $this->args->{$result_key}; $method_selection = $this->args->{$method_key}; $build_selection = $this->args->{$build_key}; // default values $default_filter_method = $this->cfg->filter_methods['default_type']; $any_result_key = $this->cfg->results['status_code']['all']; $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, testplan::GET_ACTIVE_BUILD); if (is_null($method_selection)) { $method_selection = $default_filter_method; } if (is_null($result_selection) || $this->args->reset_filters) { // no selection yet or filter reset requested $result_selection = $any_result_key; $method_selection = $default_filter_method; $build_selection = $newest_build_id; } else { $this->do_filtering = true; } // init array structure $key = 'filter_result'; $this->filters[$key] = array($result_key => array('items' => null, 'selected' => $result_selection), $method_key => array('items' => array(), 'selected' => $method_selection, 'js_selection' => $js_key_to_select), $build_key => array('items' => null, 'selected' => $build_selection)); // init menu for result selection by function from exec.inc.php $this->filters[$key][$result_key]['items'] = testcase::createExecutionResultsMenu(); $this->filters[$key][$result_key]['items'][$any_result_key] = $this->option_strings['any']; // init menu for filter method selection foreach ($this->cfg->filter_methods['status_code'] as $statusname => $statusshortcut) { $code = $this->cfg->filter_methods['status_code'][$statusname]; $this->filters[$key][$method_key]['items'][$code] = lang_get($this->cfg->filter_methods['status_label'][$statusname]); } // init menu for build selection $this->filters[$key][$build_key]['items'] = $this->testplan_mgr->get_builds_for_html_options($tplan_id, testplan::GET_ACTIVE_BUILD); // if "any" is selected, nullify the active filters if (is_array($result_selection) && in_array($any_result_key, $result_selection) || $result_selection == $any_result_key) { $this->active_filters[$result_key] = null; $this->active_filters[$method_key] = null; $this->active_filters[$build_key] = null; $this->filters[$key][$result_key]['selected'] = $any_result_key; $this->filters[$key][$method_key]['selected'] = $default_filter_method; $this->filters[$key][$build_key]['selected'] = $newest_build_id; } else { $this->active_filters[$result_key] = $result_selection; $this->active_filters[$method_key] = $method_selection; $this->active_filters[$build_key] = $build_selection; } }