/** * 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; }
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); } }
/** * 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; }
/** * * */ 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(&$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; } }
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'); ?>
/** * 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; } }
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; } /* function: do_export
* **/ 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) { $gui->loadExecDashboard = false;
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)); $args = new stdClass();
} } $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"]; $args->newpassword = $pParams["newpassword"];
* added custom field filtering logic * 20091210 - franciscom - test case execution type filter * 20090308 - franciscom - added option Any in keywords filter * 20090210 - BUGID 2062 - franciscom - */ require_once '../../config.inc.php'; require_once "common.php"; require_once "treeMenu.inc.php"; testlinkInitPage($db); $templateCfg = templateConfiguration(); // new class for filter controlling/handling $control = new tlTestCaseFilterControl($db, 'edit_mode'); $gui = initializeGui($db, $control); $control->build_tree_menu($gui); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('control', $control); $smarty->assign('args', $control->get_argument_string()); $smarty->assign('menuUrl', $gui->menuUrl); $smarty->display($templateCfg->template_dir . 'tcTree.tpl'); /** * Initialize object with information for graphical user interface. * * @param tlTestCaseFilterControl $control * @return stdClass $gui */ function initializeGui(&$dbHandler, &$control) { $gui = new stdClass(); $gui->feature = $control->args->feature; $gui->treeHeader = lang_get('title_navigator') . ' - ' . lang_get('title_test_spec');
$tplan_mgr = new testplan($db); $dmy = $tplan_mgr->get_by_id($context->tplan_id); $gui->buildInfoSet = $tplan_mgr->get_builds($gui->tplan_id); $report_plans = $tplan_mgr->report_get_plans($args->tproject_id); $report_suites = $tplan_mgr->report_get_suites($args->tproject_id); $report_builds = $tplan_mgr->report_get_builds(); $report_build_total = count($report_builds); $report_devices = $tplan_mgr->report_get_devices($args->tproject_id); $report_device_total = count($report_devices); unset($tplan_mgr); $context->apikey = $dmy['api_key']; // $context->apikey = $_SESSION['currentUser']->userApiKey; $context->imgSet = $smarty->getImages(); $gui->menuItems = $reports_mgr->get_list_reports($context, $gui->btsEnabled, $args->optReqs, $tlCfg->reports_formats[$args->format]); } $smarty->assign('gui', $gui); $smarty->assign('report_plans', $report_plans); $smarty->assign('report_suites', $report_suites); $smarty->assign('report_builds', json_encode($report_builds)); $smarty->assign('report_build_total', $report_build_total); $smarty->assign('report_devices', json_encode($report_devices)); $smarty->assign('report_device_total', $report_device_total); $smarty->assign('arrReportTypes', localize_array($tlCfg->reports_formats)); $smarty->assign('selectedReportType', $args->format); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * * */ function init_args() {
krsort($rel[builds], SORT_NUMERIC); foreach ($rel[builds] as $buildID => $build) { $releaseTablesReg[releases][$name][buildTables][$buildID] = createGrenRegBuildTable($build, $buildID, $arr[1]); $buildCountID++; $regCount++; } $releaseTablesReg[releases][$name][releaseTable] = createReleaseTable($rel, $name, $relCountID, count($rel[builds]), $regCount); $buildCountID = 0; $releaseTablesReg[releases][$name][countID] = $relCountID; $relCountID++; } krsort($releaseTablesReg[releases], SORT_NUMERIC); } ///////////////////////////////////////////////////////////////////////////// $smarty = new TLSmarty(); $smarty->assign('releaseTables', $releaseTables); $smarty->assign('releaseTablesReg', $releaseTablesReg); $smarty->assign('releaseCount', count($arrData)); $smarty->assign('releaseCountReg', count($arrDataReg)); $smarty->assign('startRegID', 50); $smarty->assign('valid_user', $arr[0]); $smarty->assign('none', $arr[1]); $smarty->assign('userString', $arr[2]); $smarty->assign('to', $to); $smarty->assign('from', $from); $smarty->assign('noNext', $noNext); $smarty->assign('searchPHP', "search.php"); $smarty->assign('submitPHP', "gren.php"); $smarty->assign('totalColLabel', "Total Smoke Runs"); $smarty->assign('columnHide', ""); $smarty->assign('columnCount', "11");
/** * renderGui * */ function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg, $editorCfg) { $smartyObj = new TLSmarty(); $renderType = 'none'; $tpl = $tpd = null; $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doDelete' => '', 'doReorder' => '', 'reorder' => '', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', 'createChild' => 'doCreate', 'copy' => 'doCopy', 'doCopy' => 'doCopy', 'copyRequirements' => 'doCopyRequirements', 'doCopyRequirements' => 'doCopyRequirements'); $owebEditor = web_editor('scope', $argsObj->basehref, $editorCfg); switch ($argsObj->doAction) { case "edit": case "doCreate": $owebEditor->Value = $argsObj->scope; break; default: $owebEditor->Value = getItemTemplateContents('req_spec_template', $owebEditor->InstanceName, $argsObj->scope); break; } $guiObj->scope = $owebEditor->CreateHTML(); $guiObj->editorType = $editorCfg['type']; // 20100808 - aismon - added logic to refresh filtered tree on action switch ($argsObj->doAction) { case "doCreate": case "doUpdate": case "doCopyRequirements": case "doCopy": case "doDelete": $guiObj->refreshTree = $argsObj->refreshTree; break; } switch ($argsObj->doAction) { case "edit": case "create": case "createChild": case "reorder": case "doDelete": case "doReorder": case "doCreate": case "doUpdate": case "copyRequirements": case "doCopyRequirements": case "copy": case "doCopy": $renderType = 'template'; $key2loop = get_object_vars($opObj); foreach ($key2loop as $key => $value) { $guiObj->{$key} = $value; } $guiObj->operation = $actionOperation[$argsObj->doAction]; $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; $tpd = isset($key2loop['template_dir']) ? $opObj->template_dir : $templateCfg->template_dir; break; } switch ($argsObj->doAction) { case "edit": case "create": case "createChild": case "reorder": case "doDelete": case "doReorder": case "copyRequirements": case "copy": $tpl = $tpd . $tpl; break; case "doCreate": case "doUpdate": case "doCopyRequirements": case "doCopy": $pos = strpos($tpl, '.php'); if ($pos === false) { $tpl = $templateCfg->template_dir . $tpl; } else { $renderType = 'redirect'; } break; } switch ($renderType) { case 'template': $smartyObj->assign('mgt_view_events', has_rights($db, "mgt_view_events")); $smartyObj->assign('gui', $guiObj); $smartyObj->display($tpl); break; case 'redirect': header("Location: {$tpl}"); exit; break; default: break; } }
$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'); ?>
$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');
$additionalInfo->useColours = COLOR_BY_TC_STATUS_OFF; list($treeContents, $additionalArgs) = generateExecTree($db, $workPath, $args->tproject_id, $args->tproject_name, $args->tplan_id, $testplan_name, $filters, $additionalInfo); $tree = $treeContents->menustring; $gui->ajaxTree = new stdClass(); $gui->ajaxTree->root_node = $treeContents->rootnode; $gui->ajaxTree->children = $treeContents->menustring; $gui->ajaxTree->loadFromChildren = true; $gui->ajaxTree->cookiePrefix .= $gui->ajaxTree->root_node->id . "_"; break; default: tLog("Argument _REQUEST['type'] has invalid value", 'ERROR'); exit; break; } $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('arrCheckboxes', $arrCheckboxes); $smarty->assign('selFormat', $args->format); $smarty->assign('docType', $args->doc_type); $smarty->assign('docTestPlanId', $args->tplan_id); $smarty->assign('tree', $tree); $smarty->assign('menuUrl', $workPath); $smarty->assign('args', $getArguments); $smarty->assign('additionalArgs', $additionalArgs); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * get user input and create an object with properties representing this inputs. * @return stdClass object */ function init_args() {
/** * 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; }
header('Pragma: public'); header("Cache-Control: "); if (!(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" && preg_match("/MSIE/", $_SERVER["HTTP_USER_AGENT"]))) { header('Pragma: no-cache'); } header('Content-Type: ' . $attachmentInfo['file_type']); header('Content-Length: ' . $attachmentInfo['file_size']); header("Content-Disposition: inline; filename=\"{$attachmentInfo['file_name']}\""); header("Content-Description: Download Data"); echo $content; exit; } } } $smarty = new TLSmarty(); $smarty->assign('gui', $args); $smarty->display('attachment404.tpl'); /** * @return object returns the arguments for the page */ function init_args() { //the id (attachments.id) of the attachment to be downloaded $iParams = array("id" => array(tlInputParameter::INT_N), 'skipCheck' => array(tlInputParameter::INT_N)); $args = new stdClass(); G_PARAMS($iParams, $args); return $args; } /** * @param $db resource the database connection handle * @param $user the current active user
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; }
checkRights($db, $_SESSION['currentUser'], $args); $msg = ""; if ($args->bug_id != "") { $msg = lang_get("error_wrong_BugID_format"); if ($g_bugInterface->checkBugID($args->bug_id)) { $msg = lang_get("error_bug_does_not_exist_on_bts"); if ($g_bugInterface->checkBugID_existence($args->bug_id)) { if (write_execution_bug($db, $args->exec_id, $args->bug_id)) { $msg = lang_get("bug_added"); logAuditEvent(TLS("audit_executionbug_added", $args->bug_id), "CREATE", $args->exec_id, "executions"); } } } } $smarty = new TLSmarty(); $smarty->assign('bugIDMaxLength', $g_bugInterface->getBugIDMaxLength()); $smarty->assign('bts_url', $g_bugInterface->getEnterBugURL()); $smarty->assign('msg', $msg); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * * @return object returns the arguments of the page */ function init_args($bugInterface) { $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("POST", tlInputParameter::STRING_N, 0, $bugInterface->getBugIDMaxLength())); $args = new stdClass(); I_PARAMS($iParams, $args); // BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST);
$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 in this new hash prefix on key is removed.
$user = new tlUser($args->user_id); $user->readFromDB($db); $passwordSendMethod = config_get('password_reset_send_method'); $gui->op = createNewPassword($db, $args, $user, $passwordSendMethod); break; case "create": default: $highlight->create_user = 1; $user = new tlUser(); break; } $gui->op->operation = $actionOperation[$args->doAction]; $roles = tlRole::getAll($db, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); unset($roles[TL_ROLES_UNDEFINED]); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('highlight', $highlight); $smarty->assign('operation', $gui->op->operation); $smarty->assign('user_feedback', $gui->op->user_feedback); $smarty->assign('external_password_mgmt', tlUser::isPasswordMgtExternal($user->authentication)); $smarty->assign('mgt_view_events', $_SESSION['currentUser']->hasRight($db, "mgt_view_events")); $smarty->assign('grants', getGrantsForUserMgmt($db, $_SESSION['currentUser'])); $smarty->assign('optRights', $roles); $smarty->assign('userData', $user); renderGui($smarty, $args, $templateCfg); /** * * */ function init_args() {
/** * 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); }
$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']; if (is_null($args->format)) {
$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(); $cerbero->args->tproject_id = $args->tproject_id;
$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; }
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': case 'disableRequirements':
**/ 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; } // 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);