Exemplo n.º 1
0
function renderGui(&$argsObj, &$guiObj, $templateCfg)
{
    $smarty = new TLSmarty();
    $smarty->assign('gui', $guiObj);
    $doRender = false;
    switch ($argsObj->doAction) {
        case "edit":
        case "create":
            $doRender = true;
            $tpl = $templateCfg->default_template;
            break;
        case "doCreate":
        case "doUpdate":
            if (!is_null($templateCfg->template)) {
                $doRender = true;
                $tpl = $templateCfg->template;
            } else {
                header("Location: rolesView.php?tproject_id={$guiObj->tproject_id}");
                exit;
            }
            break;
    }
    if ($doRender) {
        $smarty->display($templateCfg->template_dir . $tpl);
    }
}
Exemplo n.º 2
0
/**
 * Display simple info and exit
 *
 * @param string $title
 * @param string $message
 */
function displayInfo($title, $message)
{
    $smarty = new TLSmarty();
    $smarty->assign('title', $title);
    $smarty->assign('content', $message);
    $smarty->display('workAreaSimple.tpl');
    exit;
}
Exemplo n.º 3
0
/**
 * Display simple info and exit
 *
 * @param string $title
 * @param string $message
 */
function displayInfo($title, $message)
{
    $smarty = new TLSmarty();
    $gui = new stdClass();
    $gui->title = $title;
    $gui->content = $message;
    $gui->hint_text = $gui->link_to_op = '';
    $smarty->assign('gui', $gui);
    $smarty->display('workAreaSimple.tpl');
    exit;
}
Exemplo n.º 4
0
/**
 */
function renderGui(&$dbHandler, &$argsObj, $guiObj, $opObj, $templateCfg)
{
    $smartyObj = new TLSmarty();
    $renderType = 'none';
    // key: gui action
    // value: next gui action (used to set value of action button on gui)
    $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doDelete' => '', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate');
    // Get rendering type and set variable for template
    switch ($argsObj->doAction) {
        case "edit":
        case "create":
        case "doDelete":
        case "doCreate":
        case "doUpdate":
            $key2loop = get_object_vars($opObj);
            foreach ($key2loop as $key => $value) {
                $guiObj->{$key} = $value;
            }
            $guiObj->operation = $actionOperation[$argsObj->doAction];
            $renderType = 'redirect';
            $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template;
            $pos = strpos($tpl, '.php');
            if ($pos === false) {
                $tplDir = !isset($opObj->template_dir) || is_null($opObj->template_dir) ? $templateCfg->template_dir : $opObj->template_dir;
                $tpl = $tplDir . $tpl;
                $renderType = 'template';
            }
            break;
    }
    // execute rendering
    // new dBug($tpl);
    // new dBug($guiObj);
    switch ($renderType) {
        case 'template':
            $smartyObj->assign('gui', $guiObj);
            $smartyObj->display($tpl);
            break;
        case 'redirect':
            header("Location: {$tpl}");
            exit;
            break;
        default:
            break;
    }
}
/**
 * 
 *
 */
