/**
 * 
 */
function initScript(&$dbHandler)
{
    $mgr = new issueTrackerCommands($dbHandler);
    $args = init_args(array('doAction' => $mgr->getGuiOpWhiteList()));
    $gui = initializeGui($dbHandler, $args, $mgr);
    return array($args, $gui, $mgr);
}
Beispiel #2
0
/**
 * 
 *
 */
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);
}
Beispiel #3
0
function initEnv(&$dbHandler)
{
    testlinkInitPage($dbHandler);
    $argsObj = init_args();
    $guiObj = init_gui($dbHandler, $argsObj);
    return array($argsObj, $guiObj);
}
/**
 * 
 *
 */
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);
}
Beispiel #5
0
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);
}
Beispiel #6
0
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;
/**
 * 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;
}
 * @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);
 * 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');
Beispiel #10
0
 * 
 * @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'] = '';
 * @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;
Beispiel #12
0
 * @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;
Beispiel #13
0
 * @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;
 * @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;
}
Beispiel #15
0
/**
 * 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');
}
Beispiel #16
0
 * @internal revisions
 * @since 1.9.13
 *
 **/
require_once "../../config.inc.php";
require_once "common.php";
require_once "opt_transfer.php";
require_once "web_editor.php";
$cfg = getCfg();
$optionTransferName = 'ot';
testlinkInitPage($db);
$tcase_mgr = new testcase($db);
$tproject_mgr = new testproject($db);
$tree_mgr = new tree($db);
$tsuite_mgr = new testsuite($db);
$args = init_args($cfg, $optionTransferName, $tcase_mgr);
require_once require_web_editor($cfg->webEditorCfg['type']);
$templateCfg = templateConfiguration('tcEdit');
$commandMgr = new testcaseCommands($db, $args->user, $args->tproject_id);
$commandMgr->setTemplateCfg(templateConfiguration());
$testCaseEditorKeys = array('summary' => 'summary', 'preconditions' => 'preconditions');
$init_inputs = true;
$opt_cfg = initializeOptionTransferCfg($optionTransferName, $args, $tproject_mgr);
$gui = initializeGui($db, $args, $cfg, $tcase_mgr);
$smarty = new TLSmarty();
$active_status = 0;
$name_ok = 1;
$action_result = "deactivate_this_version";
if ($args->do_activate_this) {
    $active_status = 1;
    $action_result = "activate_this_version";
Beispiel #17
0
*/
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) {
 * View project inventory 
 * 
 * @filesource	inventoryView.php
 * @package 	TestLink
 * @author 		Martin Havlat
 * @copyright 	2009, TestLink community 
 *
 *	@todo redirect if no right
 *
 * @internal Revisions:
 *
 **/
require_once '../../config.inc.php';
require_once "common.php";
testlinkInitPage($db);
list($args, $gui) = init_args($db, $_SESSION['currentUser']);
checkRights($db, $_SESSION['currentUser'], $args);
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * init_args()
 *
 */
function init_args(&$dbHandler, &$userObj)
{
    $argsObj = new stdClass();
    $argsObj->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
    $guiObj = new stdClass();
    $guiObj->rightEdit = $userObj->hasRight($dbHandler, "project_inventory_management", $argsObj->tproject_id);
Beispiel #19
0
 * 
 * @package 	  TestLink
 * @copyright 	2005-2012, TestLink community
 * @filesource	usersAssign.php
 * @link 		    http://www.teamst.org/index.php
 *
 * @internal revisions
 *
 */
require_once '../../config.inc.php';
require_once 'users.inc.php';
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tprojectMgr = new testproject($db);
$tplanMgr = new testplan($db);
$args = init_args($tprojectMgr->tree_manager);
checkRights($db, $_SESSION['currentUser'], $args);
$assignRolesFor = null;
$featureMgr = null;
$userFeatureRoles = null;
$doInitGui = true;
$gui = initializeGui($db, $args);
$target = new stdClass();
$target->tproject_id = null;
$target->tplan_id = null;
switch ($args->featureType) {
    case "testproject":
        $gui->highlight->assign_users_tproject = 1;
        $gui->roles_updated = lang_get("test_project_user_roles_updated");
        $gui->not_for_you = lang_get("testproject_roles_assign_disabled");
        $assignRolesFor = $args->featureType;
Beispiel #20
0
require_once "attachments.inc.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';
}
// CRITIC:
// If call to testlinkInitPage() is done AFTER require_once for BTS
// log to event viewer fails, but log to file works ok
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tcversion_id = null;
$submitResult = null;
$args = init_args($db, $cfg);
// 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);
if ($info['issue_tracker_enabled']) {
    $it_mgr = new tlIssueTracker($db);
    $its = $it_mgr->getInterfaceObject($args->tproject_id);
    $issueT = $it_mgr->getLinkedTo($args->tproject_id);
    unset($it_mgr);
}
$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);
require_once "common.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':
Beispiel #22
0
require_once "specview.php";
require_once "web_editor.php";
$cfg = getCfg();
require_once require_web_editor($cfg->editorCfg['type']);
// BUGID 3276
// CRITIC:
// If call to testlinkInitPage() is done AFTER require_once for BTS
// log to event viewer fails, but log to file works ok
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;
}
Beispiel #23
0
 * @internal revisions
 * @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;
