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