function displayReport($template_file, &$smarty, $doc_format, $mailCfg = null)
{
    switch ($doc_format) {
        case FORMAT_HTML:
        case FORMAT_ODT:
        case FORMAT_ODS:
        case FORMAT_XLS:
        case FORMAT_MSWORD:
        case FORMAT_PDF:
            flushHttpHeader($doc_format, $doc_kind = 0);
            break;
        case FORMAT_MAIL_HTML:
            $op = generateHtmlEmail($smarty, $template_file, $mailCfg);
            $message = $op->status_ok ? '' : lang_get('send_mail_ko');
            $smarty = new TLSmarty();
            $smarty->assign('message', $message . ' ' . $op->msg);
            $smarty->assign('title', $mailCfg->subject);
            $template_file = "emailSent.tpl";
            break;
    }
    $smarty->display($template_file);
}
function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg)
{
    $smartyObj = new TLSmarty();
    //
    // key: operation requested (normally received from GUI on doAction)
    // value: operation value to set on doAction HTML INPUT
    // This is useful when you use same template (example xxEdit.tpl), for create and edit.
    // When template is used for create -> operation: doCreate.
    // When template is used for edit -> operation: doUpdate.
    //
    // used to set value of: $guiObj->operation
    //
    $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doDelete' => '', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate');
    $renderType = 'none';
    switch ($argsObj->doAction) {
        case "edit":
        case "create":
        case "doDelete":
        case "doCreate":
        case "doUpdate":
            $renderType = 'template';
            $key2loop = get_object_vars($opObj);
            foreach ($key2loop as $key => $value) {
                $guiObj->{$key} = $value;
            }
            $guiObj->operation = $actionOperation[$argsObj->doAction];
            $tplDir = !isset($opObj->template_dir) || is_null($opObj->template_dir) ? $templateCfg->template_dir : $opObj->template_dir;
            $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template;
            $pos = strpos($tpl, '.php');
            if ($pos === false) {
                $tpl = $tplDir . $tpl;
            } else {
                $renderType = 'redirect';
            }
            break;
    }
    switch ($renderType) {
        case 'template':
            $smartyObj->assign('gui', $guiObj);
            $smartyObj->display($tpl);
            break;
        case 'redirect':
            header("Location: {$tpl}");
            exit;
            break;
        default:
            break;
    }
}
Exemplo n.º 7
0
    while ($myrow = mysql_fetch_assoc($result)) {
        $data[runID][$myrow['runID']] = $myrow;
        $limitedRunIDs[] = $myrow['runID'];
        if (!isset($machine[$myrow['runMachineID']])) {
            list($ip, $client, $hostnameID, $hostname) = getMachineInfo($myrow['runID']);
            $machine[$hostnameID][ip] = $ip;
            $machine[$hostnameID][client] = $client;
            $machine[$hostnameID][hostnameID] = $hostnameID;
            $machine[$hostnameID][hostname] = $hostname;
        }
        $data[runID][$myrow['runID']][machineIPAddr] = $machine[$myrow['runMachineID']][ip];
        $data[runID][$myrow['runID']][p4Client] = $machine[$myrow['runMachineID']][client];
        $data[runID][$myrow['runID']][hostname] = $machine[$myrow['runMachineID']][hostname];
        $data[runID][$myrow['runID']][scriptCount] = 0;
        $data[runID][$myrow['runID']][caseCount] = 0;
        $data[runID][$myrow['runID']][scripts][passed] = 0;
    }
}
getTestScriptResults($data, $condition, $limitedRunIDs);
$smarty = new TLSmarty();
$smarty->assign("chosenQueueID", is_null($queueIDform) ? "" : $queueIDform);
$smarty->assign("errors", $error);
$smarty->assign("data", $data);
# note: for the href to work you will need to edit gui/javascript/highlightTableRow.js
#       in order to propery set the <rowname>href attribute
$spanInfo = array(array(id => "runID", show => "yes", message => "runID", colName => "runID", tdTag => 'id="runID" width="6%"', href => 'smokeruns_ts.php?runID={$data.runID.$runID.runID}'), array(id => "versioncolumn", show => "yes", message => "Version", colName => "versionDottedQuad"), array(id => "buildcolumn", show => "yes", message => "Build", colName => "buildNum"), array(id => "purpose", show => "no", message => "Purpose", colName => "runPurpose"), array(id => "user", show => "yes", message => "User", colName => "NTID"), array(id => "total", show => "yes", message => "Total", colName => "scriptCount"), array(id => "passed", show => "yes", message => "Passed", evalColName => '{$data.runID.$runID.scripts.passed}'), array(id => "status", show => "yes", color => "yes", message => "Status", colName => "runStatus"), array(id => "machine", show => "no", message => "Where Run", colName => "hostname"), array(id => "cli", show => "no", color => "no", tdTag => 'class="cli"', message => "Command Line", colName => "runExecuteMethod"));
$smarty->assign("spaninfo", $spanInfo);
$smarty->display('smokeruns.tpl');
?>

