| @@ 146-151 (lines=6) @@ | ||
| 143 | ); |
|
| 144 | $relatedEntries = array(); |
|
| 145 | ||
| 146 | foreach (TableRegistry::get('Incidents')->summarizableFields as $field) { |
|
| 147 | list($entriesWithCount, $totalEntries) = |
|
| 148 | $this->Reports->getRelatedByField($field, 25, true); |
|
| 149 | $relatedEntries[$field] = $entriesWithCount; |
|
| 150 | $viewVars["${field}_distinct_count"] = $totalEntries; |
|
| 151 | } |
|
| 152 | ||
| 153 | $viewVars['related_entries'] = $relatedEntries; |
|
| 154 | ||
| @@ 355-360 (lines=6) @@ | ||
| 352 | $this->set('columns', TableRegistry::get('Incidents')->summarizableFields); |
|
| 353 | $relatedEntries = array(); |
|
| 354 | ||
| 355 | foreach (TableRegistry::get('Incidents')->summarizableFields as $field) { |
|
| 356 | list($entriesWithCount, $totalEntries) = |
|
| 357 | $this->Reports->getRelatedByField($field, 25, true); |
|
| 358 | $relatedEntries[$field] = $entriesWithCount; |
|
| 359 | $this->set("${field}_distinct_count", $totalEntries); |
|
| 360 | } |
|
| 361 | //error_log(json_encode($relatedEntries)); |
|
| 362 | $this->set('related_entries', $relatedEntries); |
|
| 363 | } |
|