Skip to content

Commit bdd6bd3

Browse files
committed
fix-report
1 parent 7e99363 commit bdd6bd3

1 file changed

Lines changed: 32 additions & 27 deletions

File tree

report-samm.php

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,45 @@
1111

1212
$mappingExists = array();
1313
$noMappingExists = array();
14-
foreach ($dimensions as $dimension => $subdimensions) {
15-
echo "<h1>Dimension $dimension</h1>";
16-
foreach ($subdimensions as $subdimension => $element) {
17-
$mappingExists[$subdimension] = array();
18-
$noMappingExists[$subdimension] = array();
19-
echo "<h2>Sub-Dimension $subdimension</h2>";
14+
$old_dimension = null;
2015

21-
echo "<h3 style='color:green;'>With SAMM2 Mapping</h3>";
22-
for ($i = 1; $i <= 4; $i++) {
23-
$tableContent .= "<td><ul>";
24-
foreach ($element as $activityName => $content) {
25-
if(array_key_exists("samm2", $content) && !preg_match("/TODO/i", $content["samm2"])) {
26-
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
2716

28-
if ($content2 != "") {
29-
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
30-
$mappingExists[$subdimension][$content["samm2"]][$activityName] = $content;
31-
}
17+
foreach (getActions($dimensions) as list($dimension, $subdimensions, $element) {
18+
if ($dimension != $old_dimension) {
19+
echo "<h1>Dimension $dimension</h1>";
20+
$old_dimension = $dimension;
21+
}
22+
23+
$mappingExists[$subdimension] = array();
24+
$noMappingExists[$subdimension] = array();
25+
echo "<h2>Sub-Dimension $subdimension</h2>";
26+
27+
echo "<h3 style='color:green;'>With SAMM2 Mapping</h3>";
28+
for ($i = 1; $i <= 4; $i++) {
29+
$tableContent .= "<td><ul>";
30+
foreach ($element as $activityName => $content) {
31+
if(array_key_exists("samm2", $content) && !preg_match("/TODO/i", $content["samm2"])) {
32+
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
33+
34+
if ($content2 != "") {
35+
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
36+
$mappingExists[$subdimension][$content["samm2"]][$activityName] = $content;
3237
}
3338
}
3439
}
40+
}
3541

36-
echo "<h3 style='color:red;'>Without SAMM2 Mapping</h3>";
37-
for ($i = 1; $i <= 4; $i++) {
38-
$tableContent .= "<td><ul>";
39-
foreach ($element as $activityName => $content) {
40-
if(!array_key_exists("samm2", $content) || preg_match("/TODO/i", $content["samm2"])) {
41-
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
42+
echo "<h3 style='color:red;'>Without SAMM2 Mapping</h3>";
43+
for ($i = 1; $i <= 4; $i++) {
44+
$tableContent .= "<td><ul>";
45+
foreach ($element as $activityName => $content) {
46+
if(!array_key_exists("samm2", $content) || preg_match("/TODO/i", $content["samm2"])) {
47+
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
4248

43-
if ($content2 != "") {
44-
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
45-
$content["name"] = $activityName;
46-
$noMappingExists[$subdimension][$content["samm2"]][$activityName] = $content;
47-
}
49+
if ($content2 != "") {
50+
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
51+
$content["name"] = $activityName;
52+
$noMappingExists[$subdimension][$content["samm2"]][$activityName] = $content;
4853
}
4954
}
5055
}

0 commit comments

Comments
 (0)