/** * * */ function initGuiBean(&$argsObj, $caller) { $obj = new stdClass(); $obj->action = $caller; $obj->typeDomain = $this->mgr->getTypes(); $obj->canManage = $argsObj->currentUser->hasRight($this->db, 'reqmgrsystem_management'); $obj->user_feedback = array('type' => '', 'message' => ''); $obj->l18n = init_labels(array('reqmgrsystem_management' => null, 'btn_save' => null, 'create' => null, 'edit' => null, 'reqmgrsystem_deleted' => null)); // we experiment on way to get Action Description for GUI using __FUNCTION__ $obj->l18n['doUpdate'] = $obj->l18n['edit']; $obj->l18n['doCreate'] = $obj->l18n['create']; $obj->l18n['doDelete'] = ''; $obj->main_descr = $obj->l18n['reqmgrsystem_management']; $obj->action_descr = ucfirst($obj->l18n[$caller]); switch ($caller) { case 'delete': case 'doDelete': $obj->submit_button_label = ''; break; default: $obj->submit_button_label = $obj->l18n['btn_save']; break; } return $obj; }
/** * * */ function initialize_gui(&$dbHandler, $argsObj) { $tproject_mgr = new testproject($dbHandler); $itemMgr = new requirement_spec_mgr($dbHandler); $commandMgr = new reqSpecCommands($dbHandler); $gui = $commandMgr->initGuiBean(); $gui->itemCfg = config_get('req_spec_cfg'); $gui->tproject_name = $argsObj->tproject_name; $gui->grants = new stdClass(); $gui->grants->req_mgmt = $argsObj->hasRight($dbHandler, "mgt_modify_req", $argsObj->tproject_id); $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); $gui->glueChar = config_get('testcase_cfg')->glue_character; $gui->pieceSep = config_get('gui_title_separator_1'); $gui->item_id = $argsObj->item_id; $info = $itemMgr->getRevisionByID($gui->item_id, array('decode_user' => true)); $gui->item = $info; $gui->cfields = $itemMgr->html_table_of_custom_field_values(null, $gui->item_id, $argsObj->tproject_id); $gui->show_title = false; $gui->main_descr = lang_get('req_spec') . $gui->pieceSep . $gui->item['name']; $gui->showContextInfo = $argsObj->showContextInfo; if ($gui->showContextInfo) { $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->item['name']; } $gui->itemSpecStatus = null; $gui->itemTypeDomain = init_labels($gui->itemCfg->type_labels); return $gui; }
/** * * */ function initialize_gui(&$dbHandler, &$argsObj) { $req_spec_mgr = new requirement_spec_mgr($dbHandler); $tproject_mgr = new testproject($dbHandler); $commandMgr = new reqSpecCommands($dbHandler); $gui = $commandMgr->initGuiBean(); $gui->req_spec_cfg = config_get('req_spec_cfg'); $gui->req_cfg = config_get('req_cfg'); // 20100810 - asimon - BUGID 3317: disabled total count of requirements by default $gui->external_req_management = $gui->req_cfg->external_req_management == ENABLED ? 1 : 0; $gui->grants = new stdClass(); $gui->grants->req_mgmt = has_rights($db, "mgt_modify_req"); $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); $gui->req_spec_id = $argsObj->req_spec_id; $gui->tproject_name = $argsObj->tproject_name; $gui->name = $gui->req_spec['title']; $gui->main_descr = lang_get('req_spec_short') . config_get('gui_title_separator_1') . "[{$gui->req_spec['doc_id']}] :: " . $gui->req_spec['title']; $gui->refresh_tree = 'no'; $gui->cfields = $req_spec_mgr->html_table_of_custom_field_values($argsObj->req_spec_id, $argsObj->tproject_id); $gui->attachments = getAttachmentInfosFrom($req_spec_mgr, $argsObj->req_spec_id); $gui->requirements_count = $req_spec_mgr->get_requirements_count($argsObj->req_spec_id); $gui->reqSpecTypeDomain = init_labels($gui->req_spec_cfg->type_labels); /* contribution BUGID 2999, show direct link */ $prefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . '&item=reqspec&id=' . urlencode($gui->req_spec['doc_id']); return $gui; }
/** * * */ function initialize_gui(&$dbHandler, &$argsObj) { $req_spec_mgr = new requirement_spec_mgr($dbHandler); $tproject_mgr = new testproject($dbHandler); $commandMgr = new reqSpecCommands($dbHandler); $gui = $commandMgr->initGuiBean(); $gui->refreshTree = $argsObj->refreshTree; $gui->req_spec_cfg = config_get('req_spec_cfg'); $gui->req_cfg = config_get('req_cfg'); $gui->external_req_management = $gui->req_cfg->external_req_management == ENABLED ? 1 : 0; $gui->grants = new stdClass(); $gui->grants->req_mgmt = $argsObj->user->hasRight($dbHandler, "mgt_modify_req", $argsObj->tproject_id); $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); $gui->revCount = $req_spec_mgr->getRevisionsCount($argsObj->req_spec_id); $gui->req_spec_id = $argsObj->req_spec_id; $gui->parentID = $argsObj->req_spec_id; $gui->req_spec_revision_id = $gui->req_spec['revision_id']; $gui->name = $gui->req_spec['title']; $gui->tproject_id = $argsObj->tproject_id; $gui->tproject_name = $argsObj->tproject_name; $gui->main_descr = lang_get('req_spec_short') . config_get('gui_title_separator_1') . "[{$gui->req_spec['doc_id']}] :: " . $gui->req_spec['title']; $gui->refresh_tree = 'no'; $gui->cfields = $req_spec_mgr->html_table_of_custom_field_values($argsObj->req_spec_id, $gui->req_spec_revision_id, $argsObj->tproject_id); $gui->attachments = $req_spec_mgr->getAttachmentInfos($argsObj->req_spec_id); $gui->requirements_count = $req_spec_mgr->get_requirements_count($argsObj->req_spec_id); $gui->reqSpecTypeDomain = init_labels($gui->req_spec_cfg->type_labels); $prefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . '&item=reqspec&id=' . urlencode($gui->req_spec['doc_id']); $gui->actions = initializeActions($gui); return $gui; }
function __construct(&$db, &$userObj, $id = null) { $this->db = $db; $this->tprojectMgr = new testproject($db); $this->grants = new stdClass(); $this->l18n = init_labels(array('btn_create' => null, 'caption_new_tproject' => null)); if (is_null($id)) { $this->id = intval($id); } }
function __construct(&$db) { $this->db = $db; $this->reqSpecMgr = new requirement_spec_mgr($db); $this->reqMgr = new requirement_mgr($db); $req_spec_cfg = config_get('req_spec_cfg'); $this->reqSpecTypeDomain = init_labels($req_spec_cfg->type_labels); $this->submit_button_label = lang_get('btn_save'); $this->getRequirementsOptions = array('order_by' => " ORDER BY NH_REQ.node_order "); }
/** * init global map with user rights and user rights description localized. */ function init_global_rights_maps() { // Every array, defines a section in the define role page => HAS EFFECTS ONLY ON LAYOUT global $g_rights_tp; global $g_rights_mgttc; global $g_rights_kw; global $g_rights_req; global $g_rights_product; global $g_rights_cf; global $g_rights_users_global; global $g_rights_users; global $g_rights_system; global $g_rights_platforms; global $g_rights_issuetrackers; global $g_rights_executions; // global $g_rights_reqmgrsystems; global $g_propRights_global; global $g_propRights_product; // @since 1.9.7 $l18nCfg = array('desc_testplan_execute' => null, 'desc_testplan_create_build' => null, 'desc_testplan_metrics' => null, 'desc_testplan_planning' => null, 'desc_user_role_assignment' => null, 'desc_mgt_view_tc' => null, 'desc_mgt_modify_tc' => null, 'mgt_testplan_create' => null, 'desc_mgt_view_key' => null, 'desc_mgt_modify_key' => null, 'desc_keyword_assignment' => null, 'desc_mgt_view_req' => null, 'desc_mgt_modify_req' => null, 'desc_req_tcase_link_management' => null, 'desc_mgt_modify_product' => null, 'desc_project_inventory_management' => null, 'desc_project_inventory_view' => null, 'desc_cfield_view' => null, 'desc_cfield_management' => null, 'desc_platforms_view' => null, 'desc_platforms_management' => null, 'desc_issuetrackers_view' => null, 'desc_issuetrackers_management' => null, 'desc_mgt_modify_users' => null, 'desc_role_management' => null, 'desc_user_role_assignment' => null, 'desc_mgt_view_events' => null, 'desc_events_mgt' => null, 'desc_mgt_unfreeze_req' => null, 'right_exec_edit_notes' => null, 'right_exec_delete' => null, 'right_testplan_unlink_executed_testcases' => null, 'right_testproject_delete_executed_testcases' => null, 'right_testproject_edit_executed_testcases' => null, 'right_testplan_milestone_overview' => null, 'right_exec_testcases_assigned_to_me' => null, 'right_testproject_metrics_dashboard' => null, 'right_testplan_add_remove_platforms' => null, 'right_testplan_update_linked_testcase_versions' => null, 'right_testplan_set_urgent_testcases' => null, 'right_testplan_show_testcases_newest_versions' => null); $l18n = init_labels($l18nCfg); $g_rights_executions = array('exec_edit_notes' => $l18n['right_exec_edit_notes'], 'exec_delete' => $l18n['right_exec_delete']); // order is important ? $g_rights_tp = array("mgt_testplan_create" => $l18n['mgt_testplan_create'], "testplan_create_build" => $l18n['desc_testplan_create_build'], "testplan_planning" => $l18n['desc_testplan_planning'], "testplan_execute" => $l18n['desc_testplan_execute'], "testplan_metrics" => $l18n['desc_testplan_metrics'], "testplan_user_role_assignment" => $l18n['desc_user_role_assignment'], "testplan_unlink_executed_testcases" => $l18n['right_testplan_unlink_executed_testcases'], "testplan_milestone_overview" => $l18n['right_testplan_milestone_overview'], "exec_testcases_assigned_to_me" => $l18n['right_exec_testcases_assigned_to_me'], 'testplan_add_remove_platforms' => $l18n['right_testplan_add_remove_platforms'], 'testplan_update_linked_testcase_versions' => $l18n['right_testplan_update_linked_testcase_versions'], 'testplan_set_urgent_testcases' => $l18n['right_testplan_set_urgent_testcases'], 'testplan_show_testcases_newest_versions' => $l18n['right_testplan_show_testcases_newest_versions']); $g_rights_mgttc = array("mgt_view_tc" => $l18n['desc_mgt_view_tc'], "mgt_modify_tc" => $l18n['desc_mgt_modify_tc'], "testproject_delete_executed_testcases" => $l18n['right_testproject_delete_executed_testcases'], "testproject_edit_executed_testcases" => $l18n['right_testproject_edit_executed_testcases']); $g_rights_kw = array("mgt_view_key" => $l18n['desc_mgt_view_key'], "mgt_modify_key" => $l18n['desc_mgt_modify_key']); $g_rights_req = array("mgt_view_req" => $l18n['desc_mgt_view_req'], "mgt_modify_req" => $l18n['desc_mgt_modify_req'], "mgt_unfreeze_req" => $l18n['desc_mgt_unfreeze_req']); $g_rights_product = array("mgt_modify_product" => $l18n['desc_mgt_modify_product'], "project_inventory_management" => $l18n['desc_project_inventory_management'], "project_inventory_view" => $l18n['desc_project_inventory_view']); $g_rights_cf = array("cfield_view" => $l18n['desc_cfield_view'], "cfield_management" => $l18n['desc_cfield_management']); $g_rights_platforms = array("platform_view" => $l18n['desc_platforms_view'], "platform_management" => $l18n['desc_platforms_management']); $g_rights_issuetrackers = array("issuetracker_view" => $l18n['desc_issuetrackers_view'], "issuetracker_management" => $l18n['desc_issuetrackers_management']); // $g_rights_reqmgrsystems = array("reqmgrsystem_view" => $l18n['desc_reqmgrsystems_view'], // "reqmgrsystem_management" => $l18n['desc_reqmgrsystems_management']); // Global means test project independent. // // $g_rights_users_global = array("mgt_users" => $l18n['desc_mgt_modify_users'], // "role_management" => $l18n['desc_role_management'], // "user_role_assignment" => $l18n['desc_user_role_assignment']); $g_rights_users_global = array("mgt_users" => $l18n['desc_mgt_modify_users'], "role_management" => $l18n['desc_role_management']); $g_rights_users = $g_rights_users_global; $g_rights_system = array("mgt_view_events" => $l18n['desc_mgt_view_events'], "events_mgt" => $l18n['desc_events_mgt']); $g_propRights_global = array_merge($g_rights_users_global, $g_rights_system, $g_rights_product); unset($g_propRights_global["testproject_user_role_assignment"]); $g_propRights_product = array_merge($g_propRights_global, $g_rights_mgttc, $g_rights_kw, $g_rights_req); }
function initializeGUI(&$dbHandler, $argsObj) { $gui = new stdClass(); $gui->tc_id = $argsObj->tcase_id; $gui->compare_selected_versions = $argsObj->compare_selected_versions; $gui->context = $argsObj->context; $tcaseMgr = new testcase($dbHandler); $gui->tc_versions = $tcaseMgr->get_by_id($argsObj->tcase_id); $gui->tcaseName = $gui->tc_versions[0]['name']; unset($tcaseMgr); $lblkeys = array('num_changes' => null, 'no_changes' => null, 'version_short' => null, 'diff_subtitle_tc' => null); $gui->labels = init_labels($lblkeys); $gui->version_short = $gui->labels['version_short']; $gui->subtitle = sprintf($gui->labels['diff_subtitle_tc'], $argsObj->version_left, $argsObj->version_left, $argsObj->version_right, $argsObj->version_right, $gui->tcaseName); $gui->leftID = "v{$argsObj->version_left}"; $gui->rightID = "v{$argsObj->version_right}"; return $gui; }
function __construct(&$db) { $this->db = $db; $this->reqSpecMgr = new requirement_spec_mgr($db); $this->reqMgr = new requirement_mgr($db); $reqCfg = config_get('req_cfg'); $this->reqStatusDomain = init_labels($reqCfg->status_labels); $this->reqTypeDomain = init_labels($reqCfg->type_labels); $this->reqRelationTypeDescr = init_labels($reqCfg->rel_type_description); $type_ec = $reqCfg->type_expected_coverage; $this->attrCfg = array(); $this->attrCfg['expected_coverage'] = array(); foreach ($this->reqTypeDomain as $type_code => $dummy) { // Because it has to be used on Smarty Template, I choose to transform // TRUE -> 1, FALSE -> 0, because I've had problems using true/false $value = isset($type_ec[$type_code]) ? $type_ec[$type_code] ? 1 : 0 : 1; $this->attrCfg['expected_coverage'][$type_code] = $value; } }
function __construct(&$db, $tproject_id) { $this->db = $db; $this->reqSpecMgr = new requirement_spec_mgr($db); $this->reqMgr = new requirement_mgr($db); $this->treeMgr = $this->reqMgr->tree_mgr; $req_spec_cfg = config_get('req_spec_cfg'); $this->reqSpecTypeDomain = init_labels($req_spec_cfg->type_labels); $this->commandMgr = new reqCommands($db); $this->submit_button_label = lang_get('btn_save'); $this->getRequirementsOptions = array('order_by' => " ORDER BY NH_REQ.node_order "); $tproject_mgr = new testproject($this->db); $info = $tproject_mgr->get_by_id($tproject_id); if ($info['reqmgr_integration_enabled']) { $sysmgr = new tlReqMgrSystem($this->db); $rms = $sysmgr->getInterfaceObject($tproject_id); $this->reqMgrSystem = $sysmgr->getLinkedTo($tproject_id); unset($sysmgr); } }
/** * * */ function initialize_gui(&$dbHandler, &$argsObj) { $req_spec_mgr = new requirement_spec_mgr($dbHandler); $tproject_mgr = new testproject($dbHandler); $commandMgr = new reqSpecCommands($dbHandler, $argsObj->tproject_id); $gui = $commandMgr->initGuiBean(); $gui->refreshTree = $argsObj->refreshTree; $gui->req_spec_cfg = config_get('req_spec_cfg'); $gui->req_cfg = config_get('req_cfg'); $gui->external_req_management = $gui->req_cfg->external_req_management == ENABLED ? 1 : 0; $gui->grants = new stdClass(); $gui->grants->req_mgmt = has_rights($db, "mgt_modify_req"); $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); $gui->revCount = $req_spec_mgr->getRevisionsCount($argsObj->req_spec_id); $gui->req_spec_id = intval($argsObj->req_spec_id); $gui->parentID = $argsObj->req_spec_id; $gui->req_spec_revision_id = $gui->req_spec['revision_id']; $gui->name = $gui->req_spec['title']; $gui->tproject_name = $argsObj->tproject_name; $gui->main_descr = lang_get('req_spec_short') . config_get('gui_title_separator_1') . "[{$gui->req_spec['doc_id']}] :: " . $gui->req_spec['title']; $gui->refresh_tree = 'no'; $gui->cfields = $req_spec_mgr->html_table_of_custom_field_values($gui->req_spec_id, $gui->req_spec_revision_id, $argsObj->tproject_id); $gui->attachments = getAttachmentInfosFrom($req_spec_mgr, $argsObj->req_spec_id); $gui->requirements_count = $req_spec_mgr->get_requirements_count($argsObj->req_spec_id); $gui->reqSpecTypeDomain = init_labels($gui->req_spec_cfg->type_labels); $prefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . '&item=reqspec&id=' . urlencode($gui->req_spec['doc_id']); $gui->fileUploadURL = $_SESSION['basehref'] . $req_spec_mgr->getFileUploadRelativeURL($gui->req_spec_id); $gui->delAttachmentURL = $_SESSION['basehref'] . $req_spec_mgr->getDeleteAttachmentRelativeURL($gui->req_spec_id); $gui->fileUploadMsg = ''; $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; $gui->btn_import_req_spec = ''; $gui->reqMgrSystemEnabled = 0; if (!is_null($reqMgrSystem = $commandMgr->getReqMgrSystem())) { $gui->btn_import_req_spec = sprintf(lang_get('importViaAPI'), $reqMgrSystem['reqmgrsystem_name']); $gui->reqMgrSystemEnabled = 1; } return $gui; }
$dummy = generateIssueText($db, $args, $its); $gui->bug_summary = $dummy->summary; break; case 'doCreate': $gui->bug_summary = $args->bug_summary; $ret = addIssue($db, $args, $its); $gui->issueTrackerCfg->tlCanCreateIssue = $ret['status_ok']; $gui->msg = $ret['msg']; break; } } else { if ($args->user_action == 'link' || $args->user_action == 'add_note') { // Well do not think is very elegant to check for $args->bug_id != "" // to understand if user has pressed ADD Button if (!is_null($issueT) && $args->bug_id != "") { $l18n = init_labels(array("error_wrong_BugID_format" => null, "error_bug_does_not_exist_on_bts" => null)); switch ($args->user_action) { case 'link': $gui->msg = $l18n["error_wrong_BugID_format"]; if ($its->checkBugIDSyntax($args->bug_id)) { if ($its->checkBugIDExistence($args->bug_id)) { if (write_execution_bug($db, $args->exec_id, $args->bug_id)) { $gui->msg = lang_get("bug_added"); logAuditEvent(TLS("audit_executionbug_added", $args->bug_id), "CREATE", $args->exec_id, "executions"); // blank notes will not be added :). if ($gui->issueTrackerCfg->tlCanAddIssueNote && strlen($gui->bug_notes) > 0) { // will do call to update issue Notes $its->addNote($args->bug_id, $gui->bug_notes); } } } else {
/** * establishes connection to the bugtracking system * * @return bool returns true if the soap connection was established and the * wsdl could be downloaded, false else * **/ function connect() { $this->interfaceViaDB = false; $op = $this->getClient(array('log' => true)); if ($this->connected = $op['connected']) { // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need // to do a simple call with user/password only to understand if we are really connected try { $this->APIClient = $op['client']; $this->authToken = $this->APIClient->login($this->cfg->username, $this->cfg->password); $statusSet = $op['client']->getStatuses($this->authToken); foreach ($statusSet as $key => $pair) { $this->statusDomain[$pair->name] = $pair->id; } $this->l18n = init_labels($this->labels); } catch (SoapFault $f) { $this->connected = false; tLog(__CLASS_ . " - SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", "ERROR"); } } return $this->connected; }
* */ require_once "../../config.inc.php"; require_once "common.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); $tplan_mgr = new testplan($db); $args = init_args($tplan_mgr); checkRights($db, $_SESSION['currentUser'], $args); $gui = new stdClass(); $gui->pageTitle = lang_get('caption_testCasesWithoutTester'); $gui->warning_msg = ''; $gui->tproject_id = $args->tproject_id; $gui->tproject_name = $args->tproject_name; $gui->tplan_name = $args->tplan_name; $labels = init_labels(array('design' => null, 'execution' => null, 'execution_history' => null)); $edit_img = TL_THEME_IMG_DIR . "edit_icon.png"; $history_img = TL_THEME_IMG_DIR . "history_small.png"; $msg_key = 'no_linked_tcversions'; if ($tplan_mgr->count_testcases($args->tplan_id) > 0) { $msg_key = 'all_testcases_have_tester'; // BUGID 3723 - filter test cases by exec_status => not run $cfg = config_get('results'); $filters = array('assigned_to' => TL_USER_NOBODY, 'exec_status' => $cfg['status_code']['not_run']); $options = array('output' => 'array', 'details' => 'summary'); $testCaseSet = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options); if (($gui->row_qty = count($testCaseSet)) > 0) { $msg_key = ''; $gui->pageTitle .= " - " . lang_get('match_count') . ":" . $gui->row_qty; $tproject_mgr = new testproject($db); $prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id);
private function init_filter_spec_type() { $key = 'filter_spec_type'; $selection = $this->args->{$key}; // get configured types and add "any" string to menu $items = array(self::ANY => $this->option_strings['any']) + (array) init_labels($this->configuration->req_spec_cfg->type_labels); if (!$selection || $this->args->reset_filters || is_array($selection) && in_array(self::ANY, $selection)) { $selection = null; } else { $this->do_filtering = true; } $this->filters[$key] = array('selected' => $selection, 'items' => $items); $this->active_filters[$key] = $selection; }
/** * get Columns definition for table to display * */ function getColumnsDefinition($optionalColumns) { static $labels; if (is_null($labels)) { $lbl2get = array('user' => null, 'testsuite' => null, 'testcase' => null, 'priority' => null, 'status' => null, 'version' => null, 'title_created' => null); $labels = init_labels($lbl2get); } $colDef = array(); // sort by test suite per default $sortByCol = $labels['testsuite']; $colDef[] = array('title_key' => '', 'width' => 80); $colDef[] = array('title_key' => 'testsuite', 'width' => 130); $colDef[] = array('title_key' => 'testcase', 'width' => 130); // 20100816 - asimon - if priority is enabled, enable default sorting by that column if ($optionalColumns['priority']) { $sortByCol = $labels['priority']; $prios_for_filter = array(lang_get('low_priority'), lang_get('medium_priority'), lang_get('high_priority')); $colDef[] = array('title_key' => 'priority', 'width' => 50, 'filter' => 'ListSimpleMatch', 'filterOptions' => $prios_for_filter); } $colDef[] = array('title_key' => 'status', 'width' => 50, 'type' => 'status'); $colDef[] = array('title_key' => 'title_created', 'width' => 75); $colDef[] = array('title_key' => 'title_last_mod', 'width' => 75); return array($colDef, $sortByCol); }
function buildExtTable($gui, $charset) { $lbl = array('edit' => 'requirement_spec', 'rev' => 'revision_short', 'req_spec' => 'req_spec', 'revision_tag' => 'revision_tag', 'open_on_new_window' => 'open_on_new_window'); $labels = init_labels($lbl); $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; $table = null; // $gui->resultSet - // key: reqspec_id // value: array of matches // array // { // [232][0]=>{"name" => "QA","id" => "232","doc_id" => "QA", // "revision_id" => "251", "revision" => "4"} // [1]=>{"name" => "QA","id" => "232","doc_id" => "QA", // "revision_id" => "251", "revision" => "3"} // ... // } // // if (count($gui->resultSet) > 0) { $matrixData = array(); $columns = array(); $columns[] = array('title_key' => 'req_spec', 'type' => 'text', 'groupable' => 'false', 'hideable' => 'false'); $key2loop = array_keys($gui->resultSet); foreach ($key2loop as $rspec_id) { $rowData = array(); $itemSet = $gui->resultSet[$rspec_id]; $rfx =& $itemSet[0]; $path = $gui->path_info[$rfx['id']] ? $gui->path_info[$rfx['id']] . " / " : ""; $edit_link = "<a href=\"javascript:openLinkedReqSpecWindow(" . $rfx['id'] . ")\">" . "<img title=\"{$labels['edit']}\" src=\"{$edit_icon}\" /></a> "; $title = htmlentities($rfx['doc_id'], ENT_QUOTES, $charset) . ":" . htmlentities($rfx['name'], ENT_QUOTES, $charset); $cm = '<a href="javascript:openReqSpecRevisionWindow(%s)" title="' . $labels['open_on_new_window'] . '" >' . $labels['revision_tag'] . ' </a>'; // $link = $edit_link; $matches = ''; foreach ($itemSet as $rx) { $matches .= sprintf($cm, $rx['revision_id'], $rx['revision']); } $rowData[] = $edit_link . $title . ' ' . $matches; $matrixData[] = $rowData; } $table = new tlExtTable($columns, $matrixData, 'tl_table_req_spec_search'); $table->setSortByColumnName($labels['req_spec']); $table->sortDirection = 'ASC'; $table->showToolbar = false; $table->addCustomBehaviour('text', array('render' => 'columnWrap')); $table->storeTableState = false; } return $table; }
/** * Gets the columns definitions used in the report table. * * @return array containing columns and sort information */ function getColumnsDefinition() { static $labels; if (is_null($labels)) { $lbl2get = array('user' => null, 'testsuite' => null, 'testcase' => null, 'importance' => null, 'status' => null, 'version' => null, 'title_created' => null, 'low' => null, 'medium' => null, 'high' => null); $labels = init_labels($lbl2get); } $colDef = array(); $sortByCol = $labels['testsuite']; $colDef[] = array('title_key' => '', 'width' => 80); $colDef[] = array('title_key' => 'testsuite', 'width' => 130); $colDef[] = array('title_key' => 'testcase', 'width' => 130); // render and filter will be managed using customBehaviour (see $matrix->addCustomBehaviour()) $colDef[] = array('title_key' => 'importance', 'width' => 50, 'type' => 'importance'); $colDef[] = array('title_key' => 'title_created', 'width' => 75); $colDef[] = array('title_key' => 'title_last_mod', 'width' => 75); return array($colDef, $sortByCol); }
$openBugs = array(); $resolvedBugs = array(); $arrData = array(); $tplan_mgr = new testplan($db); $metricsMgr = new tlTestPlanMetrics($db); $tproject_mgr = new testproject($db); $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); $tproject_info = $tproject_mgr->get_by_id($args->tproject_id); unset($tproject_mgr); // $filters = array(); //$options = array('output' => 'array', 'only_executed' => true, 'details' => 'full'); // $execSet = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options); $execSet = (array) $metricsMgr->getLTCVNewGeneration($args->tplan_id, null, array('addExecInfo' => true, 'accessKeyType' => 'index', 'specViewFields' => true, 'testSuiteInfo' => true, 'includeNotRun' => false)); $testcase_bugs = array(); $mine = array(); $l18n = init_labels(array('execution_history' => null, 'design' => null, 'no_linked_bugs' => null)); foreach ($execSet as $execution) { $tc_id = $execution['tc_id']; $mine[] = $execution['exec_id']; $bug_urls = buildBugString($db, $execution['exec_id'], $its, $openBugs, $resolvedBugs); if ($bug_urls) { // First bug found for this tc if (!isset($testcase_bugs[$tc_id])) { $suiteName = $execution['tsuite_name']; $tc_name = $execution['full_external_id'] . ":" . $execution['name']; // add linked icons $exec_history_link = "<a href=\"javascript:openExecHistoryWindow({$tc_id});\">" . "<img title=\"" . $l18n['execution_history'] . "\" src=\"{$img['history']}\" /></a> "; $edit_link = "<a href=\"javascript:openTCEditWindow({$tc_id});\">" . "<img title=\"" . $l18n['design'] . "\" src=\"{$img['edit']}\" /></a> "; $tc_name = "<!-- " . sprintf("%010d", $execution['external_id']) . " -->" . $exec_history_link . $edit_link . $tc_name; $testcase_bugs[$tc_id] = array($suiteName, $tc_name, array()); }
function setUpReqStatusCfg() { $results_cfg = config_get('results'); $status_code_map = array(); foreach ($results_cfg['status_label_for_exec_ui'] as $status => $label) { $status_code_map[$status] = $results_cfg['status_code'][$status]; } $code_status_map = array_flip($status_code_map); foreach ($code_status_map as $code => $status) { $code_status_map[$code] = array('label' => lang_get($results_cfg['status_label'][$status]), 'long_label' => lang_get("req_title_" . $status), 'status' => $status, 'css_class' => $status . '_text'); } $eva = $code_status_map; // add additional states for requirement evaluation $evalbl = init_labels(array('partially_passed' => null, 'partially_passed_reqs' => null, 'uncovered' => null, 'uncovered_reqs' => null, 'passed_nfc' => null, 'passed_nfc_reqs' => null, 'failed_nfc' => null, 'failed_nfc_reqs' => null, 'blocked_nfc' => null, 'blocked_nfc_reqs' => null, 'not_run_nfc' => null, 'not_run_nfc_reqs' => null, 'partially_passed_nfc' => null, 'partially_passed_nfc_reqs' => null)); $eva['partially_passed'] = array('label' => $evalbl['partially_passed'], 'long_label' => $evalbl['partially_passed_reqs'], 'css_class' => 'passed_text'); $eva['uncovered'] = array('label' => $evalbl['uncovered'], 'long_label' => $evalbl['uncovered_reqs'], 'css_class' => 'not_run_text'); $eva['p_nfc'] = array('label' => $evalbl['passed_nfc'], 'long_label' => $evalbl['passed_nfc_reqs'], 'css_class' => 'passed_text'); $eva['f_nfc'] = array('label' => $evalbl['failed_nfc'], 'long_label' => $evalbl['failed_nfc_reqs'], 'css_class' => 'failed_text'); $eva['b_nfc'] = array('label' => $evalbl['blocked_nfc'], 'long_label' => $evalbl['blocked_nfc_reqs'], 'css_class' => 'blocked_text'); $eva['n_nfc'] = array('label' => $evalbl['not_run_nfc'], 'long_label' => $evalbl['not_run_nfc_reqs'], 'css_class' => 'not_run_text'); $eva['partially_passed_nfc'] = array('label' => $evalbl['partially_passed_nfc'], 'long_label' => $evalbl['partially_passed_nfc_reqs'], 'css_class' => 'passed_text'); // add count for each status to show test progress foreach ($eva as $key => $status) { $eva[$key]['count'] = 0; } return array($results_cfg, $status_code_map, $code_status_map, $eva); }
* @link http://www.teamst.org/index.php * * Compares selected requirements versions with each other. * * @internal Revisions: * 20110107 - asimon - added daisydiff (html diff engine which handles tags well) */ require_once "../../config.inc.php"; require_once "common.php"; // code for different diff engines require '../../third_party/diff/diff.php'; require '../../third_party/daisydiff/src/HTMLDiff.php'; $templateCfg = templateConfiguration(); testlinkInitPage($db); $smarty = new TLSmarty(); $labels = init_labels(array("num_changes" => null, "no_changes" => null, "diff_subtitle_req" => null, "version_short" => null, "diff_details_req" => null, "type" => null, "status" => null, "expected_coverage" => null, "revision_short" => null, "version_revision" => null)); $reqMgr = new requirement_mgr($db); $differ = new diff(); $args = init_args(); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $labels, $reqMgr); // if already two versions are selected, display diff // else display template with versions to select if ($args->compare_selected_versions) { // Side By Side $sbs = getItemsToCompare($args->left_item_id, $args->right_item_id, $gui->items); prepareUserFeedback($db, $gui, $args->req_id, $labels, $sbs); $gui->attrDiff = getAttrDiff($sbs['left_item'], $sbs['right_item'], $labels); $cfields = getCFToCompare($sbs, $args->tproject_id, $reqMgr); $gui->cfieldsDiff = null; if (!is_null($cfields)) {
/** * * */ function initialize_gui(&$dbHandler, $argsObj) { $tproject_mgr = new testproject($dbHandler); $req_mgr = new requirement_mgr($dbHandler); $commandMgr = new reqCommands($dbHandler); $gui = $commandMgr->initGuiBean(); $gui->req_cfg = config_get('req_cfg'); $gui->tproject_name = $argsObj->tproject_name; $gui->grants = new stdClass(); $gui->grants->req_mgmt = has_rights($dbHandler, "mgt_modify_req"); $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); $gui->glueChar = config_get('testcase_cfg')->glue_character; $gui->pieceSep = config_get('gui_title_separator_1'); $gui->item_id = $argsObj->item_id; // identify item is version or revision ? $node_type_id = $req_mgr->tree_mgr->get_available_node_types(); $node_id_type = array_flip($node_type_id); $item = $req_mgr->tree_mgr->get_node_hierarchy_info($gui->item_id); // TICKET 4702 // target_is is db id of item, item['id'] is the REQ ID. // for several logics we need to DB id (target_id) $info = null; switch ($node_id_type[$item['node_type_id']]) { case 'requirement_version': $info = $req_mgr->get_version($gui->item_id); $info['revision_id'] = -1; $info['target_id'] = $info['version_id']; break; case 'requirement_revision': $info = $req_mgr->get_revision($gui->item_id); $info['target_id'] = $info['revision_id']; break; } $gui->item = $info; $gui->cfields = $req_mgr->html_table_of_custom_field_values(null, $gui->item_id, $argsObj->tproject_id); $gui->show_title = false; $gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->item['title']; $gui->showReqSpecTitle = $argsObj->showReqSpecTitle; if ($gui->showReqSpecTitle) { $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->item['req_spec_title']; } $gui->reqStatus = init_labels($gui->req_cfg->status_labels); $gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels); return $gui; }
// 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(); $smarty->assign('gui', $gui); $smarty->display($tpl); /* function: args : returns: */ function init_args() {
public static function getGuiCfg() { $cfg = new stdClass(); // this can be overwritten for logic present on object/item we are using $cfg->display = true; $cfg->uploadEnabled = true; $cfg->tableStyles = "font-size:12px"; $cfg->tableClassName = "simple"; $cfg->inheritStyle = 0; $cfg->downloadOnly = false; $cfg->loadOnCancelURL = ''; // will be setted by each feature $cfg->disabledMsg = ''; // will be setted after repo checks // theses are specific to allow different behaviours ONLY on execution feature // @see const.inc.php // @see $tlCfg->exec_cfg->att_model $cfg->showUploadBtn = true; $cfg->showTitle = true; $cfg->showUploadColumn = false; $cfg->numCols = 4; $dummy = array('title_upload_attachment' => null, 'enter_attachment_title' => null, 'btn_upload_file' => null, 'warning' => null, 'enter_attachment_title' => null, 'local_file' => null, 'attachment_upload_ok' => null, 'alt_delete_attachment' => null, 'title_choose_local_file' => null, 'btn_cancel' => null, 'warning_delete_attachment' => 'warning_delete_attachment', 'delete' => null, 'attachment_feature_disabled' => null, 'attached_files' => null, 'max_size_file_upload' => null, 'upload_file_new_file' => null); $cfg->labels = init_labels($dummy); $dummy = config_get('attachments'); $cfg->accessLink = $dummy->accessIcon; return $cfg; }
/** * initialize the requirement relation labels * * @author Andreas Simon * * @return array $labels a map with all labels in following form: * Array * ( * [1] => Array * ( * [source] => parent of * [destination] => child of * ) * [2] => Array * ( * [source] => blocks * [destination] => depends on * ) * [3] => Array * ( * [source] => related to * [destination] => related to * ) * ) */ public static function get_all_relation_labels() { $labels = config_get('req_cfg')->rel_type_labels; foreach ($labels as $key => $label) { $labels[$key] = init_labels($label); } return $labels; }
/** * render a requirement specification node as HTML code for printing * * @author Andreas Simon * * @param resource $db * @param array $node the node to be printed * @param array $options * @param string $tocPrefix Prefix to be printed in TOC before title of node * @param int $level * @param int $tprojectID * * @return string $output HTML Code */ function renderReqSpecNodeForPrinting(&$db, &$node, &$options, $tocPrefix, $level, $tprojectID) { static $tableColspan; static $firstColWidth; static $labels; static $title_separator; static $req_spec_mgr; static $tplan_mgr; static $req_spec_cfg; static $reqSpecTypeLabels; static $nodeTypes; $output = ''; $level = $level > 0 ? $level : 1; if (!$req_spec_mgr) { $req_spec_cfg = config_get('req_spec_cfg'); $firstColWidth = '20%'; $tableColspan = 2; $labels = array('requirements_spec' => 'requirements_spec', 'scope' => 'scope', 'type' => 'type', 'author' => 'author', 'relations' => 'relations', 'overwritten_count' => 'req_total', 'coverage' => 'coverage', 'revision' => 'revision', 'undefined_req_spec_type' => 'undefined_req_spec_type', 'custom_field' => 'custom_field', 'not_aplicable' => 'not_aplicable'); $labels = init_labels($labels); $reqSpecTypeLabels = init_labels($req_spec_cfg->type_labels); $title_separator = config_get('gui_title_separator_1'); $req_spec_mgr = new requirement_spec_mgr($db); $tplan_mgr = new testplan($db); $nodeTypes = array_flip($tplan_mgr->tree_manager->get_available_node_types()); } switch ($nodeTypes[$node['node_type_id']]) { case 'requirement_spec_revision': $spec = $req_spec_mgr->getRevisionByID($node['id']); $spec_id = $spec['parent_id']; $who = array('parent_id' => $spec['parent_id'], 'item_id' => $spec['id'], 'tproject_id' => $spec['testproject_id']); break; case 'requirement_spec': $spec = $req_spec_mgr->get_by_id($node['id']); $spec_id = $spec['id']; $who = array('parent_id' => $spec['id'], 'item_id' => $spec['revision_id'], 'tproject_id' => $spec['testproject_id']); break; } $name = htmlspecialchars($spec['doc_id'] . $title_separator . $spec['title']); $docHeadingNumbering = $options['headerNumbering'] ? "{$tocPrefix}. " : ''; if ($options['docType'] != SINGLE_REQSPEC) { $output = '<p style="page-break-before: always"></p>'; } $output .= "<table class=\"req_spec\"><tr><th colspan=\"{$tableColspan}\">" . "<h{$level} class=\"doclevel\"> <span class=\"label\">{$docHeadingNumbering}{$labels['requirements_spec']}:</span> " . $name . "</th></tr></h{$level}>\n"; if ($options['toc']) { $spacing = $level == 2 ? "<br>" : ""; $options['tocCode'] .= $spacing . '<b><p style="padding-left: ' . 10 * $level . 'px;">' . '<a href="#' . prefixToHTMLID($tocPrefix) . '">' . $docHeadingNumbering . $name . "</a></p></b>\n"; $output .= "<a name='" . prefixToHTMLID($tocPrefix) . "'></a>\n"; } $output .= '<tr><td width="' . $firstColWidth . '"><span class="label">' . $labels['revision'] . "</span></td><td> " . $spec['revision'] . "</td></tr>\n"; if ($options['req_spec_author']) { // get author name for node $author = tlUser::getById($db, $spec['author_id']); $whois = is_null($author) ? lang_get('undefined') : $author->getDisplayName(); $output .= '<tr><td width="' . $firstColWidth . '"><span class="label">' . $labels['author'] . "</span></td><td> " . htmlspecialchars($whois) . "</td></tr>\n"; } if ($options['req_spec_type']) { $output .= '<tr><td width="' . $firstColWidth . '"><span class="label">' . $labels['type'] . "</span></td>" . "<td>"; if (isset($reqSpecTypeLabels[$spec['type']])) { $output .= $reqSpecTypeLabels[$spec['type']]; } else { $output .= sprintf($labels['undefined_req_spec_type'], $spec['type']); } $output .= "</td></tr>"; } if ($options['req_spec_overwritten_count_reqs']) { $current = $req_spec_mgr->get_requirements_count($spec['id']); $expected = $spec['total_req']; $coverage = $labels['not_aplicable'] . " ({$current}/0)"; if ($expected) { $percentage = round(100 / $expected * $current, 2); $coverage = "{$percentage}% ({$current}/{$expected})"; } $output .= '<tr><td width="' . $firstColWidth . '"><span class="label">' . $labels['overwritten_count'] . " (" . $labels['coverage'] . ")</span></td>" . "<td>" . $coverage . "</td></tr>"; } if ($options['req_spec_scope']) { $output .= "<tr><td colspan=\"{$tableColspan}\">" . $spec['scope'] . "</td></tr>"; } if ($options['req_spec_cf']) { $linked_cf = $req_spec_mgr->get_linked_cfields($who); if ($linked_cf) { foreach ($linked_cf as $key => $cf) { $cflabel = htmlspecialchars($cf['label']); $value = htmlspecialchars($cf['value']); $output .= "<tr><td width=\"{$firstColWidth}\"><span class=\"label\">" . $cflabel . "</span></td>" . "<td>{$value}</td></tr>"; } } } $output .= "</table><br/>\n"; return $output; }
* @author franciscom * @copyright 2011, TestLink community * @link http://www.teamst.org/index.php * * Compares selected requirements spec revisions with each other. * * @internal revisions */ require_once "../../config.inc.php"; require_once "common.php"; require '../../third_party/diff/diff.php'; require '../../third_party/daisydiff/src/HTMLDiff.php'; $templateCfg = templateConfiguration(); testlinkInitPage($db); $smarty = new TLSmarty(); $labels = init_labels(array("num_changes" => null, "no_changes" => null, "version_short" => null, "diff_details_rev" => null, "type" => null, "status" => null, "name" => "title", "doc_id" => null, "revision_short" => null, "revision" => null)); $itemMgr = new requirement_spec_mgr($db); $differ = new diff(); $args = init_args(); $gui = initializeGui($db, $args, $labels, $itemMgr); // if already two revisions are selected, display diff // else display template with versions to select if ($args->doCompare) { // Side By Side $sbs = getItemsToCompare($args->left_item_id, $args->right_item_id, $gui->items); prepareUserFeedback($db, $gui, $args->req_spec_id, $labels, $sbs); $gui->attrDiff = getAttrDiff($sbs['left_item'], $sbs['right_item'], $labels); $cfields = getCFToCompare($sbs, $args->tproject_id, $itemMgr); $gui->cfieldsDiff = null; if (!is_null($cfields)) { $gui->cfieldsDiff = getCFDiff($cfields, $itemMgr);
$opt_cfg->js_ot_name = 'ot'; $args = init_args($db, $opt_cfg); $level = $args->containerType; $gui_cfg = config_get('gui'); $smarty = new TLSmarty(); $smarty->assign('editorType', $editorCfg['type']); $a_tpl = array('move_testsuite_viewer' => 'containerMove.tpl', 'delete_testsuite' => 'containerDelete.tpl', 'move_testcases_viewer' => 'containerMoveTC.tpl', 'testcases_table_view' => 'containerMoveTC.tpl', 'do_copy_tcase_set' => 'containerMoveTC.tpl', 'do_copy_tcase_set_ghost' => 'containerMoveTC.tpl', 'delete_testcases' => 'containerDeleteTC.tpl', 'do_delete_testcases' => 'containerDeleteTC.tpl', 'doBulkSet' => 'containerMoveTC.tpl'); $a_actions = array('edit_testsuite' => 0, 'new_testsuite' => 0, 'delete_testsuite' => 0, 'do_move' => 0, 'do_copy' => 0, 'reorder_testsuites' => 1, 'do_testsuite_reorder' => 0, 'add_testsuite' => 1, 'move_testsuite_viewer' => 0, 'update_testsuite' => 1, 'move_testcases_viewer' => 0, 'do_move_tcase_set' => 0, 'testcases_table_view' => 0, 'do_copy_tcase_set' => 0, 'do_copy_tcase_set_ghost' => 0, 'del_testsuites_bulk' => 0, 'delete_testcases' => 0, 'do_delete_testcases' => 0, 'reorder_testcases' => 0, 'reorder_testsuites_alpha' => 0, 'reorder_testproject_testsuites_alpha' => 0, 'doBulkSet' => 0); $a_init_opt_transfer = array('edit_testsuite' => 1, 'new_testsuite' => 1, 'add_testsuite' => 1, 'update_testsuite' => 1); $the_tpl = null; $action = null; $get_c_data = null; $init_opt_transfer = null; $dummy = ($sortCriteria = config_get('testcase_reorder_by')) == 'NAME' ? '_alpha' : '_externalid'; $lbl2init = array('warning_empty_testsuite_name' => null, 'string_contains_bad_chars' => null, 'container_title_testsuite' => null, 'btn_reorder_testcases' => 'btn_reorder_testcases' . $dummy); $l18n = init_labels($lbl2init); // 20121222 -franciscom // Need this trick because current implementation of Ext.ux.requireSessionAndSubmit() // discards the original submit button if (isset($_REQUEST['doAction'])) { $_POST[$_REQUEST['doAction']] = $_REQUEST['doAction']; } $action = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; foreach ($a_actions as $the_key => $the_val) { if (isset($_POST[$the_key])) { $the_tpl = isset($a_tpl[$the_key]) ? $a_tpl[$the_key] : null; $init_opt_transfer = isset($a_init_opt_transfer[$the_key]) ? 1 : 0; $action = $the_key; $get_c_data = $the_val; $level = is_null($level) ? 'testsuite' : $level; break;
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++) { $gui->tprojects[$idx]['rmsstatusImg'] = ''; if ($gui->tprojects[$idx]['rmsname'] != '') { $ak = $gui->tprojects[$idx]['reqmgr_integration_enabled'] ? 'active' : 'inactive'; $gui->tprojects[$idx]['rmsstatusImg'] = ' <img title="' . $labels[$ak . '_integration'] . '" ' . ' alt="' . $labels[$ak . '_integration'] . '" ' . ' src="' . $imgSet[$ak] . '"/>'; } } } $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $template); break; case "ErrorOnAction": default: if ($args->doAction != "edit" && $args->doAction != "ErrorOnAction") { $of->Value = getItemTemplateContents('project_template', $of->InstanceName, $args->notes);
function initializeGui(&$dbHandler, $argsObj) { $gui = new stdClass(); $gui->tproject_name = $argsObj->tproject_name; // disable "show also closed builds" checkbox when a specific build is selected $gui->show_build_selector = $argsObj->build_id == 0; $gui->show_closed_builds = $argsObj->show_closed_builds; $gui->glueChar = config_get('testcase_cfg')->glue_character; $gui->warning_msg = ''; $gui->tableSet = null; $gui->l18n = init_labels(array('tcversion_indicator' => null, 'goto_testspec' => null, 'version' => null, 'testplan' => null, 'assigned_tc_overview' => null, 'testcases_assigned_to_user' => null, 'low_priority' => null, 'medium_priority' => null, 'high_priority' => null, 'design' => null, 'execution' => null, 'execution_history' => null)); $gui->priority = array(LOW => $gui->l18n['low_priority'], MEDIUM => $gui->l18n['medium_priority'], HIGH => $gui->l18n['high_priority']); if ($argsObj->show_all_users) { $gui->pageTitle = sprintf($gui->l18n['assigned_tc_overview'], $gui->tproject_name); } else { $gui->pageTitle = sprintf($gui->l18n['testcases_assigned_to_user'], $gui->tproject_name, $argsObj->user_name); } return $gui; }