|
@@ -60,40 +60,40 @@ $slide = $presentation->createSlide();
|
|
|
|
|
|
|
|
// Title
|
|
// Title
|
|
|
$shape = $slide->createRichTextShape()
|
|
$shape = $slide->createRichTextShape()
|
|
|
- ->setHeight(60)->setWidth(940)
|
|
|
|
|
|
|
+ ->setHeight(60)->setWidth(900)
|
|
|
->setOffsetX(30)->setOffsetY(10);
|
|
->setOffsetX(30)->setOffsetY(10);
|
|
|
$run = $shape->createTextRun("Summary");
|
|
$run = $shape->createTextRun("Summary");
|
|
|
$run->getFont()->setBold(true)->setSize(24);
|
|
$run->getFont()->setBold(true)->setSize(24);
|
|
|
|
|
|
|
|
// Date range
|
|
// Date range
|
|
|
$shape = $slide->createRichTextShape()
|
|
$shape = $slide->createRichTextShape()
|
|
|
- ->setHeight(60)->setWidth(940)
|
|
|
|
|
|
|
+ ->setHeight(60)->setWidth(900)
|
|
|
->setOffsetX(30)->setOffsetY(70);
|
|
->setOffsetX(30)->setOffsetY(70);
|
|
|
$run = $shape->createTextRun($date_range_label);
|
|
$run = $shape->createTextRun($date_range_label);
|
|
|
$run->getFont()->setBold(true)->setSize(24);
|
|
$run->getFont()->setBold(true)->setSize(24);
|
|
|
|
|
|
|
|
-// Test count
|
|
|
|
|
-$shape = $slide->createRichTextShape()
|
|
|
|
|
- ->setHeight(60)->setWidth(940)
|
|
|
|
|
- ->setOffsetX(30)->setOffsetY(130);
|
|
|
|
|
-$run = $shape->createTextRun("Test Count: {$total_data->testCount}");
|
|
|
|
|
-$run->getFont()->setBold(true)->setSize(24);
|
|
|
|
|
|
|
+// Test Count
|
|
|
|
|
+$count_text = "Test Count: {$total_data->testCount}";
|
|
|
|
|
|
|
|
// Pass/Fail count
|
|
// Pass/Fail count
|
|
|
if(isset($total_data->passCount)) {
|
|
if(isset($total_data->passCount)) {
|
|
|
-
|
|
|
|
|
$pass_percentage = 0;
|
|
$pass_percentage = 0;
|
|
|
|
|
+ $fail_percentage = 0;
|
|
|
if($total_data->testCount > 0) {
|
|
if($total_data->testCount > 0) {
|
|
|
$pass_percentage = number_format(($total_data->passCount * 100) / $total_data->testCount, 2);
|
|
$pass_percentage = number_format(($total_data->passCount * 100) / $total_data->testCount, 2);
|
|
|
|
|
+ $fail_percentage = 100 - $pass_percentage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $shape = $slide->createRichTextShape()
|
|
|
|
|
- ->setHeight(60)->setWidth(940)
|
|
|
|
|
- ->setOffsetX(30)->setOffsetY(190);
|
|
|
|
|
- $run = $shape->createTextRun("Pass/Fail Count: {$total_data->passCount} / {$total_data->failCount} ({$pass_percentage}%)");
|
|
|
|
|
- $run->getFont()->setBold(true)->setSize(24);
|
|
|
|
|
|
|
+ $count_text .= "\nPass Count: {$total_data->passCount} ({$pass_percentage}%)";
|
|
|
|
|
+ $count_text .= "\nFail Count: {$total_data->failCount} ({$fail_percentage}%)";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+$shape = $slide->createRichTextShape()
|
|
|
|
|
+ ->setHeight(60)->setWidth(900)
|
|
|
|
|
+ ->setOffsetX(30)->setOffsetY(130);
|
|
|
|
|
+$run = $shape->createTextRun($count_text);
|
|
|
|
|
+$run->getFont()->setBold(true)->setSize(16);
|
|
|
|
|
+
|
|
|
// Tests by stage
|
|
// Tests by stage
|
|
|
foreach($charts as $chart) {
|
|
foreach($charts as $chart) {
|
|
|
if(stripos($chart->getTitle(), "Tests by Stage") === false) continue;
|
|
if(stripos($chart->getTitle(), "Tests by Stage") === false) continue;
|
|
@@ -108,6 +108,7 @@ foreach($charts as $chart) {
|
|
|
|
|
|
|
|
$names = [];
|
|
$names = [];
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
$charts_b64 = http::value("charts_b64");
|
|
$charts_b64 = http::value("charts_b64");
|
|
|
foreach($charts_b64 as $index => $b64) {
|
|
foreach($charts_b64 as $index => $b64) {
|
|
|
|
|
|
|
@@ -216,16 +217,19 @@ foreach([0, 1] as $mode) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
|
|
|
|
|
if($action == "export-pptx") {
|
|
if($action == "export-pptx") {
|
|
|
header("Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation");
|
|
header("Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation");
|
|
|
|
|
+ http::setDownloadHeaders("report.pptx");
|
|
|
$pptx_writer = IOFactory::createWriter($presentation, "PowerPoint2007");
|
|
$pptx_writer = IOFactory::createWriter($presentation, "PowerPoint2007");
|
|
|
$pptx_writer->save("php://output");
|
|
$pptx_writer->save("php://output");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if($action == "export-odp") {
|
|
if($action == "export-odp") {
|
|
|
header("Content-Type: application/vnd.oasis.opendocument.presentation");
|
|
header("Content-Type: application/vnd.oasis.opendocument.presentation");
|
|
|
|
|
+ http::setDownloadHeaders("report.odp");
|
|
|
$odp_writer = IOFactory::createWriter($presentation, "ODPresentation");
|
|
$odp_writer = IOFactory::createWriter($presentation, "ODPresentation");
|
|
|
$odp_writer->save("php://output");
|
|
$odp_writer->save("php://output");
|
|
|
}
|
|
}
|