Exemplo n.º 8
0
        $filter['by_scope'] = " AND RS.scope like '%{$scope}%' ";
    }
    if ($args->custom_field_id > 0) {
        //search by custom fields
        $args->custom_field_id = $db->prepare_int($args->custom_field_id);
        $args->custom_field_value = $db->prepare_string($args->custom_field_value);
        $from['by_custom_field'] = ", {$tables['cfield_design_values']} CFD ";
        $filter['by_custom_field'] = " AND CFD.field_id={$args->custom_field_id} " . " AND CFD.node_id=NH.id " . " AND CFD.value like '%{$args->custom_field_value}%' ";
    }
    $sql = " SELECT NH.id AS id,NH.name as name " . " FROM {$tables['nodes_hierarchy']} NH, " . " {$tables['req_specs']} RS {$from['by_custom_field']} " . " WHERE NH.id = RS.id " . " AND RS.testproject_id = {$args->tprojectID} ";
    if ($filter) {
        $sql .= implode("", $filter);
    }
    $map = $db->fetchRowsIntoMap($sql, 'id');
}
$smarty = new TLSmarty();
$gui->row_qty = count($map);
if ($gui->row_qty) {
    $tpl = 'reqSpecSearchResults.tpl';
    $gui->pageTitle = $gui->main_descr . " - " . lang_get('match_count') . ": " . $gui->row_qty;
    $gui->resultSet = $map;
    if ($gui->row_qty <= $req_cfg->search->max_qty_for_display) {
        $req_set = array_keys($map);
        $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose($req_set);
    } else {
        $gui->warning_msg = lang_get('too_wide_search_criteria');
    }
} else {
    $the_tpl = config_get('tpl');
    $gui->pageTitle = $gui->main_descr;
    $tpl = isset($the_tpl['reqSpecSearchView']) ? $the_tpl['reqSpecSearchView'] : 'reqSpecView.tpl';
Exemplo n.º 9
0
/**
 * manage GUI rendering
 *
 */
function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg, $cfgObj, $edit_steps)
{
    $smartyObj = new TLSmarty();
    // need by webeditor loading logic present on inc_head.tpl
    $smartyObj->assign('editorType', $guiObj->editorType);
    $renderType = 'none';
    //
    // key: operation requested (normally received from GUI on doAction)
    // value: operation value to set on doAction HTML INPUT
    // This is useful when you use same template (example xxEdit.tpl), for create and edit.
    // When template is used for create -> operation: doCreate.
    // When template is used for edit -> operation: doUpdate.
    //
    // used to set value of: $guiObj->operation
    //
    $actionOperation = array('create' => 'doCreate', 'doCreate' => 'doCreate', 'edit' => 'doUpdate', 'delete' => 'doDelete', 'doDelete' => '', 'createStep' => 'doCreateStep', 'doCreateStep' => 'doCreateStep', 'doCopyStep' => 'doUpdateStep', 'editStep' => 'doUpdateStep', 'doUpdateStep' => 'doUpdateStep', 'doDeleteStep' => '', 'doReorderSteps' => '', 'doInsertStep' => 'doUpdateStep');
    $key2work = 'initWebEditorFromTemplate';
    $initWebEditorFromTemplate = property_exists($opObj, $key2work) ? $opObj->{$key2work} : false;
    $key2work = 'cleanUpWebEditor';
    $cleanUpWebEditor = property_exists($opObj, $key2work) ? $opObj->{$key2work} : false;
    $oWebEditor = createWebEditors($argsObj->basehref, $cfgObj->webEditorCfg, null, $edit_steps);
    foreach ($oWebEditor->cfg as $key => $value) {
        $of =& $oWebEditor->editor[$key];
        $rows = $oWebEditor->cfg[$key]['rows'];
        $cols = $oWebEditor->cfg[$key]['cols'];
        switch ($argsObj->doAction) {
            case "edit":
            case "delete":
            case "editStep":
                $initWebEditorFromTemplate = false;
                $of->Value = $argsObj->{$key};
                break;
            case "doCreate":
            case "doDelete":
            case "doCopyStep":
            case "doUpdateStep":
                $initWebEditorFromTemplate = false;
                $of->Value = $argsObj->{$key};
                break;
            case "create":
            case "doCreateStep":
            case "doInsertStep":
            default:
                $initWebEditorFromTemplate = true;
                break;
        }
        $guiObj->operation = $actionOperation[$argsObj->doAction];
        if ($initWebEditorFromTemplate) {
            $of->Value = getItemTemplateContents('testcase_template', $of->InstanceName, '');
        } else {
            if ($cleanUpWebEditor) {
                $of->Value = '';
            }
        }
        $smartyObj->assign($key, $of->CreateHTML($rows, $cols));
    }
    // manage tree refresh
    switch ($argsObj->doAction) {
        case "doDelete":
            $guiObj->refreshTree = $argsObj->refreshTree;
            break;
    }
    switch ($argsObj->doAction) {
        case "edit":
        case "create":
        case "delete":
        case "createStep":
        case "editStep":
        case "doCreate":
        case "doDelete":
        case "doCreateStep":
        case "doUpdateStep":
        case "doDeleteStep":
        case "doReorderSteps":
        case "doCopyStep":
        case "doInsertStep":
            $renderType = 'template';
            // Document !!!!
            $key2loop = get_object_vars($opObj);
            foreach ($key2loop as $key => $value) {
                $guiObj->{$key} = $value;
            }
            $guiObj->operation = $actionOperation[$argsObj->doAction];
            new dBug($opObj);
            $tplDir = !isset($opObj->template_dir) || is_null($opObj->template_dir) ? $templateCfg->template_dir : $opObj->template_dir;
            $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template;
            $pos = strpos($tpl, '.php');
            if ($pos === false) {
                $tpl = $tplDir . $tpl;
            } else {
                $renderType = 'redirect';
            }
            break;
    }
    switch ($renderType) {
        case 'template':
            new dBug($tpl);
            $smartyObj->assign('gui', $guiObj);
            $smartyObj->display($tpl);
            break;
        case 'redirect':
            header("Location: {$tpl}");
            exit;
            break;
        default:
            break;
    }
}
Exemplo n.º 10
0
require_once "common.php";
require_once "csv.inc.php";
require_once "xml.inc.php";
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$args = init_args();
switch ($args->doAction) {
    case "do_export":
        $op = do_export($db, $smarty, $args);
        break;
}
$keyword = new tlKeyword();
$exportTypes = $keyword->getSupportedSerializationInterfaces();
$main_descr = lang_get('testproject') . TITLE_SEP . $args->testproject_name;
$fileName = is_null($args->export_filename) ? 'keywords.xml' : $args->export_filename;
$smarty = new TLSmarty();
$smarty->assign('export_filename', $fileName);
$smarty->assign('main_descr', $main_descr);
$smarty->assign('action_descr', lang_get('export_keywords'));
$smarty->assign('exportTypes', $exportTypes);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
    $iParams = array("doAction" => array("GET", tlInputParameter::STRING_N, 0, 50), "export_filename" => array("POST", tlInputParameter::STRING_N, 0, 255), "exportType" => array("POST", tlInputParameter::STRING_N, 0, 255));
    $args = new stdClass();
    $pParams = I_PARAMS($iParams, $args);
    $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
    $args->testproject_name = $_SESSION['testprojectName'];
    return $args;
}
/*
Exemplo n.º 11
0
} else {
    // general role applied
    $testprojectRole = $args->user->globalRole->getDisplayName();
}
$gui->whoami = $args->user->getDisplayName() . ' ' . $tlCfg->gui->role_separator_open . $testprojectRole . $tlCfg->gui->role_separator_close;
// only when the user has changed project using the combo the _GET has this key.
// Use this clue to launch a refresh of other frames present on the screen
// using the onload HTML body attribute
$gui->updateMainPage = 0;
if ($args->testproject) {
    $gui->updateMainPage = 1;
    // set test project ID for the next session
    setcookie('TL_lastTestProjectForUserID_' . $args->user->dbID, $args->testproject, TL_COOKIE_KEEPTIME, '/');
}
$gui->grants = getGrants($db, $args->user);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display('navBar.tpl');
/**
 * 
 */
