本文整理汇总了PHP中init_args函数的典型用法代码示例。如果您正苦于以下问题:PHP init_args函数的具体用法?PHP init_args怎么用?PHP init_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了init_args函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initScript
/**
*
*/
function initScript(&$dbHandler)
{
$mgr = new issueTrackerCommands($dbHandler);
$args = init_args(array('doAction' => $mgr->getGuiOpWhiteList()));
$gui = initializeGui($dbHandler, $args, $mgr);
return array($args, $gui, $mgr);
}
示例2: initializeEnv
/**
*
*
*/
function initializeEnv($dbHandler)
{
$args = init_args($dbHandler);
$gui = new stdClass();
$grant2check = array('mgt_modify_tc', 'mgt_view_req', 'testplan_planning', 'mgt_modify_product', 'testproject_edit_executed_testcases', 'testproject_delete_executed_testcases');
$grants = new stdClass();
foreach ($grant2check as $right) {
$grants->{$right} = $_SESSION['currentUser']->hasRight($dbHandler, $right, $args->tproject_id);
$gui->{$right} = $grants->{$right};
}
$gui->tproject_id = $args->tproject_id;
$gui->page_title = lang_get('container_title_' . $args->feature);
$gui->opt_requirements = $args->opt_requirements;
$gui->requirementsEnabled = $args->requirementsEnabled;
$gui->automationEnabled = $args->automationEnabled;
$gui->testPriorityEnabled = $args->testPriorityEnabled;
$gui->show_mode = $args->show_mode;
$lblkey = config_get('testcase_reorder_by') == 'NAME' ? '_alpha' : '_externalid';
$gui->btn_reorder_testcases = lang_get('btn_reorder_testcases' . $lblkey);
// has sense only when we work on test case
$gui->platforms = null;
$gui->tableColspan = 5;
$gui->loadOnCancelURL = '';
$gui->attachments = null;
$gui->direct_link = null;
$gui->steps_results_layout = config_get('spec_cfg')->steps_results_layout;
$gui->bodyOnUnload = "storeWindowSize('TCEditPopup')";
$gui->viewerArgs = array('action' => '', 'msg_result' => '', 'user_feedback' => '', 'disable_edit' => 0, 'refreshTree' => 0);
return array($args, $gui, $grants);
}
示例3: initEnv
function initEnv(&$dbHandler)
{
testlinkInitPage($dbHandler);
$argsObj = init_args();
$guiObj = init_gui($dbHandler, $argsObj);
return array($argsObj, $guiObj);
}
示例4: initEnv
/**
*
*
*/
function initEnv(&$dbHandler)
{
testlinkInitPage($dbHandler);
$argsObj = init_args();
checkPageAccess($dbHandler, $argsObj);
// Will exit if check failed
$guiObj = init_gui($dbHandler, $argsObj);
return array($argsObj, $guiObj);
}
示例5: initEnv
function initEnv(&$dbHandler)
{
$args = init_args();
$gui = new stdClass();
$gui->bugIDMaxLength = 0;
$gui->createIssueURL = null;
$gui->issueTrackerVerboseID = '';
$gui->issueTrackerVerboseType = '';
$gui->tproject_id = $args->tproject_id;
// get issue tracker config and object to manage TestLink - BTS integration
$its = null;
$tprojectMgr = new testproject($dbHandler);
list($issueTrackerEnabled, $its) = $tprojectMgr->getIssueTrackerMgr($args->tproject_id);
if ($issueTrackerEnabled) {
if (!is_null($its)) {
$gui->issueTrackerVerboseType = $issueT['verboseType'];
$gui->issueTrackerVerboseID = $issueT['issuetracker_name'];
$gui->bugIDMaxLength = $its->getBugIDMaxLength();
$gui->createIssueURL = $its->getEnterBugURL();
}
}
return array($args, $gui);
}
示例6: testlinkInitPage
require_once "common.php";
require_once 'requirements.inc.php';
require_once 'exttable.class.php';
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$tproject_mgr = new testproject($db);
$tplan_mgr = new testplan($db);
$req_mgr = new requirement_mgr($db);
$req_spec_mgr = new requirement_spec_mgr($db);
$title_sep = config_get('gui_title_separator_1');
$charset = config_get('charset');
$req_cfg = config_get('req_cfg');
list($req_spec_type_labels, $req_type_labels, $status_labels, $labels) = setUpLabels($req_cfg);
list($results_cfg, $status_code_map, $code_status_map, $eval_status_map) = setUpReqStatusCfg();
$args = init_args($tproject_mgr, $tplan_mgr, $req_cfg);
$images = $smarty->getImages();
$gui = init_gui($args, $tplan_mgr);
$i2u = array('edit_icon', 'exec_icon', 'history_small');
foreach ($i2u as $ik) {
$images[$ik] = $gui->baseHref . $images[$ik];
}
$reqContext = array('tproject_id' => $args->tproject_id, 'tplan_id' => $args->tplan_id, 'platform_id' => $args->platform);
$reqSetX = (array) $req_mgr->getAllByContext($reqContext);
$req_ids = array_keys($reqSetX);
$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . config_get('testcase_cfg')->glue_character;
$req_spec_map = array();
$testcases = array();
// first step: get the requirements and linked testcases with which we have to work,
// order them into $req_spec_map by spec
$gui->total_reqs = 0;
示例7: checkRights
/**
* checks runned when tyring to run this page, to be sure user has rights to use it.
*
*/
function checkRights(&$db, &$user)
{
$result = false;
$args = init_args();
$answers = new stdClass();
$answers->role_management = $user->hasRight($db, "role_management");
// Two checks needed:
// First on current test project without using test plan rights
// if this fails then check again adding current test plan
$answers->testplan_user_role_assignment = $user->hasRight($db, "testplan_user_role_assignment", $args->testprojectID, -1);
if ($answers->testplan_user_role_assignment != "yes") {
$targetTestPlanID = null;
if ($args->featureType == 'testplan') {
$targetTestPlanID = $args->featureID;
}
$answers->testplan_user_role_assignment = $user->hasRight($db, "testplan_user_role_assignment", null, $targetTestPlanID);
}
$answers->user_role_assignment = $user->hasRight($db, "user_role_assignment", null, -1);
foreach ($answers as $key => $value) {
$answers->{$key} = $value == "yes" ? true : false;
$result = $result | $answers->{$key};
}
if (!$result && $args->featureType == 'testproject') {
$feature2check = $args->featureID;
if ($args->featureID == 0 || is_null($args->featureID)) {
$feature2check = $args->testprojectID;
}
if ($user->hasRight($db, "testproject_user_role_assignment", $feature2check, -1) == "yes") {
$result = true;
}
}
return $result;
}
示例8: testlinkInitPage
* @since 1.9.13
*
**/
require_once '../../config.inc.php';
require_once 'common.php';
require_once 'exec.inc.php';
require_once "attachments.inc.php";
require_once "specview.php";
$cfg = null;
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$tproject_mgr = new testproject($db);
$tree_mgr = new tree($db);
$attachmentRepository = tlAttachmentRepository::create($db);
list($args, $tplan_mgr) = init_args($db, $cfg);
$gui = initializeGui($db, $args, $cfg, $tplan_mgr);
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/*
function:
args:
returns:
*/
function init_args(&$dbHandler, $cfgObj)
{
$args = new stdClass();
$_REQUEST = strings_stripSlashes($_REQUEST);
$tplan_mgr = new testplan($dbHandler);
示例9: testlinkInitPage
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource testCasesWithoutTester.php
* @author Francisco Mancardi - francisco.mancardi@gmail.com
*
* For a test plan, list test cases that has no tester assigned
*
* @internal Revisions:
*
*/
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');
示例10: microtime
*
* @filesource resultsGeneral.php
* @author Martin Havlat <havlat at users.sourceforge.net>
*
* Show Test Results over all Builds.
*
* @internal revisions
* @since 1.9.6
*
*/
require '../../config.inc.php';
require_once 'common.php';
require_once 'displayMgr.php';
$timerOn = microtime(true);
$templateCfg = templateConfiguration();
$args = init_args($db);
$tplan_mgr = new testplan($db);
$gui = initializeGui($db, $args, $tplan_mgr);
$mailCfg = buildMailCfg($gui);
$metricsMgr = new tlTestPlanMetrics($db);
$dummy = $metricsMgr->getStatusTotalsByTopLevelTestSuiteForRender($args->tplan_id);
if (is_null($dummy)) {
// no test cases -> no report
$gui->do_report['status_ok'] = 0;
$gui->do_report['msg'] = lang_get('report_tspec_has_no_tsuites');
tLog('Overall Metrics page: no test cases defined');
} else {
// do report
$gui->statistics->testsuites = $dummy->info;
$gui->do_report['status_ok'] = 1;
$gui->do_report['msg'] = '';
示例11: dirname
* @package TestLink
* @author Andreas Simon
* @copyright 2005-2010, TestLink community
* @link http://www.teamst.org/index.php
*
* @internal revisions:
*
*/
require_once dirname(__FILE__) . "/../../config.inc.php";
require_once "common.php";
testlinkInitPage($db);
$assignment_mgr = new assignment_mgr($db);
$testplan_mgr = new testplan($db);
$build_mgr = new build_mgr($db);
$templateCfg = templateConfiguration();
$args = init_args($testplan_mgr->tree_manager);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = init_gui($db, $args);
$assignment_count = 0;
$build_name = "";
if ($args->build_id) {
$assignment_count = $assignment_mgr->get_count_of_assignments_for_build_id($args->build_id);
$build_info = $build_mgr->get_by_id($args->build_id);
$build_name = $build_info['name'];
}
if ($assignment_count > 0) {
if ($args->confirmed) {
// their deletion has been confirmed, so delete them
$assignment_mgr->delete_by_build_id($args->build_id);
$gui->message = sprintf(lang_get('unassigned_all_tcs_msg'), $build_name);
$gui->refreshTree = $args->refreshTree ? true : false;
示例12: testlinkInitPage
* @link http://www.teamst.org/index.php
*
* @internal revisions
*
* 20110305 - franciscom - BUGID 4286 Option to print single test case
* found issue regarding test case version
*
*/
require_once "../../config.inc.php";
require_once "../../cfg/reports.cfg.php";
require_once "print.inc.php";
require_once "common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tree_mgr = new tree($db);
$args = init_args($tree_mgr);
$node = $tree_mgr->get_node_hierarchy_info($args->tcase_id);
$node['tcversion_id'] = $args->tcversion_id;
$gui = new stdClass();
$gui->outputFormatDomain = $args->outputFormatDomain;
$gui->object_name = '';
$gui->goback_url = !is_null($args->goback_url) ? $args->goback_url : '';
$gui->object_name = $node['name'];
$gui->page_title = sprintf(lang_get('print_testcase'), $node['name']);
$gui->tproject_name = $args->tproject_name;
$gui->tproject_id = $args->tproject_id;
$gui->tcase_id = $args->tcase_id;
$gui->tcversion_id = $args->tcversion_id;
// Struture defined in printDocument.php
$printingOptions = array('toc' => 0, 'body' => 1, 'summary' => 1, 'header' => 0, 'headerNumbering' => 0, 'passfail' => 0, 'author' => 1, 'notes' => 1, 'requirement' => 1, 'keyword' => 1, 'cfields' => 1, 'displayVersion' => 1, 'displayDates' => 1, 'docType' => SINGLE_TESTCASE, 'importance' => 1);
$level = 0;
示例13: getCfg
* @internal revisions
* @since 2.0
*
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "opt_transfer.php";
require_once "web_editor.php";
$cfg = getCfg();
testlinkInitPage($db);
$optionTransferName = 'ot';
$tcase_mgr = new testcase($db);
$tproject_mgr = new testproject($db);
$tree_mgr = new tree($db);
$tsuite_mgr = new testsuite($db);
$args = init_args($db, $cfg, $tproject_mgr);
require_once require_web_editor($cfg->webEditorCfg['type']);
$commandMgr = new testcaseCommands($db, $_SESSION['currentUser'], $args->tproject_id);
$commandMgr->setTemplateCfg(templateConfiguration());
$testCaseEditorKeys = array('summary' => 'summary', 'preconditions' => 'preconditions');
$oWebEditor = createWebEditors($args->basehref, $cfg->webEditorCfg, $testCaseEditorKeys);
$sqlResult = "";
$init_inputs = true;
$show_newTC_form = 0;
$opt_cfg = initializeOptionTransferCfg($optionTransferName, $args, $tproject_mgr);
$gui = initializeGui($db, $args, $cfg, $tcase_mgr, $_SESSION['currentUser']);
$smarty = new TLSmarty();
$smarty->templateCfg = templateConfiguration('tcEdit');
$name_ok = 1;
$doRender = false;
$edit_steps = false;
示例14: getWebEditorCfg
* @internal revisions
* @since 1.9.13
**/
require_once '../../config.inc.php';
require_once "common.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('testplan');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$smarty = new TLSmarty();
$do_display = false;
$template = null;
$args = init_args($_REQUEST);
if (!$args->tproject_id) {
$smarty->assign('title', lang_get('fatal_page_title'));
$smarty->assign('content', lang_get('error_no_testprojects_present'));
$smarty->display('workAreaSimple.tpl');
exit;
}
$gui = initializeGui($db, $args, $editorCfg, $tproject_mgr);
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('testplan_template', $of->InstanceName, $args->notes);
// Checks on testplan name, and testplan name<=>testplan id
if ($args->do_action == "do_create" || $args->do_action == "do_update") {
$gui->testplan_name = $args->testplan_name;
$name_exists = $tproject_mgr->check_tplan_name_existence($args->tproject_id, $args->testplan_name);
$name_id_rel_ok = isset($gui->tplans[$args->tplan_id]) && $gui->tplans[$args->tplan_id]['name'] == $args->testplan_name;
}
示例15: launch_inner_xta2m
/**
* xta2m: eXecution Tasks Assigned TO Me
*
*/
function launch_inner_xta2m(&$dbHandler, &$tplMgr)
{
$args = init_args($dbHandler);
//if($args->status_ok == FALSE)
//{
// echo 'NOOO';
// ob_end_flush();
// exit();
//}
$jt = $_SESSION['basehref'] . '/lib/testcases/' . 'tcAssignedToUser.php?user_id=' . $args->target_user_id . ($k2c = array('tplan_id', 'build_id'));
foreach ($k2c as $tg) {
if (property_exists($args, $tg) && $args->{$tg} > 0) {
$jt .= "&{$tg}=" . $args->{$tg};
}
}
$tplMgr->assign('workframe', $jt);
$tplMgr->display('workframe.tpl');
}