|
11 | 11 |
|
12 | 12 | $mappingExists = array(); |
13 | 13 | $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; |
20 | 15 |
|
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); |
27 | 16 |
|
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; |
32 | 37 | } |
33 | 38 | } |
34 | 39 | } |
| 40 | + } |
35 | 41 |
|
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); |
42 | 48 |
|
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; |
48 | 53 | } |
49 | 54 | } |
50 | 55 | } |
|
0 commit comments