本文整理汇总了PHP中testproject::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP testproject::get_by_id方法的具体用法?PHP testproject::get_by_id怎么用?PHP testproject::get_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testproject
的用法示例。
在下文中一共展示了testproject::get_by_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_args
/**
* init_args
*
*/
function init_args(&$dbHandler)
{
$reqTitleSize = config_get('field_size')->requirement_title;
$iParams = array("requirement_id" => array(tlInputParameter::INT_N), "req_version_id" => array(tlInputParameter::INT_N), "req_spec_id" => array(tlInputParameter::INT_N), "req_title" => array(tlInputParameter::STRING_N, 0, $reqTitleSize), "req_id_cbox" => array(tlInputParameter::ARRAY_INT), "reqDocId" => array(tlInputParameter::STRING_N, 0, 64), "reqStatus" => array(tlInputParameter::STRING_N, 0, 1), "reqType" => array(tlInputParameter::STRING_N, 0, 1), "containerID" => array(tlInputParameter::INT_N), "scope" => array(tlInputParameter::STRING_N), "countReq" => array(tlInputParameter::INT_N), "expected_coverage" => array(tlInputParameter::INT_N), "doAction" => array(tlInputParameter::STRING_N, 0, 20), "itemSet" => array(tlInputParameter::ARRAY_INT), "testcase_count" => array(tlInputParameter::ARRAY_INT), "copy_testcase_assignment" => array(tlInputParameter::CB_BOOL), "relation_id" => array(tlInputParameter::INT_N), "relation_source_req_id" => array(tlInputParameter::INT_N), "relation_type" => array(tlInputParameter::STRING_N), "relation_destination_req_doc_id" => array(tlInputParameter::STRING_N, 0, 64), "relation_destination_testproject_id" => array(tlInputParameter::INT_N), "save_rev" => array(tlInputParameter::INT_N), "do_save" => array(tlInputParameter::INT_N), "log_message" => array(tlInputParameter::STRING_N), "tcaseIdentity" => array(tlInputParameter::STRING_N), "file_id" => array(tlInputParameter::INT_N), "fileTitle" => array(tlInputParameter::STRING_N, 0, 100));
$args = new stdClass();
R_PARAMS($iParams, $args);
$_REQUEST = strings_stripSlashes($_REQUEST);
$args->req_id = $args->requirement_id;
$args->title = $args->req_title;
$args->arrReqIds = $args->req_id_cbox;
$args->basehref = $_SESSION['basehref'];
$args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0;
if ($args->tproject_id <= 0) {
throw new Exception(__FILE__ . '::' . __FUNCTION__ . " Test project ID can not be <= 0 ");
}
$mgr = new testproject($dbHandler);
$info = $mgr->get_by_id($args->tproject_id);
if (is_null($info)) {
throw new Exception(__FILE__ . '::' . __FUNCTION__ . " Unable to get test project data ");
}
$args->tproject_name = $info['name'];
$args->tcasePrefix = $info['prefix'];
$args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
if (!is_numeric($args->expected_coverage)) {
$args->expected_coverage = 0;
}
$args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : 0;
$args->stay_here = isset($_REQUEST['stay_here']) ? 1 : 0;
return $args;
}
示例2: initGuiBean
/**
*
*
*/
function initGuiBean(&$argsObj, $mandatory = null)
{
$obj = new stdClass();
$prop2scan = array('tproject_id' => 'Test project id can not be <= 0', 'tsuiteID' => 'Test suite id can not be <= 0');
if (!is_null($mandatory)) {
foreach ($mandatory as $key) {
$p2check[$key] = $prop2scan[$key];
}
} else {
$p2check =& $prop2scan;
}
foreach ($p2check as $prop => $msg) {
if (($obj->{$prop} = intval($argsObj->{$prop})) <= 0) {
throw new Exception(__METHOD__ . ':' . $msg);
}
}
$tprojectMgr = new testproject($this->db);
$dummy = $tprojectMgr->get_by_id($obj->tproject_id);
$obj->testPriorityEnabled = $dummy['opt']->testPriorityEnabled;
$obj->automationEnabled = $dummy['opt']->automationEnabled;
$this->keywordSet = array('testproject' => $tprojectMgr->get_keywords_map($argsObj->tproject_id), 'testcase' => null);
$obj->template_dir = $this->templateCfg->template_dir;
$obj->action = '';
$obj->attachments = null;
$obj->cleanUpWebEditor = false;
$obj->direct_link = null;
$obj->execution_types = $this->execution_types;
$obj->grants = $this->grants;
$obj->has_been_executed = false;
$obj->initWebEditorFromTemplate = false;
$obj->viewerArgs = null;
$obj->path_info = null;
$obj->main_descr = '';
$obj->name = '';
$obj->sqlResult = '';
$obj->step_id = -1;
$obj->step_set = '';
$obj->steps = '';
$obj->tableColspan = 5;
$obj->tcase_id = property_exists($argsObj, 'tcase_id') ? intval($argsObj->tcase_id) : -1;
$p2check = array('goback_url' => '', 'show_mode' => 'show', 'refreshTree' => !tlTreeMenu::REFRESH_GUI);
foreach ($p2check as $prop => $value) {
if (property_exists($argsObj, $prop) && !is_null($argsObj->{$prop})) {
$obj->{$prop} = $argsObj->{$prop};
} else {
$obj->{$prop} = $value;
}
}
// need to check where is used -> on cancel button on tcStepEdit.tpl
$obj->loadOnCancelURL = "archiveData.php?tproject_id={$obj->tproject_id}&edit=testcase" . "&show_mode={$obj->show_mode}&id=%s&version_id=%s";
// Used on tcStepEdit.tpl to creare goback_url URL parameter
$obj->goBackAction = $_SESSION['basehref'] . "lib/testcases/" . $obj->loadOnCancelURL;
$obj->keywordsViewHREF = "lib/keywords/keywordsView.php?tproject_id={$obj->tproject_id} " . ' target="mainframe" class="bold" ' . ' title="' . lang_get('menu_manage_keywords') . '"';
return $obj;
}
示例3: initializeGui
function initializeGui(&$dbHandler, $args)
{
$gui = new stdClass();
$tplan_mgr = new testplan($dbHandler);
$tproject_mgr = new testproject($dbHandler);
$gui_open = config_get('gui_separator_open');
$gui_close = config_get('gui_separator_close');
$gui->str_option_any = $gui_open . lang_get('any') . $gui_close;
$gui->str_option_none = $gui_open . lang_get('nobody') . $gui_close;
$gui->tplan_id = $args->tplan_id;
$gui->tproject_id = $args->tproject_id;
$tplan_info = $tplan_mgr->get_by_id($gui->tplan_id);
$gui->tplan_name = $tplan_info['name'];
$tproject_info = $tproject_mgr->get_by_id($gui->tproject_id);
$gui->tproject_name = $tproject_info['name'];
$re = new results($dbHandler, $tplan_mgr, $tproject_info, $tplan_info);
$gui->assigned_users = new stdClass();
$gui->keywords = new stdClass();
$gui->builds = new stdClass();
$gui->testsuites = new stdClass();
// 20090107 - franciscom
// Show only users that are able to execute test cases ?
// What happens if a user that has loose right to execute, but
// before loosing this right has been assigned some tests, or have executed it?
//
// $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, ADD_BLANK_OPTION);
// $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER,
// array(TL_USER_ANYBODY => $gui->str_option_any,
// TL_USER_NOBODY => $gui->str_option_none) );
//
$gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, array(TL_USER_ANYBODY => $gui->str_option_any));
$gui->assigned_users->qty = count($gui->assigned_users->items);
// BUGID 2012 - franciscom
$gui->keywords->items[0] = $gui->str_option_any;
if (!is_null($tplan_keywords_map = $tplan_mgr->get_keywords_map($gui->tplan_id))) {
$gui->keywords->items += $tplan_keywords_map;
}
$gui->builds->items = $tplan_mgr->get_builds($gui->tplan_id, testplan::ACTIVE_BUILDS);
$gui->testsuites->items = $re->getTopLevelSuites();
$gui->keywords->qty = count($gui->keywords->items);
$gui->builds->qty = count($gui->builds->items);
$gui->testsuites->qty = count($gui->testsuites->items);
$gui->status_code_label = get_status_for_reports_html_options();
$gui->report_type = $args->format;
$reports_cfg = config_get('reportsCfg');
$startDate = time() - $reports_cfg->start_date_offset;
$gui->selected_start_date = $startDate;
$gui->selected_start_time = $reports_cfg->start_time;
$gui->selected_end_date = null;
$gui->selected_end_time = null;
return $gui;
}
示例4: init_args
function init_args(&$dbHandler, $dateFormat)
{
$_REQUEST = strings_stripSlashes($_REQUEST);
$args = new stdClass();
// BUGID 3716
$args->target_date_original = isset($_REQUEST['target_date']) ? $_REQUEST['target_date'] : null;
$args->start_date_original = isset($_REQUEST['start_date']) ? $_REQUEST['start_date'] : null;
// convert target date to iso format to write to db
if (isset($_REQUEST['target_date']) && $_REQUEST['target_date'] != '') {
$date_array = split_localized_date($_REQUEST['target_date'], $dateFormat);
if ($date_array != null) {
// set date in iso format
$args->target_date = $date_array['year'] . "-" . $date_array['month'] . "-" . $date_array['day'];
}
}
// convert start date to iso format to write to db
if (isset($_REQUEST['start_date']) && $_REQUEST['start_date'] != '') {
$date_array = split_localized_date($_REQUEST['start_date'], $dateFormat);
if ($date_array != null) {
// set date in iso format
$args->start_date = $date_array['year'] . "-" . $date_array['month'] . "-" . $date_array['day'];
}
}
$key2loop = array('low_priority_tcases', 'medium_priority_tcases', 'high_priority_tcases');
foreach ($key2loop as $key) {
$args->{$key} = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0;
}
$args->id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$args->name = isset($_REQUEST['milestone_name']) ? $_REQUEST['milestone_name'] : null;
$args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null;
$args->basehref = $_SESSION['basehref'];
$treeMgr = new tree($dbHandler);
$tprojectMgr = new testproject($dbHandler);
$args->tproject_options = new stdClass();
$args->tproject_options->testPriorityEnabled = 0;
$args->tproject_name = '';
$args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
if ($args->tproject_id > 0) {
$info = $tprojectMgr->get_by_id($args->tproject_id);
$args->tproject_name = $info['name'];
$args->tproject_options = $info['opt'];
}
$args->tplan_name = '';
$args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
if ($args->tplan_id > 0) {
$info = $treeMgr->get_node_hierarchy_info($args->tplan_id);
$args->tplan_name = $info['name'];
}
return $args;
}
示例5: initializeGui
function initializeGui(&$dbHandler, $argsObj, &$tplanMgr)
{
$gui = new stdClass();
$gui->title = lang_get('title_gen_test_rep');
$gui->do_report = array();
$gui->elapsed_time = 0;
$mgr = new testproject($dbHandler);
$dummy = $mgr->get_by_id($argsObj->tproject_id);
$gui->testprojectOptions = new stdClass();
$gui->testprojectOptions->testPriorityEnabled = $dummy['opt']->testPriorityEnabled;
$gui->tproject_name = $dummy['name'];
$info = $tplanMgr->get_by_id($argsObj->tplan_id);
$gui->tplan_name = $info['name'];
return $gui;
}
示例6: reqCommands
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);
}
}
示例7: init_args
function init_args(&$dbHandler)
{
$args = new stdClass();
$treeMgr = new tree($dbHandler);
$tprojectMgr = new testproject($dbHandler);
$args->tproject_name = '';
$args->tproject_options = new stdClass();
$args->tproject_options->testPriorityEnabled = 0;
$args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
if ($args->tproject_id > 0) {
$info = $tprojectMgr->get_by_id($args->tproject_id);
$args->tproject_name = $info['name'];
$args->tproject_options = $info['opt'];
}
$args->tplan_name = '';
$args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
if ($args->tplan_id > 0) {
$info = $treeMgr->get_node_hierarchy_info($args->tplan_id);
$args->tplan_name = $info['name'];
}
return $args;
}
示例8: init_args
/**
* initialize user input
*
* @param resource dbHandler
* @return array $args array with user input information
*/
function init_args(&$dbHandler)
{
$iParams = array("apikey" => array(tlInputParameter::STRING_N, 0, 64), "tproject_id" => array(tlInputParameter::INT_N), "tplan_id" => array(tlInputParameter::INT_N), "format" => array(tlInputParameter::INT_N));
$args = new stdClass();
$pParams = R_PARAMS($iParams, $args);
if (!is_null($args->apikey)) {
$cerbero = new stdClass();
$cerbero->args = new stdClass();
$cerbero->args->tproject_id = $args->tproject_id;
$cerbero->args->tplan_id = $args->tplan_id;
if (strlen($args->apikey) == 32) {
$cerbero->args->getAccessAttr = true;
$cerbero->method = 'checkRights';
$cerbero->redirect_target = "../../login.php?note=logout";
setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero);
} else {
$args->addOpAccess = false;
$cerbero->method = null;
$cerbero->args->getAccessAttr = false;
setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero);
}
} else {
testlinkInitPage($dbHandler, false, false, "checkRights");
$args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0;
}
$tproject_mgr = new testproject($dbHandler);
$tplan_mgr = new testplan($dbHandler);
if ($args->tproject_id > 0) {
$args->tproject_info = $tproject_mgr->get_by_id($args->tproject_id);
$args->tproject_name = $args->tproject_info['name'];
$args->tproject_description = $args->tproject_info['notes'];
}
if ($args->tplan_id > 0) {
$args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id);
}
return array($args, $tproject_mgr, $tplan_mgr);
}
示例9: init_args
/**
* Process input data
*
**/
function init_args(&$dbHandler)
{
$iParams = array("apikey" => array(tlInputParameter::STRING_N, 32, 64), "tproject_id" => array(tlInputParameter::INT_N), "tplan_id" => array(tlInputParameter::INT_N), "build_id" => array(tlInputParameter::INT_N), "docTestPlanId" => array(tlInputParameter::INT_N), "id" => array(tlInputParameter::INT_N), "type" => array(tlInputParameter::STRING_N, 0, 20), "format" => array(tlInputParameter::INT_N), "level" => array(tlInputParameter::STRING_N, 0, 32));
$args = new stdClass();
$pParams = R_PARAMS($iParams, $args);
// really UGLY HACK
$typeDomain = array('test_plan' => 'testplan', 'test_report' => 'testreport');
$args->type = isset($typeDomain[$args->type]) ? $typeDomain[$args->type] : $args->type;
if (!is_null($args->apikey)) {
$cerbero = new stdClass();
$cerbero->args = new stdClass();
$cerbero->args->tproject_id = $args->tproject_id;
$cerbero->args->tplan_id = $args->tplan_id;
if (strlen($args->apikey) == 32) {
$cerbero->args->getAccessAttr = true;
$cerbero->method = 'checkRights';
$cerbero->redirect_target = "../../login.php?note=logout";
setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero);
} else {
$args->addOpAccess = false;
$cerbero->method = null;
setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero);
}
$args->itemID = $args->tproject_id;
} else {
testlinkInitPage($dbHandler, false, false, "checkRights");
$args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0;
$args->tplan_id = isset($_REQUEST['docTestPlanId']) ? intval($_REQUEST['docTestPlanId']) : 0;
$args->itemID = $args->id;
}
$tproject_mgr = new testproject($dbHandler);
if ($args->tproject_id > 0) {
$dummy = $tproject_mgr->get_by_id($args->tproject_id);
$args->tproject_name = $dummy['name'];
} else {
$msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})";
throw new Exception($msg);
}
$args->doc_type = $args->type;
$args->user_id = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : null;
$resultsCfg = config_get('results');
$dcd = array();
$dcd['node_descr_id'] = $tproject_mgr->tree_manager->get_available_node_types();
$dcd['node_id_descr'] = array_flip($dcd['node_descr_id']);
$dcd['status_descr_code'] = $resultsCfg['status_code'];
$dcd['status_code_descr'] = array_flip($dcd['status_descr_code']);
return array($args, $tproject_mgr, $dcd);
}
示例10: init_args
/**
* init_args()
* Get in an object all data that has arrived to page through _REQUEST or _SESSION.
* If you think this page as a function, you can consider this data arguments (args)
* to a function call.
* Using all this data as one object property will help developer to understand
* if data is received or produced on page.
*
* @author franciscom - francisco.mancardi@gmail.com
* @args - used global coupling accessing $_REQUEST and $_SESSION
*
* @return object of stdClass
*
* @internal revisions
*/
function init_args(&$dbHandler)
{
$_REQUEST = strings_stripSlashes($_REQUEST);
$args = new stdClass();
$args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
if ($args->tproject_id == 0) {
$args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0;
}
if ($args->tproject_id == 0) {
throw new Exception(__FILE__ . ' Can not work without Test project ID => Aborting');
}
$mgr = new testproject($dbHandler);
$info = $mgr->get_by_id($args->tproject_id);
$args->tproject_name = $info['name'];
$args->testprojectOptions = $info['opt'];
unset($info);
// $userSet = $userObj->getNames($dbHandler);
$args->user_id = isset($_REQUEST['user_id']) ? intval($_REQUEST['user_id']) : 0;
if ($args->user_id != 0) {
$args->user = new tlUser($args->user_id);
} else {
$args->user_id = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0;
if ($args->user_id == 0) {
throw new Exception(__FILE__ . ' Can not work without User ID => Aborting');
}
$args->user = $_SESSION['currentUser'];
}
$args->user_name = $args->user->login;
$args->userSet = $args->user->getNames($dbHandler);
$args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
$args->build_id = isset($_REQUEST['build_id']) && is_numeric($_REQUEST['build_id']) ? intval($_REQUEST['build_id']) : 0;
$args->show_inactive_tplans = isset($_REQUEST['show_inactive_tplans']) ? true : false;
$args->show_all_users = false;
if (isset($_REQUEST['show_all_users'])) {
$args->show_all_users = intval($_REQUEST['show_all_users']) == 1;
}
// $args->show_all_users = (isset($_REQUEST['show_all_users']) && (intval($_REQUEST['show_all_users'])) =! 0);
$args->show_user_column = $args->show_all_users;
$show_closed_builds = isset($_REQUEST['show_closed_builds']) ? true : false;
$show_closed_builds_hidden = isset($_REQUEST['show_closed_builds_hidden']) ? true : false;
if ($show_closed_builds) {
$selection = true;
} else {
if ($show_closed_builds_hidden) {
$selection = false;
} else {
if (isset($_SESSION['show_closed_builds'])) {
$selection = intval($_SESSION['show_closed_builds']);
} else {
$selection = false;
}
}
}
$args->show_closed_builds = $_SESSION['show_closed_builds'] = $selection;
if ($args->show_all_users) {
$args->user_id = TL_USER_ANYBODY;
}
$args->show_inactive_and_closed = false;
if (isset($_REQUEST['show_inactive_and_closed'])) {
$args->show_inactive_and_closed = intval($_REQUEST['show_inactive_and_closed']) != 0;
}
$args->priority_enabled = $_SESSION['testprojectOptions']->testPriorityEnabled ? true : false;
return $args;
}
示例11: contextAsXML
/**
*
*
*/
function contextAsXML(&$dbHandler, $contextSet, &$tplanMgr)
{
$info = array();
$tprojectMgr = new testproject($dbHandler);
$info['tproject'] = $tprojectMgr->get_by_id($contextSet->tproject_id);
unset($tprojectMgr);
$info['tplan'] = $tplanMgr->get_by_id($contextSet->tplan_id);
$buildMgr = new build_mgr($dbHandler);
$info['build'] = $buildMgr->get_by_id($contextSet->build_id);
unset($buildMgr);
$info['platform'] = null;
$platform_template = '';
if ($contextSet->platform_id > 0) {
$platformMgr = new tlPlatform($dbHandler, $contextSet->tproject_id);
$info['platform'] = $platformMgr->getByID($contextSet->platform_id);
unset($platformMgr);
$platform_template = "\n\t" . "<platform>" . "\t\t" . "<name><![CDATA[||PLATFORMNAME||]]></name>" . "\t\t" . "<internal_id><![CDATA[||PLATFORMID||]]></internal_id>" . "\n\t" . "</platform>";
}
$key2loop = array_keys($info);
foreach ($key2loop as $item_key) {
if (!is_null($info[$item_key])) {
$contextInfo[$item_key . '_id'] = $info[$item_key]['id'];
$contextInfo[$item_key . '_name'] = $info[$item_key]['name'];
}
}
$contextInfo['prefix'] = $info['tproject']['prefix'];
$xml_root = "<context>{{XMLCODE}}\n</context>";
$xml_template = "\n\t" . "<testproject>" . "\t\t" . "<name><![CDATA[||TPROJECTNAME||]]></name>" . "\t\t" . "<internal_id><![CDATA[||TPROJECTID||]]></internal_id>" . "\t\t" . "<prefix><![CDATA[||TPROJECTPREFIX||]]></prefix>" . "\n\t" . "</testproject>" . "\n\t" . "<testplan>" . "\t\t" . "<name><![CDATA[||TPLANNAME||]]></name>" . "\t\t" . "<internal_id><![CDATA[||TPLANID||]]></internal_id>" . "\n\t" . "</testplan>" . $platform_template . "\n\t" . "<build>" . "\t\t" . "<name><![CDATA[||BUILDNAME||]]></name>" . "\t\t" . "<internal_id><![CDATA[||BUILDID||]]></internal_id>" . "\n\t" . "</build>";
$xml_mapping = null;
$xml_mapping = array("||TPROJECTNAME||" => "tproject_name", "||TPROJECTID||" => 'tproject_id', "||TPROJECTPREFIX||" => "prefix", "||TPLANNAME||" => "tplan_name", "||TPLANID||" => 'tplan_id', "||BUILDNAME||" => "build_name", "||BUILDID||" => 'build_id', "||PLATFORMNAME||" => "platform_name", "||PLATFORMID||" => 'platform_id');
$mm = array($contextInfo);
$contextXML = exportDataToXML($mm, $xml_root, $xml_template, $xml_mapping, 'noXMLHeader' == 'noXMLHeader');
// echo '<pre><xmp>';
// echo $contextXML;
// echo '</xmp></pre>';
return $contextXML;
}
示例12: initializeGui
function initializeGui(&$dbHandler, &$argsObj)
{
$gui = new stdClass();
$gui->pageTitle = lang_get('caption_testCasesWithoutTester');
$gui->warning_msg = '';
$gui->tplan_name = $argsObj->tplan_name;
$mgr = new testproject($dbHandler);
$dummy = $mgr->get_by_id($argsObj->tproject_id);
$gui->tproject_name = $argsObj->tproject_name = $dummy['name'];
$gui->options = new stdClass();
$gui->options->testPriorityEnabled = $dummy['opt']->testPriorityEnabled;
$gui->labels = init_labels(array('design' => null, 'execution' => null, 'execution_history' => null, 'match_count' => null));
return $gui;
}
示例13: init_args
/**
* init_args()
* Get in an object all data that has arrived to page through _REQUEST or _SESSION.
* If you think this page as a function, you can consider this data arguments (args)
* to a function call.
* Using all this data as one object property will help developer to understand
* if data is received or produced on page.
*
* @author franciscom - francisco.mancardi@gmail.com
* @args - used global coupling accessing $_REQUEST and $_SESSION
* if ($show_platforms)
{
$colDef[] = array('title_key' => 'platform', 'width' => 50, 'filter' => 'list', 'filterOptions' => $platforms);
}
* @return object of stdClass
*
*
* @internal revisions:
* 20100731 - asimon - additional arguments show_all_users and show_inactive_and_closed
*/
function init_args(&$dbHandler)
{
$_REQUEST = strings_stripSlashes($_REQUEST);
$args = new stdClass();
$args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0;
$args->tproject_name = '';
if ($args->tproject_id > 0) {
$tproject_mgr = new testproject($dbHandler);
$dummy = $tproject_mgr->get_by_id($args->tproject_id);
$args->tproject_name = $dummy['name'];
$args->priority_enabled = $dummy['opt']->testPriorityEnabled ? true : false;
unset($tproject_mgr);
}
$args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : 0;
$args->user_id = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0;
if ($args->user_id == 0) {
$args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
$args->user_name = $_SESSION['currentUser']->login;
}
return $args;
}
示例14: initializeGui
function initializeGui(&$dbHandler, $argsObj, &$tplanMgr, &$tcaseMgr)
{
$platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id);
$tcase_cfg = config_get('testcase_cfg');
$gui = new stdClass();
$gui->platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
$gui->usePlatforms = $platform_mgr->platformsActiveForTestplan($argsObj->tplan_id);
$gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id);
$gui->bulk_platforms[0] = lang_get("all_platforms");
ksort($gui->bulk_platforms);
$gui->send_mail = $argsObj->send_mail;
$gui->send_mail_checked = "";
if ($gui->send_mail) {
$gui->send_mail_checked = ' checked="checked" ';
}
$gui->glueChar = $tcase_cfg->glue_character;
if ($argsObj->level != 'testproject') {
$gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id);
$gui->testCasePrefix .= $tcase_cfg->glue_character;
$gui->keywordsFilterType = $argsObj->keywordsFilterType;
$gui->build_id = $argsObj->build_id;
$gui->tplan_id = $argsObj->tplan_id;
$tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id);
$gui->testPlanName = $tplan_info['name'];
$build_info = $tplanMgr->get_build_by_id($argsObj->tplan_id, $argsObj->build_id);
$gui->buildName = $build_info['name'];
$gui->main_descr = sprintf(lang_get('title_tc_exec_assignment'), $gui->buildName, $gui->testPlanName);
$tproject_mgr = new testproject($dbHandler);
$tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id);
$gui->all_users = tlUser::getAll($dbHandler, null, "id", null);
$gui->users = getUsersForHtmlOptions($dbHandler, null, null, null, $gui->all_users);
$gui->testers = getTestersForHtmlOptions($dbHandler, $argsObj->tplan_id, $tproject_info, $gui->all_users);
}
return $gui;
}
示例15: init_args
/**
* Gets the arguments used to create the report.
*
* Some of these arguments are set in the $_REQUEST, and some in $_SESSION.
* Having these arguments in hand, the init_args method will use TestLink objects,
* such as a Test Project Manager (testproject class) to retrieve other information
* that is displayed on the screen (e.g.: project name).
*
* @param $dbHandler handler to TestLink database
*
* @return object of stdClass
*/
function init_args(&$dbHandler)
{
$args = new stdClass();
$iParams = array("apikey" => array(tlInputParameter::STRING_N, 32, 32), "do_action" => array(tlInputParameter::STRING_N, 6, 6), "tproject_id" => array(tlInputParameter::INT_N), "user_id" => array(tlInputParameter::INT_N), "selected_start_date" => array(tlInputParameter::ARRAY_STRING_N), "selected_end_date" => array(tlInputParameter::ARRAY_STRING_N), "start_Hour" => array(tlInputParameter::INT_N), "end_Hour" => array(tlInputParameter::INT_N));
$_REQUEST = strings_stripSlashes($_REQUEST);
R_PARAMS($iParams, $args);
if (!is_null($args->apikey)) {
$args->show_only_active = true;
$cerbero = new stdClass();
$cerbero->args = new stdClass();
$cerbero->args->tproject_id = $args->tproject_id;
$cerbero->args->tplan_id = null;
$cerbero->args->getAccessAttr = true;
$cerbero->method = 'checkRights';
setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero);
} else {
testlinkInitPage($dbHandler, false, false, "checkRights");
}
if ($args->tproject_id < 0) {
throw new Exception('Test project id can not be empty');
}
$mgr = new testproject($dbHandler);
$info = $mgr->get_by_id($args->tproject_id);
$args->tproject_name = $info['name'];
return $args;
}