Skip to content

Commit

Permalink
Merge b31ba2f into 8f692a6
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheemazmalmmd committed Feb 20, 2020
2 parents 8f692a6 + b31ba2f commit 6a5c591
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/unifiedreport/agent/reportStatic.php
Expand Up @@ -173,6 +173,7 @@ function assessmentSummaryTable(Section $section, $otherStatement)
$cellRowContinue = array("vMerge" => "continue");
$cellColSpan = array("gridSpan" => 4);
$cellColSpan2 = array("gridSpan" => 3);
$cellColSpan3 = array("gridSpan" => 2, "valign" => "center");

$rowWidth = 200;
$rowWidth2 = 300;
Expand Down Expand Up @@ -243,8 +244,13 @@ function assessmentSummaryTable(Section $section, $otherStatement)
$cell = $table->addCell($cellFirstLen)->addText(htmlspecialchars(" General Risks (optional)"), $leftColStyle, "pStyle");
$generalRisks = str_replace("\n", "<w:br/>", htmlspecialchars($otherStatement["ri_ga_risk"], ENT_DISALLOWED));
$cell = $table->addCell($cellLen)->addText($generalRisks, $rightColStyleBlue, "pStyle");
if ($otherStatement["includeDNU"]) {
$table->addRow($rowWidth);
$cell = $table->addCell($cellFirstLen, $cellColSpan3);
}

$section->addTextBreak();
return $cell;
}


Expand Down
9 changes: 8 additions & 1 deletion src/unifiedreport/agent/unifiedreport.php
Expand Up @@ -298,6 +298,7 @@ function processUploadId($uploadId)

$otherStatement = $this->otherGetter->getReportData($uploadId);
$this->heartbeat(empty($otherStatement) ? 0 : count($otherStatement));
$otherStatement['includeDNU'] = (count($licensesDNU["statements"]) > 0) ? true : false;

$contents = array(
"licenses" => $licenses,
Expand Down Expand Up @@ -702,7 +703,7 @@ private function writeReport($contents, $uploadId, $groupId, $userId)
$contents['licensesHist']['statements'], $contents['otherStatement'], $timestamp, $groupName, $packageUri);

/* Assessment summery table */
$reportStaticSection->assessmentSummaryTable($section, $contents['otherStatement']);
$bookMarkCell = $reportStaticSection->assessmentSummaryTable($section, $contents['otherStatement']);

/* Todoinfo table */
$reportStaticSection->todoTable($section);
Expand Down Expand Up @@ -791,6 +792,12 @@ private function writeReport($contents, $uploadId, $groupId, $userId)

/* Display Do not use license files */
$heading = "Do not use Files";
if ($contents['otherStatement']['includeDNU']) {
// adding an internal bookmark
$columnStyleWithUnderline = array("size" => 11, "color" => "0000A0", 'underline' => 'single');
$section->addBookmark('DNUBookmark');
$bookMarkCell->addLink('DNUBookmark', htmlspecialchars(' NOTE: DO NOT USE files found! Please check Do not use files section', ENT_COMPAT, 'UTF-8'), $columnStyleWithUnderline, "pStyle", true);
}
$titleSubHeadingIrre = "(Path, Files, Licenses)";
$this->getRowsAndColumnsForIrre($section, $heading, $contents['licensesDNU']['statements'], $titleSubHeadingIrre);

Expand Down

0 comments on commit 6a5c591

Please sign in to comment.