/** * * */ 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); }
} break; } } } } $docText .= renderEOF(); // Needed for platform feature if ($printingOptions['toc']) { $printingOptions['tocCode'] .= '</div>'; $topText .= $printingOptions['tocCode']; } $docText = $topText . $docText; // add application header to HTTP if ($args->format == FORMAT_ODT || $args->format == FORMAT_MSWORD) { flushHttpHeader($args->format, $doc_info->type); } // send out the data echo $docText; /** * Process input data * **/ 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), "build_id" => array(tlInputParameter::INT_N), "docTestPlanId" => array(tlInputParameter::INT_N), "id" => array(tlInputParameter::INT_N), "type" => array(tlInputParameter::STRING_N, 0, 20), "format" => array(tlInputParameter::INT_N), "level" => array(tlInputParameter::STRING_N, 0, 32)); $args = new stdClass(); $pParams = R_PARAMS($iParams, $args); // really UGLY HACK $typeDomain = array('test_plan' => 'testplan', 'test_report' => 'testreport'); $args->type = isset($typeDomain[$args->type]) ? $typeDomain[$args->type] : $args->type;