$gui->tproject_id = $args->tproject_id; $gui->checked_show_inactive_tplans = $args->checked_show_inactive_tplans; $btsEnabled = config_get('interface_bugs') != 'NO'; $reports_mgr = new tlReports($db, $gui->tplan_id); // ----------------------------------------------------------------------------- // Do some checks to understand if reports make sense // Check if there are linked test cases to the choosen test plan. $tc4tp_count = $reports_mgr->get_count_testcase4testplan(); tLog('TC in TP count = ' . $tc4tp_count); if ($tc4tp_count == 0) { // Test plan without test cases $gui->do_report['status_ok'] = 0; $gui->do_report['msg'] = lang_get('report_tplan_has_no_tcases'); } // Build qty $build_count = $reports_mgr->get_count_builds(); tLog('Active Builds count = ' . $build_count); if ($build_count == 0) { // Test plan without builds can have execution data $gui->do_report['status_ok'] = 0; $gui->do_report['msg'] = lang_get('report_tplan_has_no_build'); } // ----------------------------------------------------------------------------- // get navigation data $gui->menuItems = array(); $gui->tplans = array(); if ($gui->do_report['status_ok']) { // create a list or reports $gui->menuItems = $reports_mgr->get_list_reports($btsEnabled, $args->optReqs, $tlCfg->reports_formats[$args->format]); } // BUGID 3370