forked from bobweston/osticket-plugin-mentioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
114 lines (109 loc) · 4.86 KB
/
config.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
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
<?php
require_once INCLUDE_DIR . 'class.plugin.php';
class MentionerPluginConfig extends PluginConfig
{
// Provide compatibility function for versions of osTicket prior to
// translation support (v1.9.4)
function translate()
{
if (! method_exists('Plugin', 'translate')) {
return array(
function ($x) {
return $x;
},
function ($x, $y, $n) {
return $n != 1 ? $y : $x;
}
);
}
return Plugin::translate('mentioner');
}
/**
* Build an Admin settings page.
*
* {@inheritdoc}
*
* @see PluginConfig::getOptions()
*/
function getOptions()
{
list ($__, $_N) = self::translate();
return array(
'sbm' => new SectionBreakField([
'label' => $__('Who can be @mentioned and added as a Collaborator?'),
'hint' => $__('By default, all Agents and Users are available to be @mentioned')
]),
'at-mentions' => new BooleanField([
'label' => $__("Notice @mentions"),
'hint' => $__('Enables adding @collaborators'),
'default' => true
]),
'agents-only' => new BooleanField([
'label' => $__('Only allow @mentions OF Agents (staff)'),
'hint' => $__('Add Agent collaborators only')
]),
'sba' => new SectionBreakField([
'label' => $__("Who can make mentions?"),
'hint' => $__('Default is all Users/Staff/System via email/web/API/scp')
]),
'by-agents-only' => new BooleanField([
'label' => $__('Only allow #/@ mentions BY Agents'),
'hint' => $__('Uncheck to allow Users to mention'),
'default' => TRUE
]),
'on' => new SectionBreakField([
'label' => $__('Override Notifications'),
'hint' => 'Ensure collaborators receive notifications about all Messages, if collaborator is Staff, they will receive notifications about Notes.'
]),
'override-notifications' => new BooleanField([
'label' => $__("Override Notifications"),
'hint' => $__('Can be dangerous..')
]),
'sbe' => new SectionBreakField([
'label' => $__('Match email addresses?'),
'hint' => $__('If you put domain.com here, we\'ll try and match @user as [email protected] and lookup their account (also works for #mention).')
]),
'email-domain' => new TextboxField([
'label' => $__('Which domains to match emails for?'),
'configuration' => array(
'html' => FALSE,
'size' => 40,
'length' => 256
)
]),
'sbh' => new SectionBreakField([
'label' => $__('Use #mentions for ticket notifications'),
'hint' => $__('Doesn\'t add as a collaborator, just notifies: "You were mentioned!".'),
'default' => TRUE
]),
'notice-hash' => new BooleanField([
'label' => $__('Notice #Mentions'),
'hint' => $__('Sends notices to staff mentioned with #name')
]),
'notice-subject' => new TextboxField([
'label' => $__('Notification Template: Subject'),
'hint' => $__('Subject of the notfication message'),
'default' => $__('You were mentioned in ticket #%{ticket.number}'),
'configuration' => array(
'size' => 40,
'length' => 256
)
]),
'notice-template' => new TextareaField([
'label' => $__('Notification Template: Message'),
'hint' => $__('Use variables the same as Internal Note alert'),
'default' => '
<h3><strong>Hi %{recipient.name.first},</strong></h3>
<p>%{poster.name.short} mentioned you in ticket <a href="%%7Bticket.staff_link%7D">#%{ticket.number}</a></p>
<table><tbody>
<tr> <td> <strong>From</strong>: </td> <td> %{ticket.name} </td> </tr>
<tr> <td> <strong>Subject</strong>: </td> <td> %{ticket.subject} </td> </tr> </tbody></table>
<br /> %{comments} <br /><br /><hr />
<p>To view/respond to the ticket, please <a href="%%7Bticket.staff_link%7D"><span style="color:rgb(84, 141, 212)">login</span></a> to the support ticket system<br />
<em style="font-size:small">Your friendly Customer Support System</em>
<br /><img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" alt="Powered by osTicket" width="126" height="19" style="width:126px" />
'
]) // not sure if this src id will work for others.. might be better as a plaintext message template.
);
}
}