FOSSology  4.7.1
Open Source License Compliance by Open Source Software
reportStatic.php
1 <?php
2 /*
3  Author: Shaheem Azmal, anupam.ghosh@siemens.com
4  SPDX-FileCopyrightText: © 2017 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 use PhpOffice\PhpWord\Element\Section;
10 use PhpOffice\PhpWord\Element\TextRun;
11 use PhpOffice\PhpWord\PhpWord;
12 use PhpOffice\PhpWord\Element\Cell;
13 use PhpOffice\PhpWord\SimpleType\JcTable;
14 use PhpOffice\PhpWord\Style\Table;
15 
21 {
25  private $timeStamp;
26 
30  private $subHeadingStyle = array("size" => 9,
31  "align" => "center",
32  "bold" => true
33  );
34 
38  private $tablestyle = array("borderSize" => 2,
39  "name" => "Arial",
40  "borderColor" => "000000",
41  "cellSpacing" => 5,
42  "alignment" => JcTable::START,
43  "layout" => Table::LAYOUT_FIXED
44  );
45 
50  private $firstColStyle = array (
51  "size" => 11 , "bold"=> true, "bgcolor" => "FFFFC2");
52 
57  private $secondColStyle = array (
58  "size" => 11 , "bold"=> true, "bgcolor"=> "E0FFFF");
59 
60  function __construct($timeStamp)
61  {
62  $this->timeStamp = $timeStamp ?: time();
63  }
64 
65 
70  function reportHeader(Section $section)
71  {
72  global $SysConf;
73  $text = (array_key_exists('ReportHeaderText',$SysConf['SYSCONFIG'])) ? $SysConf['SYSCONFIG']["ReportHeaderText"] : '';
74  $headerStyle = array("color" => "009999", "size" => 20, "bold" => true);
75  $header = $section->addHeader();
76  $header->addText(htmlspecialchars($text), $headerStyle);
77  }
78 
79 
86  function reportFooter($phpWord, Section $section, $otherStatement)
87  {
88  global $SysConf;
89 
90  $commitId = $SysConf['BUILD']['COMMIT_HASH'];
91  $commitDate = $SysConf['BUILD']['COMMIT_DATE'];
92  $styleTable = array('borderSize'=>10, 'borderColor'=>'FFFFFF' );
93  $styleFirstRow = array('borderTopSize'=>10, 'borderTopColor'=>'000000');
94  $phpWord->addTableStyle('footerTableStyle', $styleTable, $styleFirstRow);
95  $footerStyle = array("color" => "000000", "size" => 9, "bold" => true);
96  $footerTime = "Gen Date: ".date("Y/m/d H:i:s T", $this->timeStamp);
97  $footerCopyright = $otherStatement['ri_footer'];
98  $footerSpace = str_repeat(" ", 7);
99  $footerPageNo = "Page {PAGE} of {NUMPAGES}";
100  $footer = $section->addFooter();
101  $table = $footer->addTable("footerTableStyle");
102  $table->addRow(200, $styleFirstRow);
103  // PhpWord 1.x sets noWrap by default; Word honours it in auto-layout tables
104  $table->addCell(15000, array_merge($styleFirstRow, array('noWrap' => false)))->addPreserveText(htmlspecialchars("$footerCopyright "
105  ."$footerSpace $footerTime $footerSpace FOSSology Ver:#$commitId-$commitDate $footerSpace $footerPageNo"), $footerStyle);
106  }
107 
108 
114  function clearingProtocolChangeLogTable(Section $section, $heading)
115  {
116  $thColor = array("bgColor" => "E0E0E0");
117  $thText = array("size" => 12, "bold" => true);
118  $rowWidth = 600;
119  $rowWidth1 = 200;
120  $cellFirstLen = 2000;
121  $cellSecondLen = 4500;
122  $cellThirdLen = 9000;
123 
124  $section->addTitle(htmlspecialchars($heading), 2);
125 
126  $table = $section->addTable($this->tablestyle);
127 
128  $table->addRow($rowWidth);
129  $cell = $table->addCell($cellFirstLen, $thColor)->addText(htmlspecialchars("Last Update"), $thText);
130  $cell = $table->addCell($cellSecondLen, $thColor)->addText(htmlspecialchars("Responsible"), $thText);
131  $cell = $table->addCell($cellThirdLen, $thColor)->addText(htmlspecialchars("Comments"), $thText);
132 
133  $table->addRow($rowWidth1);
134  $cell = $table->addCell($cellFirstLen);
135  $cell = $table->addCell($cellSecondLen);
136  $cell = $table->addCell($cellThirdLen);
137 
138  $section->addTextBreak();
139  }
140 
148  function addCheckBoxText($cell, $value, $text)
149  {
150  $rightColStyleBlackWithItalic = array("size" => 11, "color" => "000000","italic" => true);
151 
152  $textrun = $cell->addTextRun();
153  if (!strcmp($value,'checked')) {
154  $textrun->addFormField('checkbox')->setValue(true);
155  } else {
156  $textrun->addFormField('checkbox');
157  }
158  $textrun->addText($text, $rightColStyleBlackWithItalic, "pStyle");
159  return $textrun;
160  }
161 
162 
170  function assessmentSummaryTable(Section $section, $otherStatement, $heading)
171  {
172  $infoText = "The following table only contains significant obligations, "
173  ."restrictions & risks for a quick overview – all obligations, "
174  ."restrictions & risks according to Section 3 must be considered.";
175 
176  $thColor = array("bgColor" => "E0E0E0");
177  $infoTextStyle = array("size" => 10, "color" => "000000");
178  $leftColStyle = array("size" => 11, "color" => "000000","bold" => true);
179  $firstRowStyle1 = array("size" => 10, "bold" => true);
180  $rightColStyleBlue = array("size" => 11, "color" => "0000A0","italic" => true);
181  $rightColStyleBlack = array("size" => 11, "color" => "000000");
182 
183  $cellRowSpan = array("vMerge" => "restart", "valign" => "top");
184  $cellRowContinue = array("vMerge" => "continue");
185  $cellColSpan = array("gridSpan" => 4);
186  $cellColSpan2 = array("gridSpan" => 3);
187  $cellColSpan3 = array("gridSpan" => 2, "valign" => "center");
188 
189  $rowWidth = 200;
190  $rowWidth2 = 300;
191  $cellFirstLen = 4300;
192  $cellSecondLen = 4300;
193  $cellThirdLen = 2300;
194  $cellFourthLen = 2300;
195  $cellFifthLen = 2300;
196  $cellLen = 10000;
197 
198  $getCheckboxList = explode(',', $otherStatement['ri_ga_checkbox_selection']);
199 
200  $section->addTitle(htmlspecialchars($heading), 2);
201  $section->addText(htmlspecialchars($infoText), $infoTextStyle);
202 
203  $table = $section->addTable($this->tablestyle);
204 
205  $table->addRow($rowWidth);
206  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" General assessment"), $leftColStyle, "pStyle");
207  $generalAssessment = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_general_assesment"], ENT_DISALLOWED));
208  $generalAssessment = str_replace("\r", "", $generalAssessment);
209  $table->addCell($cellLen)->addText($generalAssessment, $rightColStyleBlue, "pStyle");
210 
211  $table->addRow($rowWidth);
212  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" "), $leftColStyle, "pStyle");
213  $table->addCell($cellLen)->addText(htmlspecialchars(" "), $rightColStyleBlue, "pStyle");
214 
215  $nocriticalfiles = " no critical files found, source code and binaries can be used as is";
216  $criticalfiles = " critical files found, source code needs to be adapted and binaries possibly re-built";
217  $table->addRow($rowWidth);
218  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" Source / binary integration notes"), $leftColStyle, "pStyle");
219  $cell = $table->addCell($cellLen);
220  $this->addCheckBoxText($cell, (array_key_exists(0,$getCheckboxList)) ? $getCheckboxList[0] : '', $nocriticalfiles);
221  $this->addCheckBoxText($cell, (array_key_exists(1,$getCheckboxList)) ? $getCheckboxList[1] : '', $criticalfiles);
222 
223  $nodependenciesfound = " no dependencies found, neither in source code nor in binaries";
224  $dependenciesfoundinsourcecode = " dependencies found in source code (see obligations)";
225  $dependenciesfoundinbinaries = " dependencies found in binaries (see obligations)";
226  $table->addRow($rowWidth);
227  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" Dependency notes"), $leftColStyle, "pStyle");
228  $cell = $table->addCell($cellLen);
229  $this->addCheckBoxText($cell, (array_key_exists(2,$getCheckboxList)) ? $getCheckboxList[2] : '', $nodependenciesfound);
230  $this->addCheckBoxText($cell, (array_key_exists(3,$getCheckboxList)) ? $getCheckboxList[3] : '', $dependenciesfoundinsourcecode);
231  $this->addCheckBoxText($cell, (array_key_exists(4,$getCheckboxList)) ? $getCheckboxList[4] : '', $dependenciesfoundinbinaries);
232  if ($otherStatement["ri_depnotes"] != 'NA' && !empty($otherStatement["ri_depnotes"])) {
233  $extraNotes = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_depnotes"], ENT_DISALLOWED));
234  $extraNotes = str_replace("\r", "", $extraNotes);
235  $cell->addText($extraNotes, $rightColStyleBlue, "pStyle");
236  }
237 
238  $noexportrestrictionsfound = " no export restrictions found";
239  $exportrestrictionsfound = " export restrictions found (see obligations)";
240  $table->addRow($rowWidth);
241  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" Export restrictions by copyright owner"), $leftColStyle, "pStyle");
242  $cell = $table->addCell($cellLen);
243  $this->addCheckBoxText($cell, (array_key_exists(5,$getCheckboxList)) ? $getCheckboxList[5] : '', $noexportrestrictionsfound);
244  $this->addCheckBoxText($cell, (array_key_exists(6,$getCheckboxList)) ? $getCheckboxList[6] : '', $exportrestrictionsfound);
245  if ($otherStatement["ri_exportnotes"] != 'NA' && !empty($otherStatement["ri_exportnotes"])) {
246  $extraNotes = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_exportnotes"], ENT_DISALLOWED));
247  $extraNotes = str_replace("\r", "", $extraNotes);
248  $cell->addText($extraNotes, $rightColStyleBlue, "pStyle");
249  }
250 
251  $norestrictionsforusefound = " no restrictions for use found";
252  $restrictionsforusefound = " restrictions for use found (see obligations)";
253  $table->addRow($rowWidth);
254  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" Restrictions for use (e.g. not for Nuclear Power) by copyright owner"),
255  $leftColStyle, "pStyle");
256  $cell = $table->addCell($cellLen);
257  $this->addCheckBoxText($cell, (array_key_exists(7,$getCheckboxList)) ? $getCheckboxList[7] : '', $norestrictionsforusefound);
258  $this->addCheckBoxText($cell, (array_key_exists(8,$getCheckboxList)) ? $getCheckboxList[8] : '', $restrictionsforusefound);
259  if ($otherStatement["ri_copyrightnotes"] != 'NA' && !empty($otherStatement["ri_copyrightnotes"])) {
260  $extraNotes = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_copyrightnotes"], ENT_DISALLOWED));
261  $extraNotes = str_replace("\r", "", $extraNotes);
262  $cell->addText($extraNotes, $rightColStyleBlue, "pStyle");
263  }
264 
265  $table->addRow($rowWidth, "pStyle");
266  $table->addCell($cellFirstLen)->addText(htmlspecialchars(" Additional notes"), $leftColStyle, "pStyle");
267  $additionalNotes = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_ga_additional"], ENT_DISALLOWED));
268  $additionalNotes = str_replace("\r", "", $additionalNotes);
269  $cell = $table->addCell($cellLen)->addText($additionalNotes, $rightColStyleBlue, "pStyle");
270 
271  $table->addRow($rowWidth);
272  $cell = $table->addCell($cellFirstLen)->addText(htmlspecialchars(" General Risks (optional)"), $leftColStyle, "pStyle");
273  $generalRisks = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($otherStatement["ri_ga_risk"], ENT_DISALLOWED));
274  $generalRisks = str_replace("\r", "", $generalRisks);
275  $cell = $table->addCell($cellLen)->addText($generalRisks, $rightColStyleBlue, "pStyle");
276  if ($otherStatement["includeDNU"]) {
277  $table->addRow($rowWidth);
278  $cell = $table->addCell($cellFirstLen, $cellColSpan3);
279  }
280  if ($otherStatement["includeNonFunctional"]) {
281  $table->addRow($rowWidth);
282  $cell = $table->addCell($cellFirstLen, $cellColSpan3);
283  }
284 
285  $section->addTextBreak();
286  return $cell;
287  }
288 
300  protected function arrangeObligationsText($obligationText, $table, $rowWidth, $firstColLen, $rowTextStyleLeft, $secondColLen, $rowTextStyleRight)
301  {
302  $jsonObligationText = json_decode($obligationText, true);
303  if (json_last_error() === JSON_ERROR_NONE) {
304  foreach ($jsonObligationText as $key => $value) {
305  $table->addRow($rowWidth);
306  $cell = $table->addCell($firstColLen)->addText(htmlspecialchars($key), $rowTextStyleLeft, "pStyle");
307  if (strpos($value, "\n") !== false) {
308  $cell = $table->addCell($secondColLen);
309  $value = explode("\n", $value);
310  foreach ($value as $value1) {
311  $value1 = str_replace("\r", "", $value1);
312  $cell->addText(htmlspecialchars($value1), $rowTextStyleRight, "pStyle");
313  }
314  } else {
315  $cell = $table->addCell($secondColLen)->addText(htmlspecialchars($value), $rowTextStyleRight, "pStyle");
316  }
317  }
318  } else {
319  $table->addRow($rowWidth);
320  $cell = $table->addCell($firstColLen);
321  if (strpos($obligationText, "\n") !== false) {
322  $cell = $table->addCell($secondColLen);
323  $obligationText = explode("\n", $obligationText);
324  foreach ($obligationText as $value) {
325  $value = str_replace("\r", "", $value);
326  $cell->addText(htmlspecialchars($value), $rowTextStyleRight, "pStyle");
327  }
328  } else {
329  $cell = $table->addCell($secondColLen)->addText(htmlspecialchars($obligationText), $rowTextStyleRight, "pStyle");
330  }
331  }
332  }
333 
334 
340  function todoTable(Section $section, $heading)
341  {
342  global $SysConf;
343  $textCommonObligation = (array_key_exists('CommonObligation', $SysConf['SYSCONFIG'])) ? $SysConf['SYSCONFIG']["CommonObligation"] : '';
344  $textAdditionalObligation = (array_key_exists('AdditionalObligation', $SysConf['SYSCONFIG'])) ? $SysConf['SYSCONFIG']["AdditionalObligation"] : '';
345  $textObligationAndRisk = (array_key_exists('ObligationAndRisk', $SysConf['SYSCONFIG'])) ? $SysConf['SYSCONFIG']["ObligationAndRisk"] : '';
346 
347  $rowStyle = array("bgColor" => "E0E0E0", "spaceBefore" => 0, "spaceAfter" => 0, "spacing" => 0);
348  $secondRowColorStyle = array("color" => "008000");
349  $rowTextStyleLeft = array("size" => 10, "bold" => true);
350  $rowTextStyleRight = array("size" => 10, "bold" => false);
351  $rowTextStyleRightBold = array("size" => 10, "bold" => true);
352  $lineStyle = array('weight' => 1, 'width' => 100, 'height' => 0, 'color' => 635552);
353 
354  $subHeading = "Common obligations, restrictions and risks:";
355  $subHeadingInfoText = " There is a list of common rules which was defined"
356  ." to simplify the To-Dos for development and distribution. The following"
357  ." list contains rules for development, and distribution which must always be followed!";
358  $rowWidth = 5;
359  $firstColLen = 500;
360  $secondColLen = 15000;
361 
362  $section->addTitle(htmlspecialchars($heading), 2);
363  $section->addTitle(htmlspecialchars($subHeading), 3);
364  $section->addText(htmlspecialchars($subHeadingInfoText), $rowTextStyleRight);
365 
366  $r1c1 = "1";
367  $r2c1 = "2";
368  $r3c1 = "3";
369 
370  $r1c2 = "Documentation of license conditions and copyright notices in"
371  ." product documentation (README_OSS) is provided by this component clearing report:";
372  $r2c2 = "Modifications in Source Code:";
373  $r2c21 = "If modifications are permitted:";
374  $r3c2 = "Obligations and risk assessment regarding distribution";
375 
376  $table = $section->addTable($this->tablestyle);
377 
378  $table->addRow($rowWidth);
379  $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r1c1), $rowTextStyleLeft, "pStyle");
380  $cell = $table->addCell($secondColLen, $rowStyle)->addText(htmlspecialchars($r1c2), $rowTextStyleRightBold, "pStyle");
381  $this->arrangeObligationsText($textCommonObligation, $table, $rowWidth, $firstColLen, $rowTextStyleLeft, $secondColLen, $rowTextStyleRight);
382 
383  $table->addRow($rowWidth);
384  $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r2c1), $rowTextStyleLeft, "pStyle");
385  $cell = $table->addCell($secondColLen, $rowStyle);
386  $cell->addText(htmlspecialchars($r2c2), $rowTextStyleRightBold, "pStyle");
387  $cell->addText(htmlspecialchars($r2c21), $rowTextStyleRight, "pStyle");
388  $this->arrangeObligationsText($textAdditionalObligation, $table, $rowWidth, $firstColLen, $rowTextStyleLeft, $secondColLen, $rowTextStyleRight);
389 
390  $table->addRow($rowWidth);
391  $cell = $table->addCell($firstColLen, $rowStyle)->addText(htmlspecialchars($r3c1), $rowTextStyleLeft, "pStyle");
392  $cell = $table->addCell($secondColLen, $rowStyle)->addText(htmlspecialchars($r3c2), $rowTextStyleRightBold, "pStyle");
393  $this->arrangeObligationsText($textObligationAndRisk, $table, $rowWidth, $firstColLen, $rowTextStyleLeft, $secondColLen, $rowTextStyleRight);
394 
395  $section->addTextBreak();
396  }
397 
398 
404  function todoObliTable(Section $section, $obligations)
405  {
406  $firstRowStyle = array("bgColor" => "D2D0CE");
407  $firstRowTextStyle = array("size" => 11, "bold" => true);
408  $secondRowTextStyle1 = array("size" => 11, "bold" => false);
409  $secondRowTextStyle2 = array("size" => 10, "bold" => false);
410  $secondRowTextStyle2Bold = array("size" => 10, "bold" => true);
411  $subHeading = " Additional obligations, restrictions & risks beyond common rules";
412  $subHeadingInfoText1 = "This chapter contains all obligations in addition"
413  ." to “common obligations, restrictions and risks” (common rules) of"
414  ." included OSS licenses (need to get added manually during component clearing process).";
415 
416  $cellRowSpan = array("vMerge" => "restart", "valign" => "top","size" => 11 , "bold"=> true, "bgcolor" => "FFFFC2");
417  $cellRowContinue = array("vMerge" => "continue","size" => 11 , "bold"=> true, "bgcolor" => "FFFFC2");
418 
419  $section->addTitle(htmlspecialchars($subHeading), 3);
420  $section->addText(htmlspecialchars($subHeadingInfoText1));
421 
422  $rowWidth = 200;
423  $firstColLen = 3000;
424  $secondColLen = 2500;
425  $thirdColLen = 9000;
426 
427  $table = $section->addTable($this->tablestyle);
428 
429  $table->addRow($rowWidth);
430  $cell = $table->addCell($firstColLen, $firstRowStyle)->addText(htmlspecialchars("Obligation"), $firstRowTextStyle);
431  $cell = $table->addCell($secondColLen, $firstRowStyle)->addText(htmlspecialchars("License"), $firstRowTextStyle);
432  $cell = $table->addCell($thirdColLen,
433  $firstRowStyle)->addText(htmlspecialchars("License section reference and short Description"), $firstRowTextStyle);
434 
435  if (!empty($obligations)) {
436  foreach ($obligations as $obligation) {
437  $table->addRow($rowWidth);
438  $table->addCell($firstColLen, $this->firstColStyle)->addText(htmlspecialchars($obligation["topic"]),
439  $firstRowTextStyle);
440  $table->addCell($secondColLen, $this->secondColStyle)->addText(htmlspecialchars(implode(",",
441  $obligation["license"])));
442  $obligationText = str_replace("\n", "</w:t>\n<w:br />\n<w:t xml:space=\"preserve\">", htmlspecialchars($obligation["text"], ENT_DISALLOWED));
443  $obligationText = str_replace("\r", "", $obligationText);
444  $table->addCell($thirdColLen)->addText($obligationText);
445  }
446  } else {
447  $table->addRow($rowWidth);
448  $table->addCell($firstColLen, $this->firstColStyle)->addText("", $firstRowTextStyle);
449  $table->addCell($secondColLen, $this->secondColStyle);
450  $table->addCell($thirdColLen);
451  }
452  $section->addTextBreak();
453  }
454 
463  function allLicensesWithAndWithoutObligations(Section $section, $heading, $obligations, $whiteLists, $titleSubHeadingObli)
464  {
465  $section->addTitle(htmlspecialchars("$heading"), 2);
466  $section->addText($titleSubHeadingObli, $this->subHeadingStyle);
467  $firstRowStyle = array("size" => 12, "bold" => false);
468 
469  $rowWidth = 200;
470  $firstColLen = 3500;
471  $secondColLen = 10000;
472 
473  $table = $section->addTable($this->tablestyle);
474 
475  if (!empty($obligations)) {
476  foreach ($obligations as $obligation) {
477  $table->addRow($rowWidth);
478  $table->addCell($secondColLen, $this->firstColStyle)->addText(htmlspecialchars(implode(",",
479  $obligation["license"])));
480  $table->addCell($firstColLen, $this->firstColStyle)->addText(htmlspecialchars($obligation["topic"]));
481  }
482  }
483  if (!empty($whiteLists)) {
484  foreach ($whiteLists as $whiteList) {
485  $table->addRow($rowWidth);
486  $table->addCell($firstColLen, $this->firstColStyle)->addText(htmlspecialchars($whiteList));
487  $table->addCell($secondColLen, $this->firstColStyle)->addText("");
488  }
489  }
490  $section->addTextBreak();
491  }
492 
497  function basicForClearingReport(Section $section)
498  {
499  $heading = "Basis for Clearing Report";
500  $section->addTitle(htmlspecialchars($heading), 2);
501 
502  $table = $section->addTable($this->tablestyle);
503 
504  $cellRowContinue = array("vMerge" => "continue");
505  $firstRowStyle = array("size" => 12, "bold" => true);
506  $rowTextStyle = array("size" => 11, "bold" => false);
507 
508  $cellRowSpan = array("vMerge" => "restart", "valign" => "top");
509  $cellColSpan = array("gridSpan" => 2, "valign" => "center");
510 
511  $rowWidth = 200;
512 
513  $firstColLen = 3500;
514  $secondColLen = 7500;
515  $thirdColLen = 4500;
516 
517  $table->addRow($rowWidth);
518  $cell = $table->addCell($firstColLen, $cellRowSpan)->addText(htmlspecialchars("Preparation basis for OSS"), $firstRowStyle);
519  $cell = $table->addCell($secondColLen, $cellColSpan);
520  $cell->addCheckBox("chkBox1", htmlspecialchars("Legally relevant Steps from analysis to clearing report"), $rowTextStyle);
521  $cell->addCheckBox("chkBox2", htmlspecialchars("no"), $rowTextStyle);
522  $cell = $table->addCell($thirdColLen);
523 
524  $table->addRow($rowWidth);
525  $cell = $table->addCell($firstColLen, $cellRowContinue);
526  $cell = $table->addCell($secondColLen, $cellColSpan);
527  $cell->addCheckBox("checkBox1",
528  htmlspecialchars("According to “Common Principles for Open Source License Interpretation” "), $rowTextStyle);
529  $cell->addCheckBox("checkBox2", htmlspecialchars("no"), $rowTextStyle);
530  $cell = $table->addCell($thirdColLen);
531 
532  $table->addRow($rowWidth);
533  $cell = $table->addCell($firstColLen, $cellRowSpan)->addText(htmlspecialchars("OSS Source Code"), $firstRowStyle);
534  $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars("Link to Upload page of component:"), $rowTextStyle);
535  $cell = $table->addCell($secondColLen, $cellColSpan)->addText("");
536 
537  $table->addRow($rowWidth);
538  $cell = $table->addCell($firstColLen, $cellRowContinue);
539  $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars("MD5 hash value of source code:"), $rowTextStyle);
540  $cell = $table->addCell($secondColLen, $cellColSpan)->addText(htmlspecialchars("n/a"), $rowTextStyle);
541 
542  $table->addRow($rowWidth);
543  $cell = $table->addCell($firstColLen)->addText(htmlspecialchars("Result of LCR editor" ), $firstRowStyle);
544  $cell = $table->addCell($thirdColLen)->addText(htmlspecialchars(
545  "Embedded .xml file which can be checked by the LCR Editor is embedded here:"
546  ), $rowTextStyle);
547  $cell = $table->addCell($secondColLen, $cellColSpan)->addText(htmlspecialchars("n/a"), $rowTextStyle);
548 
549  $section->addTextBreak();
550  }
551 
557  function getNonFunctionalLicenses(Section $section, $heading)
558  {
559  $styleFont = array('bold'=>true, 'size'=>10, 'name'=>'Arial');
560 
561  $section->addTitle(htmlspecialchars($heading), 2);
562  $text = "In this section the files and their licenses can be listed which"
563  . " do not “go” into the delivered “binary”, e.g. /test or /example.";
564  $section->addText($text, $styleFont);
565  $section->addTextBreak();
566  }
567 
574  function notes(Section $section, $heading, $subHeading)
575  {
576  $firstColLen = 3500;
577  $secondColLen = 8000;
578  $thirdColLen = 4000;
579  $styleFont = array('bold'=>true, 'size'=>10, 'name'=>'Arial','underline' => 'single');
580  $styleFont1 = array('bold'=>false, 'size'=>10, 'name'=>'Arial','underline' => 'single');
581  $styleFont2 = array('bold'=>false, 'size'=>10, 'name'=>'Arial');
582 
583  $section->addTitle(htmlspecialchars("$heading"), 2);
584  $section->addText("Only such source code of this component may be used-");
585  $section->addListItem("which has been checked by and obtained via the Clearing Center or",
586  1, "Arial", PhpOffice\PhpWord\Style\ListItem::TYPE_SQUARE_FILLED);
587  $section->addListItem("which has been submitted to Clearing Support to be checked",
588  1 , "Arial", PhpOffice\PhpWord\Style\ListItem::TYPE_SQUARE_FILLED);
589 
590  $textrun = $section->addTextRun();
591  $textrun->addText("Other source code or binaries from the Internet ", $styleFont2);
592  $textrun->addText("must not be ", $styleFont);
593  $textrun->addText("used.", $styleFont1);
594  $section->addText("");
595  $section->addText("The following chapters are generated by the source code scanner.");
596 
597  $section->addTextBreak();
598  $section->addTitle(htmlspecialchars($subHeading), 3);
599  }
600 }
Handles static part of report.
arrangeObligationsText($obligationText, $table, $rowWidth, $firstColLen, $rowTextStyleLeft, $secondColLen, $rowTextStyleRight)
Get obligation text and arrange them to rows and columns.
clearingProtocolChangeLogTable(Section $section, $heading)
Generates clearing protocol change log table.
todoTable(Section $section, $heading)
Generate todo table.
basicForClearingReport(Section $section)
Generate basis for clearing report section.
assessmentSummaryTable(Section $section, $otherStatement, $heading)
Generate assessment summary table.
reportHeader(Section $section)
Generates report header from Report Header Text
allLicensesWithAndWithoutObligations(Section $section, $heading, $obligations, $whiteLists, $titleSubHeadingObli)
Generate table with all licenses.
reportFooter($phpWord, Section $section, $otherStatement)
Generates report footer.
getNonFunctionalLicenses(Section $section, $heading)
notes(Section $section, $heading, $subHeading)
Generate notes.
addCheckBoxText($cell, $value, $text)
Check checkbox value(checked/unchecked) and append text.
todoObliTable(Section $section, $obligations)
Generate todo table for obligations.