Beispiel #24
0
require_once "common.php";
require_once "opt_transfer.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('design');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$tree_mgr = new tree($db);
$tproject_mgr = new testproject($db);
$tsuite_mgr = new testsuite($db);
$tcase_mgr = new testcase($db);
$template_dir = 'testcases/';
$refreshTree = false;
// Option Transfer configuration
$opt_cfg = new stdClass();
$opt_cfg->js_ot_name = 'ot';
$args = init_args($db, $opt_cfg);
$level = $args->containerType;
$gui_cfg = config_get('gui');
$smarty = new TLSmarty();
$smarty->assign('editorType', $editorCfg['type']);
$a_tpl = array('move_testsuite_viewer' => 'containerMove.tpl', 'delete_testsuite' => 'containerDelete.tpl', 'move_testcases_viewer' => 'containerMoveTC.tpl', 'testcases_table_view' => 'containerMoveTC.tpl', 'do_copy_tcase_set' => 'containerMoveTC.tpl', 'do_copy_tcase_set_ghost' => 'containerMoveTC.tpl', 'delete_testcases' => 'containerDeleteTC.tpl', 'do_delete_testcases' => 'containerDeleteTC.tpl', 'doBulkSet' => 'containerMoveTC.tpl');
$a_actions = array('edit_testsuite' => 0, 'new_testsuite' => 0, 'delete_testsuite' => 0, 'do_move' => 0, 'do_copy' => 0, 'reorder_testsuites' => 1, 'do_testsuite_reorder' => 0, 'add_testsuite' => 1, 'move_testsuite_viewer' => 0, 'update_testsuite' => 1, 'move_testcases_viewer' => 0, 'do_move_tcase_set' => 0, 'testcases_table_view' => 0, 'do_copy_tcase_set' => 0, 'do_copy_tcase_set_ghost' => 0, 'del_testsuites_bulk' => 0, 'delete_testcases' => 0, 'do_delete_testcases' => 0, 'reorder_testcases' => 0, 'reorder_testsuites_alpha' => 0, 'reorder_testproject_testsuites_alpha' => 0, 'doBulkSet' => 0);
$a_init_opt_transfer = array('edit_testsuite' => 1, 'new_testsuite' => 1, 'add_testsuite' => 1, 'update_testsuite' => 1);
$the_tpl = null;
$action = null;
$get_c_data = null;
$init_opt_transfer = null;
$dummy = ($sortCriteria = config_get('testcase_reorder_by')) == 'NAME' ? '_alpha' : '_externalid';
$lbl2init = array('warning_empty_testsuite_name' => null, 'string_contains_bad_chars' => null, 'container_title_testsuite' => null, 'btn_reorder_testcases' => 'btn_reorder_testcases' . $dummy);
$l18n = init_labels($lbl2init);
// 20121222 -franciscom
Beispiel #25
0
 *  20100726 - asimon - added number of existing assignments to source build selection
 *  20100707 - asimon - BUGID 3406: copy user assignments from other builds
 *                                  on creation of new builds
 *	20100706 - franciscom - BUGID 3581 added better check on release date
 */
