/** * */ function initScript(&$dbHandler) { $mgr = new issueTrackerCommands($dbHandler); $args = init_args(array('doAction' => $mgr->getGuiOpWhiteList())); $gui = initializeGui($dbHandler, $args, $mgr); return array($args, $gui, $mgr); }
// things does not work. // --------------------------------------------------------------------- require_once '../../third_party/codeplex/PHPExcel.php'; // Must be included BEFORE common.php require_once 'common.php'; require_once "lang_api.php"; require_once 'results.class.php'; require_once 'displayMgr.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $args = init_args(); checkRights($db, $_SESSION['currentUser'], $args); $labels = getLabels(); $tplan_mgr = new testPlanUrgency($db); list($tproject_info, $tplan_info) = getAncestorsInfo($db, $tplan_mgr, $args->tproject_id, $args->tplan_id); $gui = initializeGui($args, $tplan_mgr, $tproject_info, $tplan_info); if (is_null($args->doReport) || is_null($args->build_id)) { $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); exit; // Not needed just to remember that execution will not continue } $cfg = getCfg($gui); $not_run_label = lang_get($cfg['results']['status_label']['not_run']); $i18n = array(lang_get($cfg['results']['status_label']['failed']) => PHPExcel_Style_Color::COLOR_RED, lang_get($cfg['results']['status_label']['passed']) => PHPExcel_Style_Color::COLOR_GREEN); $testCaseCfg = config_get('testcase_cfg'); $testCasePrefix = $tproject_info['prefix'] . $testCaseCfg->glue_character; $re = new results($db, $tplan_mgr, $tproject_info, $tplan_info, ALL_TEST_SUITES, ALL_BUILDS, ALL_PLATFORMS); // Get Results on map with access key = test case's parent test suite id $executionsMap = $re->getSuiteList();
* @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'] = ''; $items2loop = array('testsuites', 'keywords'); $keywordsMetrics = $metricsMgr->getStatusTotalsByKeywordForRender($args->tplan_id);
* @copyright 2005-2013, TestLink community * @filesource platformsExport.php * @link http://www.teamst.org/index.php * @uses config.inc.php * * @internal revisions * @since 1.9.9 * 20130930 - franciscom - goback_url input parameter removed, to avoid XSS attack */ require_once "../../config.inc.php"; require_once "common.php"; require_once '../../third_party/adodb_xml/class.ADODB_XML.php'; testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $args = init_args(); $gui = initializeGui($args); switch ($args->doAction) { case 'doExport': doExport($db, $gui->export_filename, $args->testproject_id); break; default: break; } $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * */ function init_args() {
* * @internal revisions * since 1.9.3 * **/ require_once '../../config.inc.php'; require_once 'common.php'; require_once "users.inc.php"; require_once 'treeMenu.inc.php'; require_once 'exec.inc.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $chronos[] = $tstart = microtime(true); $control = new tlTestCaseFilterControl($db, 'execution_mode'); $control->formAction = ''; $gui = initializeGui($control); $control->build_tree_menu($gui); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('control', $control); $smarty->assign('menuUrl', $gui->menuUrl); $smarty->assign('args', $gui->args); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * * */ function initializeGui(&$control) { $gui = new stdClass(); // This logic is managed from execSetResults.php
require_once "web_editor.php"; $editorCfg = getWebEditorCfg('build'); require_once require_web_editor($editorCfg['type']); testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $date_format_cfg = config_get('date_format'); $op = new stdClass(); $op->user_feedback = ''; $op->buttonCfg = new stdClass(); $op->buttonCfg->name = ""; $op->buttonCfg->value = ""; $smarty = new TLSmarty(); $tplan_mgr = new testplan($db); $build_mgr = new build_mgr($db); $args = init_args($_REQUEST, $_SESSION, $date_format_cfg); $gui = initializeGui($args, $build_mgr); $of = web_editor('notes', $_SESSION['basehref'], $editorCfg); $of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes); $op = new stdClass(); $op->operation_descr = ''; $op->user_feedback = ''; $op->buttonCfg = ''; $op->status_ok = 1; switch ($args->do_action) { case 'edit': $op = edit($args, $build_mgr, $date_format_cfg); $gui->closed_on_date = $args->closed_on_date; $of->Value = $op->notes; break; case 'create': $op = create($args);
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; } // interface changes to be able to do not loose CF values if some problem arise on User Interface $gui->cfields = $tplan_mgr->html_table_of_custom_field_inputs($args->tplan_id, $args->tproject_id, 'design', '', $_REQUEST); switch ($args->do_action) { case 'fileUpload': fileUploadManagement($db, $args->tplan_id, $args->fileTitle, $tplan_mgr->getAttachmentTableName()); getItemData($tplan_mgr, $gui, $of, $args->tplan_id, true); break;
* 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)) { $gui->cfieldsDiff = getCFDiff($cfields, $reqMgr); } $gui->diff = array("scope" => array()); foreach ($gui->diff as $key => $val) { // 20110107 - new diff engine
* * @internal revisions * */ require_once "../../config.inc.php"; require_once "common.php"; require_once 'requirements.inc.php'; require_once 'xml.inc.php'; require_once 'csv.inc.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $req_spec_mgr = new requirement_spec_mgr($db); $req_mgr = new requirement_mgr($db); $args = init_args($db); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $_SESSION, $req_spec_mgr, $req_mgr); switch ($args->doAction) { case 'uploadFile': $dummy = doExecuteImport($gui->fileName, $args, $req_spec_mgr, $req_mgr); $gui->items = $dummy->items; $gui->file_check = $dummy->file_check; $gui->importResult = $dummy->msg; $gui->refreshTree = $args->refreshTree && $dummy->refreshTree; break; } $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * doExecuteImport *
function initializeEnv(&$dbHandler, $treeMgr) { $env = array(); $env[0] = init_args($treeMgr); $env[1] = initializeGui($dbHandler, $env[0]); $argsObj =& $env[0]; $guiObj =& $env[1]; $actionTpl = array('move_testsuite_viewer' => 'containerMove.tpl', 'delete_testsuite' => 'containerDelete.tpl', 'move_testcases_viewer' => 'containerMoveTC.tpl', 'do_copy_tcase_set' => 'containerMoveTC.tpl', 'delete_testcases' => 'containerDeleteTC.tpl', 'do_delete_testcases' => 'containerDeleteTC.tpl'); $actionGetData = 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, 'do_copy_tcase_set' => 0, 'del_testsuites_bulk' => 0, 'delete_testcases' => 0, 'do_delete_testcases' => 0, 'reorder_testcases' => 0, 'reorder_testsuites_alpha' => 0, 'reorder_testproject_testsuites_alpha' => 0); $actionInitOptTransfer = array('edit_testsuite' => 1, 'new_testsuite' => 1, 'add_testsuite' => 1, 'update_testsuite' => 1); $guiObj->tpl = null; $guiObj->page_title = ''; $argsObj->action = null; $argsObj->init_opt_transfer = null; $argsObj->getUserInput = null; foreach ($actionGetData as $key => $val) { if (isset($_POST[$key])) { $argsObj->action = $key; $argsObj->init_opt_transfer = isset($actionInitOptTransfer[$argsObj->action]) ? 1 : 0; $argsObj->getUserInput = $val; $guiObj->tpl = isset($actionTpl[$argsObj->action]) ? $actionTpl[$argsObj->action] : null; $guiObj->page_title = lang_get('container_title_testsuite'); break; } } return $env; }
/** * TestLink Open Source Project - http://testlink.sourceforge.net/ * This script is distributed under the GNU General Public License 2 or later. * * @filesource issueTrackerView.php * @author francisco.mancardi@gmail.com * @since 1.9.4 * * @internal revisions * **/ require_once dirname(__FILE__) . "/../../config.inc.php"; require_once "common.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); $gui = initializeGui($db, $args = init_args($db)); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * @return object returns the arguments for the page */ function init_args(&$dbHandler) { $args = new stdClass(); $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; $args->currentUser = $_SESSION['currentUser']; $args->canManage = $_SESSION['currentUser']->hasRight($dbHandler, "issuetracker_management"); $args->user_feedback = array('type' => '', 'message' => ''); return $args; }
* 20101026 - Julian - BUGID 3930 - Localized dateformat for datepicker * 20101022 - asimon - BUGID 3716 - replaced old separated inputs for day/month/year by ext js calendar * 20101019 - eloff - BUGID 3794 - added contribution by rtessier * **/ require_once '../../config.inc.php'; require_once 'common.php'; require_once 'results.class.php'; require_once 'users.inc.php'; require_once 'displayMgr.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $date_format_cfg = config_get('date_format'); $args = init_args($db); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $date_format_cfg); $mailCfg = buildMailCfg($gui); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('report_type', $args->report_type); displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->report_type, $mailCfg); /** * initialize Gui */ function initializeGui(&$dbHandler, &$argsObj, $dateFormat) { $reports_cfg = config_get('reportsCfg'); $gui = new stdClass(); $tplan_mgr = new testplan($dbHandler); $tproject_mgr = new testproject($dbHandler); $getOpt = array('outputFormat' => 'map');
* @since 1.9.15 */ require '../../config.inc.php'; require_once '../../third_party/codeplex/PHPExcel.php'; // Must be included BEFORE common.php require_once 'common.php'; require_once 'displayMgr.php'; $timerOn = microtime(true); // will be used to compute elapsed time $templateCfg = templateConfiguration(); $smarty = new TLSmarty(); $args = init_args($db); $metricsMgr = new tlTestPlanMetrics($db); $tplan_mgr =& $metricsMgr; // displayMemUsage('START' . __FILE__); list($gui, $labels, $cfg) = initializeGui($db, $args, $smarty->getImages(), $tplan_mgr); $args->cfg = $cfg; $mailCfg = buildMailCfg($gui); // We have faced a performance block due to an environment with // 700 Builds and 1300 Test Cases on Test Plan // This created a block on NOT RUN QUERY, but anyway will produce an enormous and // unmanageable matrix on screen // // New way to process: // ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use // Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry // if ($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit || $args->do_action == 'result') { setUpBuilds($args, $gui); $tpl = $templateCfg->default_template; $opt = null;
$orderBy->dir = $args->order_by_dir; break; case 'order_by_role': case 'order_by_login': $orderBy->type = $args->operation; $orderBy->dir = $args->order_by_dir; $args->user_order_by = $args->operation; $order_by_clause = get_order_by_clause($orderBy); $the_k = $args->operation . "_dir"; $args->order_by_dir[$the_k] = $args->order_by_dir[$the_k] == 'asc' ? 'desc' : 'asc'; break; default: $order_by_dir['order_by_login_dir'] = 'desc'; break; } $gui = initializeGui($db, $args, $orderBy); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('user_feedback', $user_feedback); $smarty->assign('result', $sqlResult); $smarty->assign('action', $action); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); function toggle_order_by_dir($which_order_by, $order_by_dir_map) { $obm[$which_order_by] = $order_by_dir_map[$which_order_by] == 'asc' ? 'desc' : 'asc'; return $obm; } /* function: get_order_by_clause() get order by SQL clause to use to order user info args:
require_once 'exttable.class.php'; require_once 'exec.inc.php'; // used for bug string lookup // IMPORTANT NOTICE/WARNING about XLS generation // Seams that \n are not liked // http://stackoverflow.com/questions/5960242/how-to-make-new-lines-in-a-cell-using-phpexcel // $templateCfg = templateConfiguration(); $resultsCfg = config_get('results'); $statusCode = $resultsCfg['status_code']; $args = init_args($db, $statusCode); $tplan_mgr = new testplan($db); $tproject_mgr = new testproject($db); $tcase_mgr = new testcase($db); $metricsMgr = new tlTestPlanMetrics($db); $gui = initializeGui($statusCode, $args, $tplan_mgr); $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); $tproject_info = $tproject_mgr->get_by_id($args->tproject_id); // get issue tracker config and object to manage TestLink - BTS integration $its = null; $tproject_mgr = new testproject($db); $info = $tproject_mgr->get_by_id($args->tproject_id); $gui->bugInterfaceOn = $info['issue_tracker_enabled']; if ($info['issue_tracker_enabled']) { $it_mgr = new tlIssueTracker($db); $its = $it_mgr->getInterfaceObject($args->tproject_id); unset($it_mgr); } $labels = init_labels(array('deleted_user' => null, 'design' => null, 'execution' => null, 'execution_history' => null, 'nobody' => null, 'info_only_with_tester_assignment' => null, 'th_bugs_not_linked' => null, 'info_notrun_tc_report' => null)); $gui->tplan_name = $tplan_info['name']; $gui->tproject_name = $tproject_info['name'];
testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $tcase_mgr = new testcase($db); $args = init_args(); $owebeditor = web_editor('notes', $args->basehref, $editorCfg); switch ($args->doAction) { case 'edit': break; case 'doUpdate': doUpdate($db, $args, $tcase_mgr, $_REQUEST); break; } $map = get_execution($db, $args->exec_id); $owebeditor->Value = $map[0]['notes']; // order on script is critic $gui = initializeGui($args, $tcase_mgr); $cols = intval(isset($editorCfg['cols']) ? $editorCfg['cols'] : 60); $rows = intval(isset($editorCfg['rows']) ? $editorCfg['rows'] : 10); $gui->notes = $owebeditor->CreateHTML($rows, $cols); $gui->editorType = $editorCfg['type']; $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * */ function doUpdate(&$db, &$args, &$tcaseMgr, &$request) { updateExecutionNotes($db, $args->exec_id, $args->notes); $cfield_mgr = new cfield_mgr($db); $cfield_mgr->execution_values_to_db($request, $args->tcversion_id, $args->exec_id, $args->tplan_id);
* * Allows users to export requirements. * * @internal revisions **/ require_once "../../config.inc.php"; require_once "csv.inc.php"; require_once "xml.inc.php"; require_once "common.php"; require_once "requirements.inc.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); $req_spec_mgr = new requirement_spec_mgr($db); $args = init_args(); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($args, $req_spec_mgr); switch ($args->doAction) { case 'export': $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); break; case 'doExport': doExport($args, $req_spec_mgr); break; } /** * checkRights * */ function checkRights(&$db, &$userObj, $argsObj)
require '../../config.inc.php'; require_once 'common.php'; require_once 'displayMgr.php'; require_once 'users.inc.php'; require_once 'exttable.class.php'; require_once 'exec.inc.php'; // used for bug string lookup if (config_get('interface_bugs') != 'NO') { require_once TL_ABS_PATH . 'lib' . DIRECTORY_SEPARATOR . 'bugtracking' . DIRECTORY_SEPARATOR . 'int_bugtracking.php'; } testlinkInitPage($db, true, false, "checkRights"); $templateCfg = templateConfiguration(); $resultsCfg = config_get('results'); $statusCode = $resultsCfg['status_code']; $args = init_args($statusCode); $gui = initializeGui($statusCode, $args); $tplan_mgr = new testplan($db); $tproject_mgr = new testproject($db); $tcase_mgr = new testcase($db); $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); $tproject_info = $tproject_mgr->get_by_id($args->tproject_id); $getOpt = array('outputFormat' => 'map'); $gui->platformSet = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt); $show_platforms = !is_null($gui->platformSet); if (is_null($gui->platformSet)) { $gui->platformSet = array(''); } $gui->bugInterfaceOn = config_get('bugInterfaceOn'); $bugInterface = null; if ($gui->bugInterfaceOn) { $bugInterface = config_get('bugInterface');
* @copyright 2005-2014, TestLink community * @filesource usersEdit.php * @link http://www.testlink.org * * @internal revisions * @since 1.9.10 * */ require_once '../../config.inc.php'; require_once 'users.inc.php'; require_once 'email_api.php'; require_once 'Zend/Validate/Hostname.php'; testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $args = init_args(); $gui = initializeGui(); $user = null; $highlight = initialize_tabsmenu(); $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', 'resetPassword' => 'doUpdate'); switch ($args->doAction) { case "edit": $highlight->edit_user = 1; // Because we can arrive with login, we need to check if we can get // id from login if (strlen(trim($args->login)) > 0) { $args->user_id = tlUser::doesUserExist($db, $args->login); } if (is_null($args->user_id) || intval($args->user_id) <= 0) { // need to manage some sort of error message $gui->op->status = tl::ERROR; $gui->op->user_feedback = sprintf(lang_get('login_does_not_exist'), $args->login);
require_once 'common.php'; require_once "specview.php"; require_once "web_editor.php"; $cfg = getCfg(); require_once require_web_editor($cfg->editorCfg['type']); if ($cfg->exec_cfg->enable_test_automation) { require_once 'remote_exec.php'; } testlinkInitPage($db); $templateCfg = templateConfiguration(); $smarty = new TLSmarty(); $tcversion_id = null; $submitResult = null; $args = init_args($cfg); $mgr = createManagers($db, $args->tproject_id); $gui = initializeGui($db, $args, $cfg, $mgr); // get issue tracker config and object to manage TestLink - BTS integration list($issueTrackerEnabled, $its) = $mgr->tproject->getIssueTrackerMgr($args->tproject_id); if ($issueTrackerEnabled) { if (!is_null($its) && $its->isConnected()) { $gui->issueTrackerIntegrationOn = true; } else { $gui->user_feedback = lang_get('issue_tracker_integration_problems'); } } $_SESSION['history_on'] = $gui->history_on; // Testplan executions and result archiving. Checks whether execute cases button was clicked if ($args->doExec == 1 && !is_null($args->tc_versions) && count($args->tc_versions)) { $gui->remoteExecFeedback = launchRemoteExec($db, $args, $gui->tcasePrefix, $mgr); } list($linked_tcversions, $itemSet) = getLinkedItems($args, $gui->history_on, $gui->cfg, $mgr);
* * @internal revisions * @since 1.9.7 * 20130314 - franciscom - TICKET 5562: Test Cases created per User - toolbar refresh button * breaks filter behaivour */ require_once "../../config.inc.php"; require_once "common.php"; require_once 'users.inc.php'; require_once 'displayMgr.php'; require_once 'exttable.class.php'; $smarty = new TLSmarty(); $imgSet = $smarty->getImages(); $templateCfg = templateConfiguration(); $args = init_args($db); $gui = initializeGui($db, $args, $imgSet); switch ($args->do_action) { case 'result': $tpl = $templateCfg->default_template; break; case 'uinput': default: $tpl = 'tcCreatedPerUserOnTestProjectGUI.tpl'; break; } $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $tpl); /** * initialize Gui */ function initializeGui(&$dbHandler, &$args, $images)
$args = init_args($db); $args->format = 0; $args->tplan1 = $_GET['tplan1']; $args->tplan2 = $_GET['tplan2']; $args->device1 = $_GET['device1']; $args->device2 = $_GET['device2']; $args->stack1 = $_GET['stack1']; $args->stack2 = $_GET['stack2']; $args->total_build = 2; $args->build[0] = $_GET['build1']; $args->build[1] = $_GET['build2']; if ($args->tplan1 == 0 or $args->tplan2 == 0 or $args->build[0] == 0 or $args->build[1] == 0 or $args->device1 == 0 or $args->device2 == 0) { echo "<script>alert('请先选择测试计划、产品型号和测试版本 对比源与目的!');</script>"; } else { $tplan_mgr = new testplan($db); $gui = initializeGui($db, $args, $tplan_mgr, $args->build_id); $gui->do_report['status_ok'] = 1; $gui->do_report['msg'] = ''; $gui->draw_string = "total=2"; $gui->tplan1 = $_GET['tplan1']; $gui->tplan2 = $_GET['tplan2']; $gui->device1 = $_GET['device1']; $gui->device2 = $_GET['device2']; $gui->stack1 = $_GET['stack1']; $gui->stack2 = $_GET['stack2']; $gui->total_build = 2; $gui->build[0] = $_GET['build1']; $gui->build[1] = $_GET['build2']; $gui->build_name = array(); foreach ($gui->build as $index => $buildid) { $j = $index + 1;
* 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); } $gui->diff = array("scope" => array()); foreach ($gui->diff as $key => $val) { if ($args->useDaisyDiff) {
testlinkInitPage($db); if ($cfg->bts_type != 'NO') { require_once TL_ABS_PATH . 'lib' . DIRECTORY_SEPARATOR . 'bugtracking' . DIRECTORY_SEPARATOR . 'int_bugtracking.php'; } $templateCfg = templateConfiguration(); $tcversion_id = null; $submitResult = null; $args = init_args($cfg); $smarty = new TLSmarty(); $tree_mgr = new tree($db); $tplan_mgr = new testplan($db); $tcase_mgr = new testcase($db); $exec_cfield_mgr = new exec_cfield_mgr($db, $args->tproject_id); $attachmentRepository = tlAttachmentRepository::create($db); $req_mgr = new requirement_mgr($db); $gui = initializeGui($db, $args, $cfg, $tplan_mgr, $tcase_mgr); $_SESSION['history_on'] = $gui->history_on; $attachmentInfos = null; $do_show_instructions = $args->level == "" || $args->level == 'testproject' ? 1 : 0; if ($do_show_instructions) { show_instructions('executeTest'); exit; } // --------------------------------------------------------- // Testplan executions and result archiving. Checks whether execute cases button was clicked // if ($args->doExec == 1) { /** @note get testcase ids in an array */ if (!is_null($args->tc_versions) && count($args->tc_versions)) { $status_and_notes = do_remote_execution($db, $args->tc_versions); // Need to be added to $_REQUEST, because we are using $_REQUEST as input
* @since 1.9.15 **/ require_once "../../config.inc.php"; require_once "common.php"; require_once 'exttable.class.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $smarty = new TLSmarty(); $tpl = 'tcSearchResults.tpl'; $tproject_mgr = new testproject($db); $tcase_mgr = new testcase($db); $tcase_cfg = config_get('testcase_cfg'); $charset = config_get('charset'); $filter = null; list($args, $filter) = init_args($tproject_mgr); $ga = initializeGui($args, $tproject_mgr); $gx = $tcase_mgr->getTcSearchSkeleton($args); $gui = (object) array_merge((array) $ga, (array) $gx); initSearch($gui, $args, $tproject_mgr); $map = null; if ($args->tprojectID && $args->doAction == 'doSearch') { $tables = tlObjectWithDB::getDBTables(array('cfield_design_values', 'nodes_hierarchy', 'requirements', 'req_coverage', 'tcsteps', 'testcase_keywords', 'tcversions', 'users')); $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' => '', 'users' => ''); $tcaseID = null; $emptyTestProject = false; if ($args->targetTestCase != "" && strcmp($args->targetTestCase, $gui->tcasePrefix) != 0) { if (strpos($args->targetTestCase, $tcase_cfg->glue_character) === false) { $args->targetTestCase = $gui->tcasePrefix . $args->targetTestCase; }
break; case 'reorder_testcases': reorderTestCasesByCriteria($args, $tsuite_mgr, $tree_mgr, $sortCriteria); $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args, $l18n); $gui->refreshTree = true; $tsuite_mgr->show($smarty, $gui, $template_dir, $args->testsuiteID, null, null); break; case 'reorder_testsuites_alpha': reorderTestSuitesDictionary($args, $tree_mgr, $args->testsuiteID); $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args, $l18n); $gui->refreshTree = true; $tsuite_mgr->show($smarty, $gui, $template_dir, $args->testsuiteID, null, null); break; case 'reorder_testproject_testsuites_alpha': reorderTestSuitesDictionary($args, $tree_mgr, $args->tprojectID); $gui = initializeGui($tproject_mgr, $args->tprojectID, $args, $l18n); $gui->refreshTree = true; $tproject_mgr->show($smarty, $gui, $template_dir, $args->tprojectID, null, null); break; case 'doBulkSet': $args->refreshTree = true; doBulkSet($db, $args, $args->tcaseSet, $tcase_mgr); moveTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, $args); break; default: trigger_error("containerEdit.php - No correct GET/POST data", E_USER_ERROR); break; } if ($the_tpl) { $smarty->assign('refreshTree', $refreshTree && $args->refreshTree); $smarty->display($template_dir . $the_tpl);
$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; $pfn = $args->doAction; switch ($args->doAction) { case "doUpdate": case "doAdd2testplan": case "doCreateNewVersion": $op = $commandMgr->{$pfn}($args, $_REQUEST); break; case "edit": case "create": case "doCreate":
* of some variables used in new common template, * added filtering by custom fields * 20100202 - asimon - BUGID 2455, BUGID 3026 * 20081223 - franciscom - advanced/simple filter feature **/ require '../../config.inc.php'; require_once "common.php"; require_once "users.inc.php"; require_once "treeMenu.inc.php"; require_once 'exec.inc.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); $assignment_mgr = new assignment_mgr($db); // BUGID 3406 $control = new tlTestCaseFilterControl($db, 'plan_mode'); $gui = initializeGui($db, $control, $assignment_mgr); $control->build_tree_menu($gui); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('control', $control); $smarty->assign('menuUrl', $gui->menuUrl); $smarty->assign('args', $control->get_argument_string()); $smarty->assign('treeHeader', $gui->title); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * @param unknown_type $dbHandler * @param unknown_type $control * @return stdClass * * @internal revisions: * 20100721 - asimon - BUGID 3406, added assignmentMgr
testlinkInitPage($db, true, false, "checkRights"); $gui_cfg = config_get('gui'); $templateCfg = templateConfiguration(); $session_tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); $template = null; $ui = new stdClass(); $ui->doActionValue = ''; $ui->buttonValue = ''; $ui->caption = ''; $ui->main_descr = lang_get('title_testproject_management'); $user_feedback = ''; $reloadType = 'none'; // domain 'none','reloadNavBar' $tproject_mgr = new testproject($db); $args = init_args($tproject_mgr, $_REQUEST, $session_tproject_id); $gui = initializeGui($db, $args); $of = web_editor('notes', $_SESSION['basehref'], $editorCfg); $status_ok = 1; switch ($args->doAction) { case 'create': $template = $templateCfg->default_template; $ui = create($args, $tproject_mgr); $gui->testprojects = $ui->testprojects; break; case 'edit': $template = $templateCfg->default_template; $ui = edit($args, $tproject_mgr); break; case 'doCreate': $op = doCreate($args, $tproject_mgr); $template = $op->status_ok ? null : $templateCfg->default_template;
* @internal revisions: * 20110425 - franciscom - BUGID 4429: Code refactoring to remove global coupling as much as possible * BUGID 4339: Working with two different projects within one Browser (same session) * is not possible without heavy side-effects * * */ require '../../config.inc.php'; require_once "common.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); $tplan_mgr = new testplan($db); $tproject_mgr = new testproject($db); $args = init_args($tproject_mgr); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $_SESSION['currentUser'], $tproject_mgr); if ($gui->doIt) { if (($qty_newest = count($gui->testcases)) > 0) { $gui->show_details = 1; // get path $tcaseSet = array_keys($gui->testcases); $path_info = $tproject_mgr->tree_manager->get_full_path_verbose($tcaseSet); foreach ($gui->testcases as $tcase_id => $value) { $path = $path_info[$tcase_id]; unset($path[0]); $path[] = ''; $gui->testcases[$tcase_id]['path'] = implode(' / ', $path); } } else { $gui->user_feedback = lang_get('no_newest_version_of_linked_tcversions'); }