本文整理汇总了PHP中testproject::getTestCasePrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP testproject::getTestCasePrefix方法的具体用法?PHP testproject::getTestCasePrefix怎么用?PHP testproject::getTestCasePrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testproject
的用法示例。
在下文中一共展示了testproject::getTestCasePrefix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeGui
function initializeGui(&$dbHandler, &$argsObj, &$cfgObj, &$tplanMgr, &$tcaseMgr)
{
$buildMgr = new build_mgr($dbHandler);
$platformMgr = new tlPlatform($dbHandler, $argsObj->tproject_id);
$gui = new stdClass();
$gui->tplan_id = $argsObj->tplan_id;
$gui->tproject_id = $argsObj->tproject_id;
$gui->build_id = $argsObj->build_id;
$gui->platform_id = $argsObj->platform_id;
$gui->execStatusValues = null;
$gui->can_use_bulk_op = 0;
$gui->exec_notes_editors = null;
$gui->bulk_exec_notes_editor = null;
$gui->req_details = null;
$gui->attachmentInfos = null;
$gui->bugs = null;
$gui->other_exec_cfields = null;
$gui->ownerDisplayName = null;
$gui->editorType = $cfgObj->editorCfg['type'];
$gui->filter_assigned_to = $argsObj->filter_assigned_to;
$gui->tester_id = $argsObj->user_id;
$gui->include_unassigned = $argsObj->include_unassigned;
$gui->tpn_view_status = $argsObj->tpn_view_status;
$gui->bn_view_status = $argsObj->bn_view_status;
$gui->bc_view_status = $argsObj->bc_view_status;
$gui->platform_notes_view_status = $argsObj->platform_notes_view_status;
$gui->refreshTree = $argsObj->refreshTree;
if (!$argsObj->status || $argsObj->status == $cfgObj->tc_status['not_run']) {
$gui->refreshTree = 0;
}
$gui->map_last_exec_any_build = null;
$gui->map_last_exec = null;
// 20081122 - franciscom
// Just for the record:
// doing this here, we avoid to do on processTestSuite() and processTestCase(),
// but absolutely this will not improve in ANY WAY perfomance, because we do not loop
// over these two functions.
$tprojectMgr = new testproject($dbHandler);
$gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tproject_id);
$build_info = $buildMgr->get_by_id($argsObj->build_id);
$gui->build_notes = $build_info['notes'];
$gui->build_is_open = $build_info['is_open'] == 1 ? 1 : 0;
$gui->execution_types = $tcaseMgr->get_execution_types();
if ($argsObj->filter_assigned_to) {
$userSet = tlUser::getByIds($dbHandler, array_values($argsObj->filter_assigned_to));
if ($userSet) {
foreach ($userSet as $key => $userObj) {
$gui->ownerDisplayName[$key] = $userObj->getDisplayName();
}
}
}
// ------------------------------------------------------------------
$the_builds = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id);
$gui->build_name = isset($the_builds[$argsObj->build_id]) ? $the_builds[$argsObj->build_id] : '';
// 20090419 - franciscom
$gui->grants = initializeRights($dbHandler, $argsObj->user, $argsObj->tproject_id, $argsObj->tplan_id);
$gui->exec_mode = initializeExecMode($dbHandler, $cfgObj->exec_cfg, $argsObj->user, $argsObj->tproject_id, $argsObj->tplan_id);
$rs = $tplanMgr->get_by_id($argsObj->tplan_id);
$gui->testplan_notes = $rs['notes'];
// Important note:
// custom fields for test plan can be edited ONLY on design, that's reason why we are using
// scope = 'design' instead of 'execution'
$gui->testplan_cfields = $tplanMgr->html_table_of_custom_field_values($argsObj->tplan_id, 'design', array('show_on_execution' => 1));
$gui->history_on = manage_history_on($_REQUEST, $_SESSION, $cfgObj->exec_cfg, 'btn_history_on', 'btn_history_off', 'history_on');
$gui->history_status_btn_name = $gui->history_on ? 'btn_history_off' : 'btn_history_on';
$dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id);
$gui->has_platforms = !is_null($dummy) ? 1 : 0;
$gui->platform_info['id'] = 0;
$gui->platform_info['name'] = '';
if (!is_null($argsObj->platform_id) && $argsObj->platform_id > 0) {
$gui->platform_info = $platformMgr->getByID($argsObj->platform_id);
}
$gui->node_id = $argsObj->id;
return $gui;
}
示例2: initialize_gui
/**
*
*
*/
function initialize_gui(&$dbHandler, $argsObj)
{
$tproject_mgr = new testproject($dbHandler);
$req_mgr = new requirement_mgr($dbHandler);
$commandMgr = new reqCommands($db);
$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($db, "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->req_id = $argsObj->req_id;
$gui->req_versions = $req_mgr->get_by_id($gui->req_id);
$gui->req = current($gui->req_versions);
$gui->req_coverage = $req_mgr->get_coverage($gui->req_id);
// This seems weird but is done to adapt template than can display multiple
// requirements. This logic has been borrowed from test case versions management
$gui->current_version[0] = array($gui->req);
// BUGID 2877 - Custom Fields linked to Requirement Versions
$gui->cfields_current_version[0] = $req_mgr->html_table_of_custom_field_values($gui->req_id, $gui->req['version_id'], $argsObj->tproject_id);
// Now CF for other Versions
$gui->other_versions[0] = null;
$gui->cfields_other_versions[] = null;
if (count($gui->req_versions) > 1) {
$gui->other_versions[0] = array_slice($gui->req_versions, 1);
$loop2do = count($gui->other_versions[0]);
for ($qdx = 0; $qdx < $loop2do; $qdx++) {
$target_version = $gui->other_versions[0][$qdx]['version_id'];
$gui->cfields_other_versions[0][$qdx] = $req_mgr->html_table_of_custom_field_values($gui->req_id, $target_version, $argsObj->tproject_id);
}
}
$gui->show_title = false;
$gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->req['title'];
$gui->showReqSpecTitle = $argsObj->showReqSpecTitle;
if ($gui->showReqSpecTitle) {
$gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->req['req_spec_title'];
}
// BUGID 2877 - Custom Fields linked to Requirement Versions
// $gui->cfields = array();
// $gui->cfields[] = $req_mgr->html_table_of_custom_field_values($gui->req_id,$argsObj->tproject_id);
$gui->attachments[$gui->req_id] = getAttachmentInfosFrom($req_mgr, $gui->req_id);
$gui->attachmentTableName = $req_mgr->getAttachmentTableName();
$gui->reqStatus = init_labels($gui->req_cfg->status_labels);
$gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels);
// added req relations for BUGID 1748
$gui->req_relations = FALSE;
$gui->req_relation_select = FALSE;
$gui->testproject_select = FALSE;
$gui->req_add_result_msg = isset($argsObj->relation_add_result_msg) ? $argsObj->relation_add_result_msg : "";
if ($gui->req_cfg->relations->enable) {
$gui->req_relations = $req_mgr->get_relations($gui->req_id);
$gui->req_relation_select = $req_mgr->init_relation_type_select();
if ($gui->req_cfg->relations->interproject_linking) {
$gui->testproject_select = initTestprojectSelect($db, $argsObj, $tproject_mgr);
}
}
return $gui;
}
示例3: initialize_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;
}
示例4: initialize_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;
}
示例5: initialize_gui
/**
*
*
*/
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;
}
示例6: initialize_gui
/**
*
*
*/
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;
}
示例7: initializeGui
function initializeGui(&$dbHandler, &$argsObj)
{
$tproject_mgr = new testproject($dbHandler);
$gui = new stdClass();
$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tprojectID) . config_get('testcase_cfg')->glue_character;
$gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName;
$gui->importance = config_get('testcase_importance_default');
$gui->creation_date_from = null;
$gui->creation_date_to = null;
$gui->modification_date_from = null;
$gui->modification_date_to = null;
$gui->search_important_notice = sprintf(lang_get('search_important_notice'), $argsObj->tprojectName);
$gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design($argsObj->tprojectID, cfield_mgr::ENABLED, null, 'testcase');
$gui->keywords = $tproject_mgr->getKeywords($argsObj->tprojectID);
$gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf);
$gui->filter_by['keyword'] = !is_null($gui->keywords);
$reqSpecSet = $tproject_mgr->genComboReqSpec($argsObj->tprojectID);
$gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet);
$gui->option_importance = array(0 => '', HIGH => lang_get('high_importance'), MEDIUM => lang_get('medium_importance'), LOW => lang_get('low_importance'));
return $gui;
}
示例8: initialize_gui
/**
*
*
*/
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;
}
示例9: saveImportedTCData
function saveImportedTCData(&$db, $tcData, $tproject_id, $container_id, $userID, $kwMap, $duplicatedLogic = array('hitCriteria' => 'name', 'actionOnHit' => null))
{
static $messages;
static $fieldSizeCfg;
static $feedbackMsg;
static $tcase_mgr;
static $tproject_mgr;
static $req_spec_mgr;
static $req_mgr;
static $safeSizeCfg;
static $linkedCustomFields;
static $tprojectHas;
static $reqSpecSet;
static $getVersionOpt;
static $userObj;
if (!$tcData) {
return;
}
// $tprojectHas = array('customFields' => false, 'reqSpec' => false);
$hasCustomFieldsInfo = false;
$hasRequirements = false;
if (is_null($messages)) {
$feedbackMsg = array();
$messages = array();
$fieldSizeCfg = config_get('field_size');
$tcase_mgr = new testcase($db);
$tproject_mgr = new testproject($db);
$req_spec_mgr = new requirement_spec_mgr($db);
$req_mgr = new requirement_mgr($db);
$userObj = new tlUser();
$k2l = array('already_exists_updated', 'original_name', 'testcase_name_too_long', 'start_warning', 'end_warning', 'testlink_warning', 'hit_with_same_external_ID');
foreach ($k2l as $k) {
$messages[$k] = lang_get($k);
}
$messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n";
$messages['cf_warning'] = lang_get('no_cf_defined_can_not_import');
$messages['reqspec_warning'] = lang_get('no_reqspec_defined_can_not_import');
$feedbackMsg['cfield'] = lang_get('cf_value_not_imported_missing_cf_on_testproject');
$feedbackMsg['tcase'] = lang_get('testcase');
$feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport');
$feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport');
// because name can be changed automatically during item creation
// to avoid name conflict adding a suffix automatically generated,
// is better to use a max size < max allowed size
$safeSizeCfg = new stdClass();
$safeSizeCfg->testcase_name = $fieldSizeCfg->testcase_name * 0.8;
// Get CF with scope design time and allowed for test cases linked to this test project
$linkedCustomFields = $tcase_mgr->cfield_mgr->get_linked_cfields_at_design($tproject_id, 1, null, 'testcase', null, 'name');
$tprojectHas['customFields'] = !is_null($linkedCustomFields);
$reqSpecSet = $tproject_mgr->getReqSpec($tproject_id, null, array('RSPEC.id', 'NH.name AS title', 'RSPEC.doc_id as rspec_doc_id', 'REQ.req_doc_id'), 'req_doc_id');
$tprojectHas['reqSpec'] = !is_null($reqSpecSet) && count($reqSpecSet) > 0;
$getVersionOpt = array('output' => 'minimun');
$tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id);
}
$resultMap = array();
$tc_qty = sizeof($tcData);
$userIDCache = array();
for ($idx = 0; $idx < $tc_qty; $idx++) {
$tc = $tcData[$idx];
$name = $tc['name'];
$summary = $tc['summary'];
$steps = $tc['steps'];
// I've changed value to use when order has not been provided
// from testcase:DEFAULT_ORDER to a counter, because with original solution
// an issue arise with 'save execution and go next'
// if use has not provided order I think is OK TestLink make any choice.
$node_order = isset($tc['node_order']) ? intval($tc['node_order']) : $idx + 1;
$internalid = $tc['internalid'];
$preconditions = $tc['preconditions'];
$exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL;
$importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM;
$externalid = $tc['externalid'];
if (intval($externalid) <= 0) {
$externalid = null;
}
$personID = $userID;
if (!is_null($tc['author_login'])) {
if (isset($userIDCache[$tc['author_login']])) {
$personID = $userIDCache[$tc['author_login']];
} else {
$userObj->login = $tc['author_login'];
if ($userObj->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) == tl::OK) {
$personID = $userObj->dbID;
}
// I will put always a valid userID on this cache,
// this way if author_login does not exit, and is used multiple times
// i will do check for existence JUST ONCE.
$userIDCache[$tc['author_login']] = $personID;
}
}
$name_len = tlStringLen($name);
if ($name_len > $fieldSizeCfg->testcase_name) {
// Will put original name inside summary
$xx = $messages['start_feedback'];
$xx .= sprintf($messages['testcase_name_too_long'], $name_len, $fieldSizeCfg->testcase_name) . "\n";
$xx .= $messages['original_name'] . "\n" . $name . "\n" . $messages['end_warning'] . "\n";
$summary = nl2br($xx) . $summary;
$name = tlSubStr($name, 0, $safeSizeCfg->testcase_name);
}
$kwIDs = null;
//.........这里部分代码省略.........
示例10: req_link_replace
/**
* replace BBCode-link tagged links in req/reqspec scope with actual links
*
* @internal revisions:
* 20100301 - asimon - added anchor and tproj parameters to tags
*
* @param resource $dbHandler database handle
* @param string $scope text in which to replace tags with links
* @param integer $tprojectID ID of testproject to which req/reqspec belongs
* @return string $scope text with generated links
*/
function req_link_replace($dbHandler, $scope, $tprojectID)
{
$tree_mgr = new tree($dbHandler);
$tproject_mgr = new testproject($dbHandler);
$prefix = $tproject_mgr->getTestCasePrefix($tprojectID);
$tables = tlObjectWithDB::getDBTables(array('requirements', 'req_specs'));
$cfg = config_get('internal_links');
$string2replace = array();
$title = array();
// configure target in which link shall open
// use a reasonable default value if nothing is set in config
$cfg->target = isset($cfg->target) ? $cfg->target : 'popup';
switch ($cfg->target) {
case 'popup':
// use javascript to open popup window
$string2replace['req'] = '<a href="javascript:openLinkedReqWindow(%s,\'%s\')">%s%s</a>';
$string2replace['req_spec'] = '<a href="javascript:openLinkedReqSpecWindow(%s,\'%s\')">%s%s</a>';
break;
case 'window':
case 'frame':
// open in same frame
$target = $cfg->target == 'window' ? 'target="_blank"' : 'target="_self"';
$string2replace['req'] = '<a ' . $target . ' href="lib/requirements/reqView.php?' . 'item=requirement&requirement_id=%s#%s">%s%s</a>';
$string2replace['req_spec'] = '<a ' . $target . ' href="lib/requirements/reqSpecView.php?' . 'item=req_spec&req_spec_id=%s#%s">%s%s</a>';
break;
}
// configure link title (first part of the generated link)
// default: use item type as name (localized name for req)
$title['req'] = lang_get('requirement') . ": ";
// default: use short item type as name (localized name for req spec)
$title['req_spec'] = lang_get('req_spec_short') . ": ";
if ($cfg->req_link_title->type == 'string' && $cfg->req_link_title->value != '') {
$title['req'] = lang_get($cfg->req_link_title->value);
} else {
if ($cfg->req_link_title->type == 'none') {
$title['req'] = '';
}
}
// now for the req specs
if ($cfg->req_spec_link_title->type == 'string' && $cfg->req_spec_link_title->value != '') {
// use user-configured string as link title
$title['req_spec'] = lang_get($cfg->req_spec_link_title->value);
} else {
if ($cfg->req_spec_link_title->type == 'none') {
$title['req_spec'] = '';
}
}
// now the actual replacing
$patterns2search = array();
$patterns2search['req'] = "#\\[req[\\s]*(tproj=([\\w]+))*[\\s]*(anchor=([\\w]+))*[\\s]*(tproj=([\\w]+))*\\](.*)\\[/req\\]#iU";
$patterns2search['req_spec'] = "#\\[req_spec[\\s]*(tproj=([\\w]+))*[\\s]*(anchor=([\\w]+))*[\\s]*(tproj=([\\w]+))*\\](.*)\\[/req_spec\\]#iU";
$sql2exec = array();
$sql2exec['req'] = " SELECT id, req_doc_id AS doc_id " . " FROM {$tables['requirements']} WHERE req_doc_id=";
$sql2exec['req_spec'] = " SELECT id, doc_id FROM {$tables['req_specs']} " . " WHERE doc_id=";
foreach ($patterns2search as $accessKey => $pattern) {
$matches = array();
preg_match_all($pattern, $scope, $matches);
if (count($matches[7]) == 0) {
continue;
}
foreach ($matches[0] as $key => $matched_string) {
// get testproject prefix, if that was found with regex
// if not, get prefix of current project
if ($matches[2][$key] != '') {
$matched_prefix = $matches[2][$key];
} else {
if ($matches[6][$key] != '') {
$matched_prefix = $matches[6][$key];
} else {
$matched_prefix = $prefix;
}
}
$matched_anchor = $matches[4][$key];
$matched_doc_id = $matches[7][$key];
$sql = $sql2exec[$accessKey] . "'{$matched_doc_id}'";
$rs = $dbHandler->get_recordset($sql);
if (count($rs)) {
//20100818 - Julian - fixed error if same doc_id exists in multiple projects
foreach ($rs as $key => $value) {
// get root of linked node and check
$real_root = $tree_mgr->getTreeRoot($value['id']);
$matched_root_info = $tproject_mgr->get_by_prefix($matched_prefix);
if ($real_root == $matched_root_info['id']) {
$urlString = sprintf($string2replace[$accessKey], $value['id'], $matched_anchor, $title[$accessKey], $value['doc_id']);
$scope = str_replace($matched_string, $urlString, $scope);
}
}
}
}
//.........这里部分代码省略.........
示例11: testcase
$tcase_mgr = new testcase($db);
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$glue = config_get('testcase_cfg')->glue_character;
$args = init_args();
$gui = initializeGui($args);
$getOpt = array('outputFormat' => 'map', 'addIfNull' => true);
$gui->platformSet = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt);
$options['output'] = 'essential';
$tcase_all_info = $tcase_mgr->get_by_id($args->tcase_id, testcase::ALL_VERSIONS, null, $options);
if (!is_null($tcase_all_info)) {
foreach ($tcase_all_info as $tcversion_info) {
if ($tcversion_info['id'] == $args->tcversion_id) {
$version = $tcversion_info['version'];
$gui->pageTitle = lang_get('test_case') . ':' . $tcversion_info['name'];
$gui->tcaseIdentity = $tproject_mgr->getTestCasePrefix($args->tproject_id);
$gui->tcaseIdentity .= $glue . $tcversion_info['tc_external_id'] . ':' . $tcversion_info['name'];
break;
}
}
}
// 20100514 - franciscom
// Why I'm filter on NOT_EXECUTED ??? -> this causes BUGID 3189
// $link_info = $tcase_mgr->get_linked_versions($args->tcase_id,'NOT_EXECUTED');
$link_info = $tcase_mgr->get_linked_versions($args->tcase_id);
// 20100124 - work only on ACTIVE TEST PLANS => array('plan_status' => 1)
if (!is_null($tplanSet = $tproject_mgr->get_all_testplans($args->tproject_id, array('plan_status' => 1)))) {
$has_links = array_fill_keys(array_keys($tplanSet), false);
$linked_tplans = null;
if (!is_null($link_info)) {
foreach ($link_info as $tcversion_id => $info) {
示例12: templateConfiguration
require_once "common.php";
require_once 'exttable.class.php';
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tpl = 'tcSearchResults.tpl';
$tproject_mgr = new testproject($db);
$tcase_cfg = config_get('testcase_cfg');
$charset = config_get('charset');
$args = init_args();
$edit_label = lang_get('design');
$edit_icon = TL_THEME_IMG_DIR . "edit_icon.png";
$gui = initializeGui($args);
$map = null;
if ($args->tprojectID) {
$tables = tlObjectWithDB::getDBTables(array('cfield_design_values', 'nodes_hierarchy', 'requirements', 'req_coverage', 'tcsteps', 'testcase_keywords', 'tcversions'));
$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID);
$gui->tcasePrefix .= $tcase_cfg->glue_character;
$from = array('by_keyword_id' => ' ', 'by_custom_field' => ' ', 'by_requirement_doc_id' => '');
$filter = null;
$tcaseID = null;
// if Both dates exists check From >= To
if (!is_null($args->creation_date_from) && !is_null($args->creation_date_to)) {
$date_from = date_create_from_format('Y-n-j', $args->creation_date_from);
$date_to = date_create_from_format('Y-n-j', $args->creation_date_to);
}
if (!is_null($args->creation_date_from)) {
$db_date = $db->db->DBdate($args->creation_date_from);
$filter['by_creation_date_from'] = " AND TCV.creation_ts >= {$db_date} ";
}
if (!is_null($args->creation_date_to)) {
$db_date = $db->db->DBdate($args->creation_date_to);
示例13: buildDirectWebLink
/**
*
*
*/
function buildDirectWebLink($base_href, $id, $tproject_id)
{
$tproject_mgr = new testproject($this->db);
$prefix = $tproject_mgr->getTestCasePrefix($tproject_id);
$dl = $base_href . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . '&item=testsuite&id=' . $id;
return $dl;
}
示例14: renderTestPlanForPrinting
function renderTestPlanForPrinting(&$db, &$node, $item_type, &$options, $tocPrefix, $tcCnt, $level, $user_id, $tplan_id, $tprojectID, $platform_id)
{
$tProjectMgr = new testproject($db);
$tcPrefix = $tProjectMgr->getTestCasePrefix($tprojectID);
$code = renderTestSpecTreeForPrinting($db, $node, $item_type, $options, $tocPrefix, $tcCnt, $level, $user_id, $tplan_id, $tcPrefix, $tprojectID, $platform_id);
return $code;
}
示例15: initialize_gui
/**
*
*
*/
function initialize_gui(&$dbHandler, $argsObj)
{
$tproject_mgr = new testproject($dbHandler);
$req_mgr = new requirement_mgr($dbHandler);
$commandMgr = new reqCommands($dbHandler);
$gui = $commandMgr->initGuiBean();
$gui->refreshTree = $argsObj->refreshTree;
$gui->req_cfg = config_get('req_cfg');
$gui->tproject_id = $argsObj->tproject_id;
$gui->tproject_name = $argsObj->tproject_name;
$gui->grants = new stdClass();
$gui->grants->req_mgmt = $argsObj->user->hasRight($dbHandler, "mgt_modify_req", $argsObj->tproject_id);
// IMPORTANT NOTICE
// We can arrive here after following operation
// 1. user click on left pane tree on REQ SPEC NODE
// 2. on right pane screen user click on CREATE button on Requirements Operations
// 3. on new screen user CLICK CANCEL
// In this situation $argsObj->req_id is 0 OR EMPTY
$gui->req_id = $argsObj->req_id;
if ($gui->req_id <= 0) {
// Quick Exit
// is not too clear why do not need to add lib/requirements/ on target
$target = "reqSpecView.php?tproject_id={$gui->tproject_id}" . "&req_spec_id={$argsObj->req_spec_id}";
header("Location: {$target}");
exit;
}
// everything is fine - standard processing
$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id);
$gui->glueChar = config_get('testcase_cfg')->glue_character;
$gui->pieceSep = config_get('gui_title_separator_1');
/* if wanted, show only the given version */
$gui->version_option = $argsObj->req_version_id ? $argsObj->req_version_id : requirement_mgr::ALL_VERSIONS;
$gui->req_versions = $req_mgr->get_by_id($gui->req_id, $gui->version_option);
$gui->req_has_history = count($req_mgr->get_history($gui->req_id, array('output' => 'array'))) > 1;
$gui->req = current($gui->req_versions);
$gui->req_coverage = $req_mgr->get_coverage($gui->req_id);
// This seems weird but is done to adapt template than can display multiple
// requirements. This logic has been borrowed from test case versions management
$gui->current_version[0] = array($gui->req);
$gui->cfields_current_version[0] = $req_mgr->html_table_of_custom_field_values($gui->req_id, $gui->req['version_id'], $argsObj->tproject_id);
// Now CF for other Versions
$gui->other_versions[0] = null;
$gui->cfields_other_versions[] = null;
if (count($gui->req_versions) > 1) {
$gui->other_versions[0] = array_slice($gui->req_versions, 1);
$loop2do = count($gui->other_versions[0]);
for ($qdx = 0; $qdx < $loop2do; $qdx++) {
$target_version = $gui->other_versions[0][$qdx]['version_id'];
$gui->cfields_other_versions[0][$qdx] = $req_mgr->html_table_of_custom_field_values($gui->req_id, $target_version, $argsObj->tproject_id);
}
}
$gui->show_title = false;
$gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->req['title'];
$gui->showReqSpecTitle = $argsObj->showReqSpecTitle;
if ($gui->showReqSpecTitle) {
$gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->req['req_spec_title'];
}
$gui->attachments[$gui->req_id] = $req_mgr->getAttachmentInfos($gui->req_id);
$gui->attachmentTableName = $req_mgr->getAttachmentTableName();
$gui->reqStatus = init_labels($gui->req_cfg->status_labels);
$gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels);
// added req relations for BUGID 1748
$gui->req_relations = FALSE;
$gui->req_relation_select = FALSE;
$gui->testproject_select = FALSE;
$gui->req_add_result_msg = isset($argsObj->relation_add_result_msg) ? $argsObj->relation_add_result_msg : "";
if ($gui->req_cfg->relations->enable) {
$gui->req_relations = $req_mgr->get_relations($gui->req_id);
$gui->req_relation_select = $req_mgr->init_relation_type_select();
if ($gui->req_cfg->relations->interproject_linking) {
$gui->testproject_select = initTestprojectSelect($argsObj->userID, $argsObj->tproject_id, $tproject_mgr);
}
}
return $gui;
}