require '../../config.inc.php';
require_once "common.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('build');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$date_format_cfg = config_get('date_format');
$tplan_mgr = new testplan($db);
$build_mgr = new build_mgr($db);
$args = init_args($_REQUEST, $tplan_mgr->tree_manager, $date_format_cfg);
checkRights($db, $_SESSION['currentUser'], $args);
$op = new stdClass();
$op->user_feedback = '';
$op->buttonCfg = new stdClass();
$op->buttonCfg->name = "";
$op->buttonCfg->value = "";
$gui = new stdClass();
$gui->tproject_id = $args->tproject_id;
$gui->tplan_id = $args->tplan_id;
$gui->main_descr = lang_get('title_build_2') . config_get('gui_title_separator_2') . lang_get('test_plan') . config_get('gui_title_separator_1') . $args->tplan_name;
$gui->cancelAction = "lib/plan/buildView.php?tproject_id={$gui->tproject_id}&tplan_id={$gui->tplan_id}";
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes);
switch ($args->do_action) {
    case 'edit':
 * @filesource	freeTestCases.php
 * @author 		  Francisco Mancardi - francisco.mancardi@gmail.com
 * 
 * For a test project, list FREE test cases, i.e. not assigned to a test plan.
 * 
 * @internal revisions
 *
 */
require_once "../../config.inc.php";
require_once "common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tcase_cfg = config_get('testcase_cfg');
$importance_levels = config_get('importance_levels');
$tproject_mgr = new testproject($db);
$args = init_args($tproject_mgr);
checkRights($db, $_SESSION['currentUser'], $args);
$priorityMgmtEnabled = $args->tprojectOptions->testPriorityEnabled;
$msg_key = 'all_testcases_has_testplan';
$edit_label = lang_get('design');
$edit_img = TL_THEME_IMG_DIR . "edit_icon.png";
$gui = new stdClass();
$gui->freeTestCases = $tproject_mgr->getFreeTestCases($args->tproject_id);
$gui->path_info = null;
$gui->tableSet = null;
if (!is_null($gui->freeTestCases['items'])) {
    if ($gui->freeTestCases['allfree']) {
        // has no sense display all test cases => display just message.
        $msg_key = 'all_testcases_are_free';
    } else {
        $msg_key = '';
Beispiel #27
0
 *
 * @internal Revisions:
 */
require_once "../../config.inc.php";
require_once "common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tproject_mgr = new testproject($db);
$req_cfg = config_get('req_cfg');
$gui = new stdClass();
$gui->main_descr = lang_get('caption_search_form_req_spec');
$gui->warning_msg = '';
$gui->path_info = null;
$gui->resultSet = null;
$map = null;
$args = init_args();
if ($args->tprojectID) {
    $tables = tlObjectWithDB::getDBTables(array("cfield_design_values", 'nodes_hierarchy', 'req_specs'));
    $filter = null;
    $from = null;
    if ($args->requirement_document_id) {
        //search by id
        $id = $db->prepare_string($args->requirement_document_id);
        $filter['by_id'] = " AND RS.doc_id like '%{$id}%' ";
    }
    if ($args->name) {
        //search by name/title
        $title = $db->prepare_string($args->name);
        $filter['by_name'] = " AND NH.name like '%{$title}%' ";
    }
    if ($args->reqSpecType != "notype") {
 * This script is distributed under the GNU General Public License 2 or later. 
 *
 * @filesource  tcBulkOp.php
 *
 * 
 * @internal revisions
 * @since 1.9.14
 * 
 */
require_once "../../config.inc.php";
require_once "../functions/common.php";
require_once "../functions/xml.inc.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tcaseMgr = new testcase($db);
$args = init_args($tcaseMgr);
$gui = initializeGui($args);
if ($args->doAction == 'apply') {
    foreach ($args->uchoice as $key => $val) {
        if ($val > 0) {
            $tcaseMgr->setIntAttrForAllVersions($args->tcase_id, $key, $val);
        }
    }
}
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/*
  function: init_args
  args:
  
Beispiel #29
0
require_once require_web_editor($editorCfg['type']);
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);
Beispiel #30
0
 * @internal revisions
 * @since 1.9.11
 *
 */
require_once '../../config.inc.php';
require '../../cfg/reports.cfg.php';
require_once 'common.php';
require_once 'print.inc.php';
require_once 'displayMgr.php';
// displayMemUsage('START SCRIPT - LINE:' .__LINE__);
$treeForPlatform = null;
$docText = '';
$topText = '';
$doc_data = new stdClass();
// gather content and tests related data
list($args, $tproject_mgr, $decode) = init_args($db);
$tree_manager =& $tproject_mgr->tree_manager;
list($doc_info, $my) = initEnv($db, $args, $tproject_mgr, $args->user_id);
$printingOptions = initPrintOpt($_REQUEST, $doc_info);
$subtree = $tree_manager->get_subtree($args->itemID, $my['filters'], $my['options']);
$treeForPlatform[0] =& $subtree;
$doc_info->title = $doc_info->tproject_name;
$doc_info->outputFormat = $printingOptions['outputFormat'] = $args->format;
switch ($doc_info->type) {
    case DOC_REQ_SPEC:
        switch ($doc_info->content_range) {
            case 'reqspec':
                $spec_mgr = new requirement_spec_mgr($db);
                $spec = $spec_mgr->get_by_id($args->itemID);
                unset($spec_mgr);
                $spec['childNodes'] = isset($subtree['childNodes']) ? $subtree['childNodes'] : null;