21 use \PhpOffice\PhpWord\Shared\Html;
22 use \PhpOffice\PhpWord\Style;
48 "borderColor" =>
"000000",
65 $text = $SysConf[
'SYSCONFIG'][
"ReportHeaderText"];
66 $headerStyle = array(
"color" =>
"009999",
"size" => 20,
"bold" =>
true);
67 $header = $section->addHeader();
68 $header->addText(htmlspecialchars($text), $headerStyle);
82 $commitId = $SysConf[
'BUILD'][
'COMMIT_HASH'];
83 $commitDate = $SysConf[
'BUILD'][
'COMMIT_DATE'];
84 $styleTable = array(
'borderSize'=>10,
'borderColor'=>
'FFFFFF' );
85 $styleFirstRow = array(
'borderTopSize'=>10,
'borderTopColor'=>
'000000');
86 $phpWord->addTableStyle(
'footerTableStyle', $styleTable, $styleFirstRow);
87 $footerStyle = array(
"color" =>
"000000",
"size" => 9,
"bold" =>
true);
88 $footerTime =
"Gen Date: ".date(
"Y/m/d H:i:s T", $this->timeStamp);
89 $footerCopyright = $otherStatement[
'ri_footer'];
90 $footerSpace = str_repeat(
" ", 7);
91 $footerPageNo =
"Page {PAGE} of {NUMPAGES}";
92 $footer = $section->addFooter();
93 $table = $footer->addTable(
"footerTableStyle");
94 $table->addRow(200, $styleFirstRow);
95 $table->addCell(15000,$styleFirstRow)->addPreserveText(htmlspecialchars(
"$footerCopyright " 96 .
"$footerSpace $footerTime $footerSpace FOSSology Ver:#$commitId-$commitDate $footerSpace $footerPageNo"), $footerStyle);
106 $thColor = array(
"bgColor" =>
"E0E0E0");
107 $thText = array(
"size" => 12,
"bold" =>
true);
110 $cellFirstLen = 2000;
111 $cellSecondLen = 4500;
112 $cellThirdLen = 9000;
114 $heading =
"Clearing Protocol Change Log";
115 $section->addTitle(htmlspecialchars($heading), 2);
117 $table = $section->addTable($this->tablestyle);
119 $table->addRow($rowWidth);
120 $cell = $table->addCell($cellFirstLen, $thColor)->addText(htmlspecialchars(
"Last Update"), $thText);
121 $cell = $table->addCell($cellSecondLen, $thColor)->addText(htmlspecialchars(
"Responsible"), $thText);
122 $cell = $table->addCell($cellThirdLen, $thColor)->addText(htmlspecialchars(
"Comments"), $thText);
124 $table->addRow($rowWidth1);
125 $cell = $table->addCell($cellFirstLen);
126 $cell = $table->addCell($cellSecondLen);
127 $cell = $table->addCell($cellThirdLen);
129 $section->addTextBreak();
141 $rightColStyleBlackWithItalic = array(
"size" => 11,
"color" =>
"000000",
"italic" =>
true);
143 $textrun = $cell->addTextRun();
144 if (!strcmp($value,
'checked')) {
145 $textrun->addFormField(
'checkbox')->setValue(
true);
147 $textrun->addFormField(
'checkbox');
149 $textrun->addText($text, $rightColStyleBlackWithItalic,
"pStyle");
160 $heading =
"Assessment Summary";
161 $infoText =
"The following table only contains significant obligations, " 162 .
"restrictions & risks for a quick overview – all obligations, " 163 .
"restrictions & risks according to Section 3 must be considered.";
165 $thColor = array(
"bgColor" =>
"E0E0E0");
166 $infoTextStyle = array(
"size" => 10,
"color" =>
"000000");
167 $leftColStyle = array(
"size" => 11,
"color" =>
"000000",
"bold" =>
true);
168 $firstRowStyle1 = array(
"size" => 10,
"bold" =>
true);
169 $rightColStyleBlue = array(
"size" => 11,
"color" =>
"0000A0",
"italic" =>
true);
170 $rightColStyleBlack = array(
"size" => 11,
"color" =>
"000000");
172 $cellRowSpan = array(
"vMerge" =>
"restart",
"valign" =>
"top");
173 $cellRowContinue = array(
"vMerge" =>
"continue");
174 $cellColSpan = array(
"gridSpan" => 4);
175 $cellColSpan2 = array(
"gridSpan" => 3);
176 $cellColSpan3 = array(
"gridSpan" => 2,
"valign" =>
"center");
180 $cellFirstLen = 4300;
181 $cellSecondLen = 4300;
182 $cellThirdLen = 2300;
183 $cellFourthLen = 2300;
184 $cellFifthLen = 2300;
187 $getCheckboxList = explode(
',', $otherStatement[
'ri_ga_checkbox_selection']);
189 $section->addTitle(htmlspecialchars($heading), 2);
190 $section->addText(htmlspecialchars($infoText), $infoTextStyle);
192 $table = $section->addTable($this->tablestyle);
194 $table->addRow($rowWidth);
195 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" General assessment"), $leftColStyle,
"pStyle");
196 $generalAssessment = str_replace(
"\n",
"<w:br/>", htmlspecialchars($otherStatement[
"ri_general_assesment"], ENT_DISALLOWED));
197 $table->addCell($cellLen)->addText($generalAssessment, $rightColStyleBlue,
"pStyle");
199 $table->addRow($rowWidth);
200 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" "), $leftColStyle,
"pStyle");
201 $table->addCell($cellLen)->addText(htmlspecialchars(
" "), $rightColStyleBlue,
"pStyle");
203 $nocriticalfiles =
" no critical files found, source code and binaries can be used as is";
204 $criticalfiles =
" critical files found, source code needs to be adapted and binaries possibly re-built";
205 $table->addRow($rowWidth);
206 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" Source / binary integration notes"), $leftColStyle,
"pStyle");
207 $cell = $table->addCell($cellLen);
211 $nodependenciesfound =
" no dependencies found, neither in source code nor in binaries";
212 $dependenciesfoundinsourcecode =
" dependencies found in source code (see obligations)";
213 $dependenciesfoundinbinaries =
" dependencies found in binaries (see obligations)";
214 $table->addRow($rowWidth);
215 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" Dependency notes"), $leftColStyle,
"pStyle");
216 $cell = $table->addCell($cellLen);
217 $this->
addCheckBoxText($cell, $getCheckboxList[2], $nodependenciesfound);
218 $this->
addCheckBoxText($cell, $getCheckboxList[3], $dependenciesfoundinsourcecode);
219 $this->
addCheckBoxText($cell, $getCheckboxList[4], $dependenciesfoundinbinaries);
221 $noexportrestrictionsfound =
" no export restrictions found";
222 $exportrestrictionsfound =
" export restrictions found (see obligations)";
223 $table->addRow($rowWidth);
224 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" Export restrictions by copyright owner"), $leftColStyle,
"pStyle");
225 $cell = $table->addCell($cellLen);
226 $this->
addCheckBoxText($cell, $getCheckboxList[5], $noexportrestrictionsfound);
227 $this->
addCheckBoxText($cell, $getCheckboxList[6], $exportrestrictionsfound);
229 $norestrictionsforusefound =
" no restrictions for use found";
230 $restrictionsforusefound =
" restrictions for use found (see obligations)";
231 $table->addRow($rowWidth);
232 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" Restrictions for use (e.g. not for Nuclear Power) by copyright owner"),
233 $leftColStyle,
"pStyle");
234 $cell = $table->addCell($cellLen);
235 $this->
addCheckBoxText($cell, $getCheckboxList[7], $norestrictionsforusefound);
236 $this->
addCheckBoxText($cell, $getCheckboxList[8], $restrictionsforusefound);
238 $table->addRow($rowWidth,
"pStyle");
239 $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" Additional notes"), $leftColStyle,
"pStyle");
240 $additionalNotes = str_replace(
"\n",
"<w:br/>", htmlspecialchars($otherStatement[
"ri_ga_additional"], ENT_DISALLOWED));
241 $cell = $table->addCell($cellLen)->addText($additionalNotes, $rightColStyleBlue,
"pStyle");
243 $table->addRow($rowWidth);
244 $cell = $table->addCell($cellFirstLen)->addText(htmlspecialchars(
" General Risks (optional)"), $leftColStyle,
"pStyle");
245 $generalRisks = str_replace(
"\n",
"<w:br/>", htmlspecialchars($otherStatement[
"ri_ga_risk"], ENT_DISALLOWED));
246 $cell = $table->addCell($cellLen)->addText($generalRisks, $rightColStyleBlue,
"pStyle");
247 if ($otherStatement[
"includeDNU"]) {
248 $table->addRow($rowWidth);
249 $cell = $table->addCell($cellFirstLen, $cellColSpan3);
252 $section->addTextBreak();
264 $texts = explode(PHP_EOL, $text);
280 $rowStyle = array(
"bgColor" =>
"E0E0E0",
"spaceBefore" => 0,
"spaceAfter" => 0,
"spacing" => 0);
281 $secondRowColorStyle = array(
"color" =>
"008000");
282 $rowTextStyleLeft = array(
"size" => 10,
"bold" =>
true);
283 $rowTextStyleRight = array(
"size" => 10,
"bold" =>
false);
284 $rowTextStyleRightBold = array(
"size" => 10,
"bold" =>
true);
286 $heading =
"Required license compliance tasks";
287 $subHeading =
"Common obligations, restrictions and risks:";
288 $subHeadingInfoText =
" There is a list of common rules which was defined" 289 .
" to simplify the To-Dos for development and distribution. The following" 290 .
" list contains rules for development, and distribution which must always be followed!";
293 $secondColLen = 15000;
295 $section->addTitle(htmlspecialchars($heading), 2);
296 $section->addTitle(htmlspecialchars($subHeading), 3);
297 $section->addText(htmlspecialchars($subHeadingInfoText), $rowTextStyleRight);
303 $r1c2 =
"Documentation of license conditions and copyright notices in" 304 .
" product documentation (License Notice File / README_OSS) is provided by this component clearing report:";
305 $r2c2 =
"Additional Common Obligations:";
306 $r2c21 =
"Need to be ensured by the distributing party:";
307 $r3c2 =
"Obligations and risk assessment regarding distribution";
309 $table = $section->addTable($this->tablestyle);
311 $table->addRow($rowWidth);
312 $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r1c1), $rowTextStyleLeft,
"pStyle");
313 $cell = $table->addCell($secondColLen, $rowStyle)->addText(htmlspecialchars($r1c2), $rowTextStyleRightBold,
"pStyle");
315 $table->addRow($rowWidth);
316 $cell = $table->addCell($firstColLen);
317 $cell = $table->addCell($secondColLen);
318 if (empty($textCommonObligation)) {
319 $cell->addText(htmlspecialchars($textCommonObligation), $secondRowColorStyle,
"pStyle");
321 foreach ($textCommonObligation as $text) {
322 $cell->addText(htmlspecialchars($text), $secondRowColorStyle,
"pStyle");
326 $table->addRow($rowWidth);
327 $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r2c1), $rowTextStyleLeft,
"pStyle");
328 $cell = $table->addCell($secondColLen, $rowStyle);
329 $cell->addText(htmlspecialchars($r2c2), $rowTextStyleRightBold,
"pStyle");
330 $cell->addText(htmlspecialchars($r2c21), $rowTextStyleRightBold,
"pStyle");
332 $table->addRow($rowWidth);
333 $cell = $table->addCell($firstColLen);
334 $cell = $table->addCell($secondColLen);
335 if (empty($textAdditionalObligation)) {
336 $cell->addText(htmlspecialchars($textAdditionalObligation), null,
"pStyle");
338 foreach ($textAdditionalObligation as $text) {
339 $cell->addText(htmlspecialchars($text), null,
"pStyle");
342 $table->addRow($rowWidth);
343 $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r3c1), $rowTextStyleLeft,
"pStyle");
344 $cell = $table->addCell($secondColLen, $rowStyle)->addText(htmlspecialchars($r3c2), $rowTextStyleRightBold,
"pStyle");
346 $table->addRow($rowWidth);
347 $cell = $table->addCell($firstColLen);
348 $cell = $table->addCell($secondColLen);
349 if (empty($textObligationAndRisk)) {
350 $cell->addText(htmlspecialchars($textObligationAndRisk), $secondRowColorStyle,
"pStyle");
352 foreach ($textObligationAndRisk as $text) {
353 $cell->addText(htmlspecialchars($text), $secondRowColorStyle,
"pStyle");
357 $section->addTextBreak();
368 $firstRowStyle = array(
"bgColor" =>
"D2D0CE");
369 $firstRowTextStyle = array(
"size" => 11,
"bold" =>
true);
370 $secondRowTextStyle1 = array(
"size" => 11,
"bold" =>
false);
371 $secondRowTextStyle2 = array(
"size" => 10,
"bold" =>
false);
372 $secondRowTextStyle2Bold = array(
"size" => 10,
"bold" =>
true);
373 $firstColStyle = array (
"size" => 11 ,
"bold"=>
true,
"bgcolor" =>
"FFFFC2");
374 $secondColStyle = array (
"size" => 11 ,
"bold"=>
true,
"bgcolor"=>
"E0FFFF");
375 $subHeading =
" Additional obligations, restrictions & risks beyond common rules";
376 $subHeadingInfoText1 =
"This chapter contains all obligations in addition" 377 .
" to “common obligations, restrictions and risks” (common rules) of" 378 .
" included OSS licenses (need to get added manually during component clearing process).";
380 $cellRowSpan = array(
"vMerge" =>
"restart",
"valign" =>
"top",
"size" => 11 ,
"bold"=>
true,
"bgcolor" =>
"FFFFC2");
381 $cellRowContinue = array(
"vMerge" =>
"continue",
"size" => 11 ,
"bold"=>
true,
"bgcolor" =>
"FFFFC2");
383 $section->addTitle(htmlspecialchars($subHeading), 3);
384 $section->addText(htmlspecialchars($subHeadingInfoText1));
388 $secondColLen = 2500;
391 $table = $section->addTable($this->tablestyle);
393 $table->addRow($rowWidth);
394 $cell = $table->addCell($firstColLen, $firstRowStyle)->addText(htmlspecialchars(
"Obligation"), $firstRowTextStyle);
395 $cell = $table->addCell($secondColLen, $firstRowStyle)->addText(htmlspecialchars(
"License"), $firstRowTextStyle);
396 $cell = $table->addCell($thirdColLen,
397 $firstRowStyle)->addText(htmlspecialchars(
"License section reference and short Description"), $firstRowTextStyle);
399 if (!empty($obligations)) {
400 foreach ($obligations as $obligation) {
401 $table->addRow($rowWidth);
402 $table->addCell($firstColLen,$firstColStyle)->addText(htmlspecialchars($obligation[
"topic"]), $firstRowTextStyle);
403 $table->addCell($secondColLen,$secondColStyle)->addText(htmlspecialchars(implode(
",",$obligation[
"license"])));
404 $obligationText = str_replace(
"\n",
"<w:br/>", htmlspecialchars($obligation[
"text"], ENT_DISALLOWED));
405 $table->addCell($thirdColLen)->addText($obligationText);
408 $table->addRow($rowWidth);
409 $table->addCell($firstColLen,$firstColStyle)->addText(htmlspecialchars($key), $firstRowTextStyle);
410 $table->addCell($secondColLen,$secondColStyle);
411 $table->addCell($thirdColLen);
413 $section->addTextBreak();
426 $section->addTitle(htmlspecialchars(
"$heading"), 2);
427 $section->addText($titleSubHeadingObli, $this->subHeadingStyle);
428 $firstRowStyle = array(
"size" => 12,
"bold" =>
false);
432 $secondColLen = 10000;
434 $table = $section->addTable($this->tablestyle);
436 if (!empty($obligations)) {
437 foreach ($obligations as $obligation) {
438 $table->addRow($rowWidth);
439 $table->addCell($secondColLen,$firstColStyle)->addText(htmlspecialchars(implode(
",",$obligation[
"license"])));
440 $table->addCell($firstColLen,$firstColStyle)->addText(htmlspecialchars($obligation[
"topic"]));
443 if (!empty($whiteLists)) {
444 foreach ($whiteLists as $whiteList) {
445 $table->addRow($rowWidth);
446 $table->addCell($firstColLen,$firstColStyle)->addText(htmlspecialchars($whiteList));
447 $table->addCell($secondColLen,$firstColStyle)->addText(
"");
450 $section->addTextBreak();
459 $heading =
"Basis for Clearing Report";
460 $section->addTitle(htmlspecialchars($heading), 2);
462 $table = $section->addTable($this->tablestyle);
464 $cellRowContinue = array(
"vMerge" =>
"continue");
465 $firstRowStyle = array(
"size" => 12,
"bold" =>
true);
466 $rowTextStyle = array(
"size" => 11,
"bold" =>
false);
468 $cellRowSpan = array(
"vMerge" =>
"restart",
"valign" =>
"top");
469 $cellColSpan = array(
"gridSpan" => 2,
"valign" =>
"center");
474 $secondColLen = 7500;
477 $table->addRow($rowWidth);
478 $cell = $table->addCell($firstColLen, $cellRowSpan)->addText(htmlspecialchars(
"Preparation basis for OSS"), $firstRowStyle);
479 $cell = $table->addCell($secondColLen, $cellColSpan);
480 $cell->addCheckBox(
"chkBox1", htmlspecialchars(
"Legally relevant Steps from analysis to clearing report"), $rowTextStyle);
481 $cell->addCheckBox(
"chkBox2", htmlspecialchars(
"no"), $rowTextStyle);
482 $cell = $table->addCell($thirdColLen);
484 $table->addRow($rowWidth);
485 $cell = $table->addCell($firstColLen, $cellRowContinue);
486 $cell = $table->addCell($secondColLen, $cellColSpan);
487 $cell->addCheckBox(
"checkBox1",
488 htmlspecialchars(
"According to “Common Principles for Open Source License Interpretation” "), $rowTextStyle);
489 $cell->addCheckBox(
"checkBox2", htmlspecialchars(
"no"), $rowTextStyle);
490 $cell = $table->addCell($thirdColLen);
492 $table->addRow($rowWidth);
493 $cell = $table->addCell($firstColLen, $cellRowSpan)->addText(htmlspecialchars(
"OSS Source Code"), $firstRowStyle);
494 $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars(
"Link to Upload page of component:"), $rowTextStyle);
495 $cell = $table->addCell($secondColLen, $cellColSpan)->addText(
"");
497 $table->addRow($rowWidth);
498 $cell = $table->addCell($firstColLen, $cellRowContinue);
499 $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars(
"MD5 hash value of source code:"), $rowTextStyle);
500 $cell = $table->addCell($secondColLen, $cellColSpan)->addText(htmlspecialchars(
"n/a"), $rowTextStyle);
502 $table->addRow($rowWidth);
503 $cell = $table->addCell($firstColLen)->addText(htmlspecialchars(
"Result of LCR editor" ), $firstRowStyle);
504 $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars(
505 "Embedded .xml file which can be checked by the LCR Editor is embedded here:" 507 $cell = $table->addCell($secondColLen, $cellColSpan)->addText(htmlspecialchars(
"n/a"), $rowTextStyle);
509 $section->addTextBreak();
519 $styleFont = array(
'bold'=>
true,
'size'=>10,
'name'=>
'Arial');
521 $section->addTitle(htmlspecialchars($heading), 2);
522 $text =
"In this section the files and their licenses can be listed which" 523 .
" do not “go” into the delivered “binary”, e.g. /test or /example.";
524 $section->addText($text, $styleFont);
525 $section->addTextBreak();
532 function notes(Section $section, $heading, $subHeading)
535 $secondColLen = 8000;
537 $styleFont = array(
'bold'=>
true,
'size'=>10,
'name'=>
'Arial',
'underline' =>
'single');
538 $styleFont1 = array(
'bold'=>
false,
'size'=>10,
'name'=>
'Arial',
'underline' =>
'single');
539 $styleFont2 = array(
'bold'=>
false,
'size'=>10,
'name'=>
'Arial');
541 $section->addTitle(htmlspecialchars(
"$heading"), 2);
542 $section->addText(
"Only such source code of this component may be used-");
543 $section->addListItem(
"which has been checked by and obtained via the Clearing Center or",
544 1,
"Arial", PhpOffice\PhpWord\Style\ListItem::TYPE_SQUARE_FILLED);
545 $section->addListItem(
"which has been submitted to Clearing Support to be checked",
546 1 ,
"Arial", PhpOffice\PhpWord\Style\ListItem::TYPE_SQUARE_FILLED);
548 $textrun = $section->createTextRun();
549 $textrun->addText(
"Other source code or binaries from the Internet ", $styleFont2);
550 $textrun->addText(
"must not be ", $styleFont);
551 $textrun->addText(
"used.", $styleFont1);
552 $section->addText(
"");
553 $section->addText(
"The following chapters are generated by the source code scanner.");
555 $section->addTextBreak();
556 $section->addTitle(htmlspecialchars($subHeading), 3);
basicForClearingReport(Section $section)
Generate basis for clearing report section.
todoTable(Section $section)
Generate todo table.
reportHeader(Section $section)
Generates report header from Report Header Text
notes(Section $section, $heading, $subHeading)
Generate notes.
reportFooter($phpWord, Section $section, $otherStatement)
Generates report footer.
todoObliTable(Section $section, $obligations)
Generate todo table for obligations.
clearingProtocolChangeLogTable(Section $section)
Generates clearing protocol change log table.
assessmentSummaryTable(Section $section, $otherStatement)
Generate assessment summary table.
Handles static part of report.
reArrangeObligationText($text)
Get obligation text and re arrange them.
getNonFunctionalLicenses(Section $section, $heading)
addCheckBoxText($cell, $value, $text)
Check checkbox value(checked/unchecked) and append text.
allLicensesWithAndWithoutObligations(Section $section, $heading, $obligations, $whiteLists, $titleSubHeadingObli)
Generate table with all licenses.