-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserSupport.php
More file actions
82 lines (70 loc) · 2.36 KB
/
UserSupport.php
File metadata and controls
82 lines (70 loc) · 2.36 KB
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
/*
User Support - a MantisBT plugin allowing users to express their view on individual issues.
Copyright (C) 2018 James Murrell
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
<?php
class UserSupportPlugin extends MantisPlugin {
function register() {
$this->name = 'User Issue Support';
$this->description = 'This plugin gives users the option to vote for higher or lower development priority of an issue.';
$this->page = 'config';
$this->version = '1.01';
$this->requires = array(
'MantisCore' => '2.0.0',
);
$this->author = 'cs97jjm3 (based upon Renegade@RenegadeProjects.com)';
$this->contact = 'murrell.james@gmail.com';
$this->url = 'f1cs97jjm3.ddns.net';
}
/*** Default plugin configuration. */
function config() {
return array(
'gaugesupport_excl_status' => '80,90' ,
'gaugesupport_incl_severity' => '30,40',
'gaugesupport_excl_resolution' => '20,40,50,60,70,90',
);
}
function init() {
plugin_event_hook('EVENT_MENU_MAIN' , 'menuLinks');
plugin_event_hook('EVENT_VIEW_BUG_EXTRA', 'renderBugSnippet');
}
function menuLinks($p_event) {
return array(
array(
'title' => plugin_lang_get( 'menu_link' ),
'access_level' => '',
'url' => 'plugin.php?page=UserSupport/issue_ranking',
'icon' => 'fa-money'
),
);
}
function renderBugSnippet($p_event, $bugid) {
include 'plugins/UserSupport/pages/user_form.php';
}
function schema() {
return array(
array(
"CreateTableSQL",
array(
plugin_table( "support_data" ),
"
bugid I NOTNULL UNSIGNED PRIMARY,
userid I NOTNULL UNSIGNED PRIMARY,
rating I NOTNULL SIGNED DEFAULT 0
",
array( "mysql" => "DEFAULT CHARSET=utf8" )
),
)
);
}
}