| @@ 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 | ||
| @@ 328-333 (lines=6) @@ | ||
| 325 | $this->set('columns', TableRegistry::get('Incidents')->summarizableFields); |
|
| 326 | $relatedEntries = array(); |
|
| 327 | ||
| 328 | foreach (TableRegistry::get('Incidents')->summarizableFields as $field) { |
|
| 329 | list($entriesWithCount, $totalEntries) = |
|
| 330 | $this->Reports->getRelatedByField($field, 25, true); |
|
| 331 | $relatedEntries[$field] = $entriesWithCount; |
|
| 332 | $this->set("${field}_distinct_count", $totalEntries); |
|
| 333 | } |
|
| 334 | //error_log(json_encode($relatedEntries)); |
|
| 335 | $this->set('related_entries', $relatedEntries); |
|
| 336 | } |
|