59 |
rodolico |
1 |
<!--
|
|
|
2 |
This code should be entered in your web page someplace. It will create
|
|
|
3 |
a div and a button, then attach to the bugreport script
|
|
|
4 |
-->
|
|
|
5 |
<button name='bugreport' type='button' onclick="togglebugreport()">Bug Report</button>
|
|
|
6 |
<div class='bugreport' id='bugreport' style='display:none; background: white; border: 1px solid black; padding: 5px;'>
|
|
|
7 |
<?php include_once("bugreport.php"); ?>
|
|
|
8 |
</div>
|
|
|
9 |
<script>
|
|
|
10 |
var bugreport = document.getElementById("bugreport"),
|
|
|
11 |
bugreportVisible = false;
|
|
|
12 |
|
|
|
13 |
function togglebugreport() {
|
|
|
14 |
if (bugreportVisible) {
|
|
|
15 |
bugreport.style.cssText = "display: none; background: white; border: 1px solid black; padding: 5px; position: relative;";
|
|
|
16 |
} else {
|
|
|
17 |
bugreport.style.cssText = "display: inline-block; background: white; border: 1px solid black; padding: 5px; position: relative;";
|
|
|
18 |
}
|
|
|
19 |
bugreportVisible = !bugreportVisible;
|
|
|
20 |
}
|
|
|
21 |
</script>
|
|
|
22 |
|
|
|
23 |
Also, we need this someplace in the code that calls it. I put it in an
|
|
|
24 |
config file for the application
|
|
|
25 |
<?php
|
|
|
26 |
// if the following is defined, will allow submission to a Redmine instance via e-mail
|
|
|
27 |
$GLOBALS['bugReport'] = array(
|
|
|
28 |
// which e-mail account it should go to
|
|
|
29 |
'mailto' => 'redmine@example.com',
|
|
|
30 |
// name of redmine project, from URL
|
|
|
31 |
'project' => 'timetracker',
|
|
|
32 |
// version if it is used. Comment out for none
|
|
|
33 |
'version' => '',
|
|
|
34 |
// default reporter
|
|
|
35 |
'reporter' => 'default@example.com',
|
|
|
36 |
// possible components. Subject will be set from this
|
|
|
37 |
'components' => array(
|
|
|
38 |
'Time Sheet',
|
|
|
39 |
'Personal Data',
|
|
|
40 |
'View Payroll',
|
|
|
41 |
'Create Payroll',
|
|
|
42 |
'Create Invoice',
|
|
|
43 |
'Reports'
|
|
|
44 |
),
|
|
|
45 |
// trackers available as defined in Redmine instance
|
|
|
46 |
'tracker' => array(
|
|
|
47 |
'Bug',
|
|
|
48 |
'Feature',
|
|
|
49 |
'Support'
|
|
|
50 |
),
|
|
|
51 |
// Priorities defined in Redmine
|
|
|
52 |
'priority' => array(
|
|
|
53 |
'Low',
|
|
|
54 |
'Normal',
|
|
|
55 |
'High',
|
|
|
56 |
'Urgent',
|
|
|
57 |
'Immediate'
|
|
|
58 |
)
|
|
|
59 |
);
|
|
|
60 |
?>
|