/
view.ctp
147 lines (145 loc) · 4.42 KB
/
view.ctp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<div>
<h1 style="display: inline">Error Report #<?php echo $report["Report"]["id"]; ?>
<small>[<?php echo $status[$report["Report"]["status"]]; ?>]</small>
</h1>
<a href="#" onclick="showStateForm(); return false">Change state</a>
</div>
<br />
<form class="form-inline" id="state-form" style="display: none"
action="/reports/change_state/<?php echo $report["Report"]["id"]; ?>"
method="post">
<span>Change state to:</span>
<?php echo $this->Form->select('state', $status, array('value' =>
$report["Report"]["status"], 'empty' => false)); ?>
<input type="submit" value="Change" class="btn btn-primary" />
</form>
<?php if (empty($related_reports)) { ?>
<form class="form-inline" action="/reports/mark_related_to/<?php
echo $report["Report"]["id"]; ?>">
<span>Mark the same as:</span>
<input type="number" min="1" name="related_to" />
<input type="submit" value="Submit" class="btn btn-primary" />
</form>
<?php } else { ?>
<p>
This report has been marked the same as the following reports:
(<?php echo $this->Reports->createReportsLinks($related_reports); ?>).
<a href="/reports/unmark_related_to/<?php echo $report["Report"]["id"]; ?>">
Remove from this group
</a>
</p>
<?php } ?>
<table cellspacing="0" class="table table-bordered error-report">
<tr>
<td>Error Name</td>
<td><?php echo $report["Report"]["error_name"]; ?></td>
</tr>
<tr>
<td>Error Message</td>
<td><?php echo $report["Report"]["error_message"]; ?></td>
</tr>
<tr>
<td>Sourceforge Report</td>
<td><?php if($report['Report']['sourceforge_bug_id']) {
echo $this->Html->link('#' . $report['Report']['sourceforge_bug_id'],
"https://sourceforge.net/p/$project_name/bugs/".
$report['Report']['sourceforge_bug_id'] . "/");
} else {
echo $this->Html->link('Submit report', '/source_forge/create_ticket/'
. $report['Report']['id']);
} ?>
</td>
</tr>
<tr>
<td>PMA Versions</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["pma_version"], $pma_version_distinct_count);
?>
</td>
</tr>
<tr>
<td>PHP Versions</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["php_version"], $php_version_distinct_count);
?>
</td>
</tr>
<tr>
<td>Browsers</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["browser"], $browser_distinct_count);
?>
</td>
</tr>
<tr>
<td>Script Name</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["script_name"], $script_name_distinct_count);
?>
</td>
</tr>
<tr>
<td>Configuration Storage</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["configuration_storage"], $configuration_storage_distinct_count);
?>
</td>
</tr>
<tr>
<td>Server Software</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["server_software"], $server_software_distinct_count);
?>
</td>
</tr>
<tr>
<td>User OS</td>
<td>
<?php echo $this->Reports->entriesFromIncidents(
$related_entries["user_os"], $user_os_distinct_count);
?>
</td>
</tr>
<tr>
<td>Incident Count</td>
<td><?php echo count($incidents) . " incidents of this bug"; ?></td>
</tr>
<tr>
<td>Submission Date</td>
<td>
<?php echo $report["Report"]["created"]; ?>
and it was last seen on
<?php echo $incidents[0]["Incident"]["created"]; ?>
</td>
</tr>
<tr>
<td>Incidents</td>
<td>
<?php echo $this->Incidents->createIncidentsLinks($incidents); ?>
</td>
</tr>
</table>
<h4>Stacktraces:</h4>
<?php echo $this->Reports->getStacktracesForIncidents($incidents_with_stacktrace); ?>
<h4>Descriptions submited by users:</h4>
<?php echo $this->Incidents->incidentsDescriptions($incidents_with_description); ?>
<h4>Stats and Graphs</h4>
<span id="graphs"></span>
<script type="text/javascript">
<?php echo $this->Reports->getChartArray("chartArray", $columns,
$related_entries); ?>
window.onload = function () {
chartArray.forEach(function(chart) {
var span_id = "graph_" + chart.name;
var $span = $("<span class='span5'>").attr("id", span_id);
$("#graphs").append($span);
piechart(span_id, chart.title, chart.values, chart.labels);
});
};
</script>