function getGrants(&$db, &$userObj)
{
    $grants = new stdClass();
    $grants->view_testcase_spec = $userObj->hasRight($db, "mgt_view_tc");
    return $grants;
}
function init_args()
{
    $iParams = array("testproject" => array(tlInputParameter::INT_N));
    $args = new stdClass();
Exemplo n.º 12
0
 * @filesource  tcSearch.php
 * @package     TestLink
 * @author      TestLink community
 * @copyright   2007-2015, TestLink community 
 * @link        http://www.testlink.org/
 *
 *
 * @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);
Exemplo n.º 13
0
$buildid = isset($_GET['buildid']) ? $_GET['buildid'] : 1;
$deviceid = isset($_GET['deviceid']) ? $_GET['deviceid'] : 1;
$topotype = isset($_GET['topotype']) ? $_GET['topotype'] : 999;
$suite = isset($_GET['suite']) ? $_GET['suite'] : 1;
$gui->saveresult = 2;
if ($needsave == 1) {
    $result = isset($_POST['result']) ? $_POST['result'] : 'none';
    $result_summary = isset($_POST['result_summary']) ? $_POST['result_summary'] : '';
    $reviewer = isset($_POST['reviewer']) ? $_POST['reviewer'] : '';
    $review_summary = isset($_POST['review_summary']) ? $_POST['review_summary'] : '';
    $result_report = isset($_POST['result_report']) ? $_POST['result_report'] : '';
    $gui->saveresult = $tplan_mgr->setTestResult($tplanid, $deviceid, $buildid, $topotype, $suite, $result, $result_summary, $reviewer, $review_summary, $result_report);
}
$gui->reviewers = $tplan_mgr->get_review_users();
$dcnresult = $tplan_mgr->getTestResult($tplanid, $deviceid, $buildid, $topotype, $suite);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('tplanid', $tplanid);
$smarty->assign('buildid', $buildid);
$smarty->assign('deviceid', $deviceid);
$smarty->assign('topotype', $topotype);
$smarty->assign('suite', $suite);
$smarty->assign('result', $dcnresult);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
    $args = new stdClass();
    $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
    $args->currentUser = $_SESSION['currentUser'];
    $args->username = $_SESSION['currentUser']->getDisplayName();
    return $args;
