| @@ 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 | ||
| @@ 336-341 (lines=6) @@ | ||
| 333 | $this->set('columns', TableRegistry::get('Incidents')->summarizableFields); |
|
| 334 | $relatedEntries = array(); |
|
| 335 | ||
| 336 | foreach (TableRegistry::get('Incidents')->summarizableFields as $field) { |
|
| 337 | list($entriesWithCount, $totalEntries) = |
|
| 338 | $this->Reports->getRelatedByField($field, 25, true); |
|
| 339 | $relatedEntries[$field] = $entriesWithCount; |
|
| 340 | $this->set("${field}_distinct_count", $totalEntries); |
|
| 341 | } |
|
| 342 | //error_log(json_encode($relatedEntries)); |
|
| 343 | $this->set('related_entries', $relatedEntries); |
|
| 344 | } |
|