-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimeReporting.php
69 lines (63 loc) · 1.41 KB
/
TimeReporting.php
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
<?php
/**
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
*/
/**
* TimeReporting is a Mantis plugin.
*
* @author François Gannaz <francois.gannaz@silecs.info>
*/
class TimeReportingPlugin extends MantisPlugin
{
/**
* Init the plugin attributes.
*/
function register()
{
$this->name = 'Time Reporting';
$this->description = "Plugin that displays reports about the used time.";
$this->page = 'report';
$this->version = '2.0';
$this->requires = [
'MantisCore' => '2.0.0',
];
$this->author = 'François Gannaz / Silecs';
$this->contact = 'francois.gannaz@silecs.info';
$this->url = '';
}
/**
* Declare hooks on Mantis events.
*
* @return array
*/
public function hooks()
{
return [
'EVENT_LAYOUT_RESOURCES' => 'addHtmlHeadContent',
'EVENT_MENU_SUMMARY' => 'onMenuSummary',
];
}
/**
* Add entries to the menu on the page "Summary".
*
* @return array
*/
public function onMenuSummary(): array
{
return [
'<a href="' . plugin_page('report') . '">Tableaux du temps</a>',
];
}
function addHtmlHeadContent(): string
{
return <<<EOHTML
<style>
.column-num {
font-family: monospace;
text-align: right;
}
</style>
EOHTML
;
}
}