Exemplo n.º 14
0
    $filters = null;
    $options = array('output' => 'map', 'only_executed' => true, 'execution_details' => 'add_build');
    $execResults = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
    $options = array('output' => 'mapOfArray', 'only_executed' => true, 'execution_details' => 'add_build');
    $execResults = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
    $options = array('output' => 'mapOfMap', 'only_executed' => true, 'execution_details' => 'add_build');
    $execResults = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
    $options = array('output' => 'array', 'only_executed' => true, 'execution_details' => 'add_build');
    $execResults = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options);
    $milestonesList = $tplan_mgr->get_milestones($args->tplan_id);
    if (!empty($milestonesList)) {
        $gui->statistics->milestones = $metricsMgr->getMilestonesMetrics($args->tplan_id, $milestonesList);
    }
}
// ----------------------------------------------------------------------------
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('buildColDefinition', $colDefinition);
$smarty->assign('buildResults', $results);
displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->format, $mailCfg);
/*
  function: init_args 
  args: none
  returns: array 
*/
function init_args()
{
    $iParams = array("tplan_id" => array(tlInputParameter::INT_N), "format" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    $pParams = G_PARAMS($iParams, $args);
    $args->tproject_id = $_SESSION['testprojectID'];
        show_instructions('tc_exec_assignment');
        break;
}
$gui->items = $out['spec_view'];
// useful to avoid error messages on smarty template.
$gui->items_qty = is_null($gui->items) ? 0 : count($gui->items);
$gui->has_tc = $out['num_tc'] > 0 ? 1 : 0;
$gui->support_array = array_keys($gui->items);
if ($_SESSION['testprojectOptions']->testPriorityEnabled) {
    $urgencyCfg = config_get('urgency');
    $gui->priority_labels = init_labels($urgencyCfg["code_label"]);
}
// Changing to _flat template
$tpl = $templateCfg->template_dir . $templateCfg->default_template;
$tpl = str_replace('.tpl', '_flat.tpl', $tpl);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($tpl);
/*
  function: 
  args :
  
  returns: 
*/
function init_args()
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $args = new stdClass();
    $args->user_id = intval($_SESSION['userID']);
    $args->tproject_id = intval($_SESSION['testprojectID']);
    $args->tproject_name = $_SESSION['testprojectName'];
Exemplo n.º 16
0
            fwrite($file, $text);
            foreach ($gui->var_tcversion['var'] as $tcversion) {
                $name = $tcversion['name'];
                $text = ', "' . "{$name}" . '  --RunLevel 10"';
                fwrite($file, $text);
            }
            $text = '], []], "topovarlist": [], "ixiavarlist": []}';
            fwrite($file, $text);
            fclose($file);
            echo "<script>window.open('{$filename}');</script>";
        } elseif ($_GET['suite_id'] == 666) {
            //function
        }
    }
}
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('vars', json_encode($gui->vars));
$smarty->assign('total_vars', $total_vars);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
    $args = new stdClass();
    $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
    $args->currentUser = $_SESSION['currentUser'];
    $args->login_username = $_SESSION['currentUser']->getDisplayName();
    return $args;
}
function checkRights(&$db, &$user)
{
    return True;
 * 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
    $gui->loadExecDashboard = true;
    if (isset($_SESSION['loadExecDashboard'][$control->form_token]) || $control->args->loadExecDashboard == 0) {
 * @link      http://www.testlink.org/
 *
 *
 * @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;
Exemplo n.º 19
0
 * @package         TestLink
 * @author          TestLink community
 * @copyright   2007-2013, TestLink community 
 * @link                http://www.teamst.org/index.php
 *
 * @internal revisions
 * @since 1.9.7
 *
**/
require_once "../../config.inc.php";
require_once "../functions/common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$args = init_args();
$gui = initializeGui($db, $args);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . 'tcSearchForm.tpl');
/**
 * 
 *
 */
function init_args()
{
    $args = new stdClass();
    $args->tprojectID = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0;
    $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0;
    if ($args->tprojectID <= 0) {
        throw new Exception("Error Processing Request - Invalid Test project id " . __FILE__);
    }
    return $args;
Exemplo n.º 20
0
            if (!$res) {
                $errStr .= "Not able to add in database";
                $builds = $_POST['buildID'];
                $phase = $_POST['phaseName'];
            } else {
                $errStr = "<h1>Phase Name: PR-" . $_POST['phaseName'] . " updated succesfully!!!</h1>";
            }
        } else {
            $errStr .= "Build or phase is empty";
        }
        mysql_close($link);
    }
} else {
    $errStr = "";
}
$smarty = new TLSmarty();
$smarty->assign('valid_user', $arr[0]);
$smarty->assign('none', $arr[1]);
$smarty->assign('userString', $arr[2]);
$smarty->assign('errString', $errStr);
$smarty->assign('submitPHP', "resultCons.php");
$smarty->assign('searchPHP', "resultCons.php");
$smarty->assign('regr', "regression");
$smarty->assign('tableHeader', $tableHeader);
$smarty->assign('columnCount', "10");
$smarty->assign('regReq', $regReq);
$smarty->assign('builds', $builds);
$smarty->assign('phaser', $phase);
$smarty->assign('submit', $submit);
$smarty->display('resultCons.tpl');
?>
        if (!$cfieldCfg->show_on_cfg[$ui_mode][$gui->cfield['node_type_id']]) {
            $cfieldCfg->cf_show_on[$ui_mode]['disabled'] = ' disabled="disabled" ';
            $cfieldCfg->cf_show_on[$ui_mode]['style'] = ' style="display:none;" ';
        }
    }
}
$gui->show_possible_values = 0;
if (isset($gui->cfield['type'])) {
    $gui->show_possible_values = $cfieldCfg->possible_values_cfg[$gui->cfield['type']];
}
// enable on 'execution' implies show on 'execution' then has nosense to display show_on combo
if ($args->do_action == 'edit' && $gui->cfield['enable_on_execution']) {
    $cfieldCfg->cf_show_on['execution']['style'] = ' style="display:none;" ';
}
$gui->cfieldCfg = $cfieldCfg;
$smarty = new TLSmarty();
$smarty->assign('operation_descr', $operation_descr);
$smarty->assign('user_feedback', $user_feedback);
$smarty->assign('user_action', $args->do_action);
renderGui($smarty, $args, $gui, $cfield_mgr, $templateCfg);
/*
  function: request2cf
            scan a hash looking for a keys with 'cf_' prefix,
            because this keys represents fields of Custom Fields
            tables.
            Is used to get values filled by user on a HTML form.
            This requirement dictated how html inputs must be named.
            If notation is not followed logic will fail.
  args: hash
  returns: hash only with related to custom fields, where
           (keys,values) are the original with 'cf_' prefix, but
Exemplo n.º 22
0
    $arrData = getDataForRegBuild($_GET['buildID'], $regType);
    // get result for Alcatel build
    $buildDataOAW = createDataForRegBuild($_GET['buildID'] . "_OAW", $regType);
    if (is_array($buildDataOAW)) {
        writeRegBuildCasesToFile($buildDataOAW, $_GET['buildID'] . "_OAW", $regType);
    }
    $arrDataOAW = getDataForRegBuild($_GET['buildID'] . "_OAW", $regType);
    if (!is_array($arrData)) {
        $errStr = "BUILD '" . $_GET['buildID'] . "' is NOT FOUND!<br>PLEASE SEARCH ANOTHER BUILD!";
    } else {
        $buildTable = createSearchRegBuildTable($arrData, $_GET['buildID'], $arr[1], 0, $regType);
    }
    if (is_array($arrDataOAW)) {
        $buildTableOAW = createSearchRegBuildTable($arrDataOAW, $_GET['buildID'] . "_OAW", $arr[1], 1, $regType);
    }
}
$tableHeader = "<tr>\r\n                        <th style=\"width: 3%\">Build</th>\r\n                        <th style=\"width: 5%\">Type</th>\r\n                        <th style=\"width: 3%\">Version</th>\r\n                        <th style=\"width: 3%\">Started</th>\r\n                        <th style=\"width: 23%\">Total-Pass-Fail</th>\r\n                        <th style=\"width: 4%\">RunStatus</th>\r\n                        <th style=\"width: 4%\">Analysis</th>\r\n                        <th style=\"width: 15%\">Chart</th>\r\n                        <th style=\"width: 37%\">Comments</th>\r\n                        <th style=\"width: 4%\">Bugs</th>\r\n               </tr>              \r\n               <tr><td colspan=\"{\$columnCount}\"></td></tr>\r\n               <tr><td colspan=\"{\$columnCount}\"></td></tr>\r\n               <tr><td colspan=\"{\$columnCount}\"></td></tr>";
$smarty = new TLSmarty();
$smarty->assign('buildTable', $buildTable);
$smarty->assign('buildTableOAW', $buildTableOAW);
$smarty->assign('valid_user', $arr[0]);
$smarty->assign('none', $arr[1]);
$smarty->assign('userString', $arr[2]);
$smarty->assign('errString', $errStr);
$smarty->assign('buildID', $_GET['buildID']);
$smarty->assign('submitPHP', "searchReg.php?regr={$regType}&buildID={$_GET['buildID']}");
$smarty->assign('searchPHP', "searchReg.php?regr={$regType}");
$smarty->assign('regr', $regType);
$smarty->assign('tableHeader', $tableHeader);
$smarty->assign('columnCount', "10");
$smarty->display('searchBuild.tpl');
Exemplo n.º 23
0
/**
 * renderLoginScreen
 * simple piece of code used to clean up code layout
 * 
 * @global  $g_tlLogger
 * @param stdClassObject $guiObj
 */
