$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() { $iParams = array("format" => array(tlInputParameter::INT_N), "tplan_id" => array(tlInputParameter::INT_N), "show_inactive_tplans" => array(tlInputParameter::CB_BOOL)); $args = new stdClass(); R_PARAMS($iParams, $args); if (is_null($args->format)) { $reports_formats = config_get('reports_formats'); $args->format = sizeof($reports_formats) ? key($reports_formats) : null; }
// get navigation data $gui->menuItems = array(); if ($gui->do_report['status_ok']) { // create a list or reports $context = new stdClass(); $context->tproject_id = $args->tproject_id; $context->tplan_id = $args->tplan_id; $tplan_mgr = new testplan($db); $dmy = $tplan_mgr->get_by_id($context->tplan_id); unset($tplan_mgr); $context->apikey = $dmy['api_key']; $context->imgSet = $smarty->getImages(); $gui->menuItems = $reports_mgr->get_list_reports($context, $gui->btsEnabled, $args->optReqs, $tlCfg->reports_formats[$args->format]); } $gui->selectedReportType = $args->format; $gui->reportTypes = localize_array($tlCfg->reports_formats); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /** * * */ function init_args() { $iParams = array("format" => array(tlInputParameter::INT_N), "tplan_id" => array(tlInputParameter::INT_N), "show_inactive_tplans" => array(tlInputParameter::CB_BOOL)); $args = new stdClass(); R_PARAMS($iParams, $args); if (is_null($args->format)) { $reports_formats = config_get('reports_formats'); $args->format = sizeof($reports_formats) ? key($reports_formats) : null; }