1 | <?php |
||
11 | class ReportsHelper extends AppHelper { |
||
12 | public $helpers = array('Incidents'); |
||
13 | |||
14 | 3 | public function __construct(View $view, $settings = array()) { |
|
17 | |||
18 | 1 | public function entriesFromIncidents($entries, $totalCount, $key) { |
|
19 | //$entries = Sanitize::clean($entries); |
||
20 | 1 | $values = array(); |
|
21 | 1 | foreach($entries as $entry) { |
|
22 | 1 | $values[] = "$entry[$key] <span class='count'>(".$entry['count'].")</span>"; |
|
23 | } |
||
24 | 1 | $fullString = implode(", ", $values); |
|
25 | 1 | $remaining = $totalCount - count($values); |
|
26 | 1 | if ($remaining) { |
|
27 | $fullString .= " <small>and $remaining others</small>"; |
||
28 | } |
||
29 | 1 | return $fullString; |
|
30 | } |
||
31 | |||
32 | public function createReportsLinks($reports) { |
||
33 | $links = array(); |
||
34 | foreach ($reports as $report) { |
||
35 | $links[] = $this->linkToReport($report); |
||
36 | } |
||
37 | $string = implode(", ", $links); |
||
38 | return $string; |
||
39 | } |
||
40 | |||
41 | public function linkToReport($report) { |
||
46 | |||
47 | 1 | public function linkToReportFromIncident($incident) { |
|
52 | |||
53 | 1 | public function getStacktracesForIncidents($incidents) { |
|
54 | 1 | $count = 0; |
|
71 | |||
72 | 1 | public function getChartArray($arrayName, $columns, $relatedEntries) { |
|
89 | |||
90 | public function getLineChartData($arrayName, $entries) { |
||
98 | } |
||
99 |