function renderLoginScreen($guiObj)
{
    global $g_tlLogger;
    $templateCfg = templateConfiguration();
    $logPeriodToDelete = config_get('removeEventsOlderThan');
    $g_tlLogger->deleteEventsFor(null, strtotime("-{$logPeriodToDelete} days UTC"));
    $smarty = new TLSmarty();
    $smarty->assign('gui', $guiObj);
    $smarty->display($templateCfg->default_template);
}
Exemplo n.º 24
0
        setUserSession($db, $user->login, $args->userID, $user->globalRoleID, $user->emailAddress, $user->locale);
    }
}
$gui->loginHistory = new stdClass();
$gui->loginHistory->failed = $g_tlLogger->getAuditEventsFor($args->userID, "users", "LOGIN_FAILED", 10);
$gui->loginHistory->ok = $g_tlLogger->getAuditEventsFor($args->userID, "users", "LOGIN", 10);
if ($op->status != tl::OK) {
    $op->user_feedback = getUserErrorMessage($op->status);
}
$user->readFromDB($db);
// set a string if not generated key yet
if (null == $user->userApiKey) {
    $user->userApiKey = TLS('none');
}
$gui->user_feedback = $op->user_feedback;
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('user', $user);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $iParams = array("firstName" => array("POST", tlInputParameter::STRING_N, 0, 30), "lastName" => array("REQUEST", tlInputParameter::STRING_N, 0, 30), "emailAddress" => array("REQUEST", tlInputParameter::STRING_N, 0, 100), "locale" => array("POST", tlInputParameter::STRING_N, 0, 10), "oldpassword" => array("POST", tlInputParameter::STRING_N, 0, 32), "newpassword" => array("POST", tlInputParameter::STRING_N, 0, 32), "doAction" => array("POST", tlInputParameter::STRING_N, 0, 15, null, 'checkDoAction'));
    $pParams = I_PARAMS($iParams);
    $args = new stdClass();
    $args->user = new stdClass();
    $args->user->firstName = $pParams["firstName"];
    $args->user->lastName = $pParams["lastName"];
    $args->user->emailAddress = $pParams["emailAddress"];
    $args->user->locale = $pParams["locale"];
    $args->oldpassword = $pParams["oldpassword"];
Exemplo n.º 25
0
        doSessionStart();
        unset($_SESSION['basehref']);
        setPaths();
        $validSession = checkSessionValid($db, false);
        // Send a json reply, include localized strings for use in js to display a login form.
        echo json_encode(array('validSession' => $validSession, 'username_label' => lang_get('login_name'), 'password_label' => lang_get('password'), 'login_label' => lang_get('btn_login')));
        break;
    case 'loginform':
        $doRender = true;
        break;
}
// BUGID 0003129
if ($doRender) {
    $logPeriodToDelete = config_get('removeEventsOlderThan');
    $g_tlLogger->deleteEventsFor(null, strtotime("-{$logPeriodToDelete} days UTC"));
    $smarty = new TLSmarty();
    $smarty->assign('gui', $gui);
    $smarty->display($templateCfg->default_template);
}
/**
 * 
 *
 */
function init_args()
{
    $iParams = array("note" => array(tlInputParameter::STRING_N, 0, 255), "tl_login" => array(tlInputParameter::STRING_N, 0, 30), "tl_password" => array(tlInputParameter::STRING_N, 0, 32), "req" => array(tlInputParameter::STRING_N, 0, 4000), "reqURI" => array(tlInputParameter::STRING_N, 0, 4000), "action" => array(tlInputParameter::STRING_N, 0, 10));
    $pParams = R_PARAMS($iParams);
    $args = new stdClass();
    $args->note = $pParams['note'];
    $args->login = $pParams['tl_login'];
    $args->pwd = $pParams['tl_password'];
Exemplo n.º 26
0
<?php

/**
 * TestLink Open Source Project - http://testlink.sourceforge.net/
 * This script is distributed under the GNU General Public License 2 or later.
 *
 * @version $Id: project_req_spec_mgmt.php,v 1.6 2009/01/07 19:55:35 schlundus Exp $
 * @author Martin Havlat
 *
 * Allows you to show test suites, test cases.
 * Normally launched from tree navigator.
 *
 */
require_once '../../config.inc.php';
require_once 'common.php';
testlinkInitPage($db, false, false, "checkRights");
$tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
$tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 'undefined';
$gui = new stdClass();
$gui->main_descr = lang_get('testproject') . TITLE_SEP . $tproject_name;
$gui->tproject_id = $tproject_id;
$gui->refresh_tree = 'no';
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display('requirements/project_req_spec_mgmt.tpl');
function checkRights(&$db, &$user)
{
    return $user->hasRight($db, 'mgt_view_req') && $user->hasRight($db, 'mgt_modify_req');
}
Exemplo n.º 27
0
    $colDefinition = null;
    $results = null;
    if ($gui->do_report['status_ok']) {
        $gui->statistics->overallBuildStatus = $metricsMgr->getOverallBuildStatusForRender($args->tplan_id);
        //$gui->statistics->overallBuildStatus = $metricsMgr->getOverallBuildStatusForRender_mokal($args->tplan_id);
        $gui->displayBuildMetrics = !is_null($gui->statistics->overallBuildStatus);
    }
    /* MILESTONE & PRIORITY REPORT */
    $milestonesList = $tplan_mgr->get_milestones($args->tplan_id);
    if (!empty($milestonesList)) {
        $gui->statistics->milestones = $metricsMgr->getMilestonesMetrics($args->tplan_id, $milestonesList);
    }
}
$timerOff = microtime(true);
$gui->elapsed_time = round($timerOff - $timerOn, 2);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->format, $mailCfg);
/*
  function: init_args 
  args: none
  returns: array 
*/
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), "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();
Exemplo n.º 28
0
 /**
  * doAdd2testplan
  *
  */
 function doAdd2testplan(&$argsObj, $request)
 {
     $smartyObj = new TLSmarty();
     $smartyObj->assign('attachments', null);
     $guiObj = $this->initGuiBean($argsObj);
     $guiObj->refreshTree = $argsObj->refreshTree ? 1 : 0;
     $tplan_mgr = new testplan($this->db);
     // $request['add2tplanid']
     // main key: testplan id
     // sec key : platform_id
     $item2link = null;
     if (isset($request['add2tplanid'])) {
         foreach ($request['add2tplanid'] as $tplan_id => $platformSet) {
             foreach ($platformSet as $platform_id => $dummy) {
                 $item2link = null;
                 $item2link['tcversion'][$argsObj->tcase_id] = $argsObj->tcversion_id;
                 $item2link['platform'][$platform_id] = $platform_id;
                 $item2link['items'][$argsObj->tcase_id][$platform_id] = $argsObj->tcversion_id;
                 $tplan_mgr->link_tcversions($tplan_id, $item2link, $argsObj->user_id);
             }
         }
         $identity = new stdClass();
         $identity->tproject_id = $argsObj->tproject_id;
         $identity->id = $argsObj->tcase_id;
         $identity->version_id = $argsObj->tcversion_id;
         $this->tcaseMgr->show($smartyObj, $guiObj, $identity, $this->grants);
         exit;
     }
     return $guiObj;
 }
Exemplo n.º 29
0
        break;
    case 'setActive':
    case 'setInactive':
    case 'enableRequirements':
    case 'disableRequirements':
        $m2c = $args->doAction;
        $tproject_mgr->{$m2c}($args->tprojectID);
        $template = null;
        $ui = new stdClass();
        $status_ok = 1;
        $user_feedback = '';
        $reloadType = 'reloadNavBar';
        break;
}
$ui->main_descr = lang_get('title_testproject_management');
$smarty = new TLSmarty();
$smarty->assign('gui_cfg', $gui_cfg);
$smarty->assign('editorType', $editorCfg['type']);
$smarty->assign('mgt_view_events', $_SESSION['currentUser']->hasRight($db, "mgt_view_events"));
$feedback_type = '';
if (!$status_ok) {
    $feedback_type = 'error';
    $args->doAction = "ErrorOnAction";
}
switch ($args->doAction) {
    case "doCreate":
    case "doDelete":
    case "doUpdate":
    case "setActive":
    case "setInactive":
    case 'enableRequirements':
                } else {
                    header("Location: keywordsView.php");
                    exit;
                }
            }
            @unlink($dest);
        }
    } else {
        $msg = lang_get('please_choose_keywords_file');
    }
}
$tlKeyword = new tlKeyword();
$importTypes = $tlKeyword->getSupportedSerializationInterfaces();
$formatStrings = $tlKeyword->getSupportedSerializationFormatDescriptions();
$file_size_limit = config_get('import_file_max_size_bytes');
$smarty = new TLSmarty();
$smarty->assign('import_type_selected', $args->importType);
$smarty->assign('msg', $msg);
$smarty->assign('keywordFormatStrings', $formatStrings);
$smarty->assign('importTypes', $importTypes);
$smarty->assign('tproject_name', $args->testproject_name);
$smarty->assign('tproject_id', $args->testproject_id);
$smarty->assign('fileSizeLimitMsg', sprintf(lang_get('max_file_size_is'), $file_size_limit / 1024 . ' KB '));
$smarty->assign('importLimit', $file_size_limit);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * @return object returns the arguments for the page
 */
function init_args()
{
    $iParams = array("UploadFile" => array(tlInputParameter::STRING_N, 0, 1), "importType" => array(tlInputParameter::STRING_N, 0, 100));