-
Notifications
You must be signed in to change notification settings - Fork 89
/
AdminRole.tt
208 lines (197 loc) · 10.5 KB
/
AdminRole.tt
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# --
# Copyright (C) 2001-2021 OTRS AG, https://otrs.com/
# Copyright (C) 2021 Znuny GmbH, https://znuny.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
[% RenderBlockStart("Overview") %]
<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst ActionsSideBar">
<div class="SidebarColumn ActionsSideBarComp">
[% RenderBlockStart("ActionList") %]
<div class="WidgetSimple">
<div class="Header">
<h2>[% Translate("Actions") | html %]</h2>
</div>
<div class="Content">
<ul class="ActionList">
[% RenderBlockStart("ActionOverview") %]
<li>
<a href="[% Env("Baselink") %]Action=[% Env("Action") %]" class="CallForAction btn-main btn-primary-ghost btn-width-md"><span><i class="fa fa-caret-left"></i>[% Translate("Go to overview") | html %]</span></a>
</li>
[% RenderBlockEnd("ActionOverview") %]
[% RenderBlockStart("ActionAdd") %]
<li>
<a href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=Add" class="CallForAction btn-main btn-primary-ghost btn-width-md"><span><i class="fa fa-plus-square"></i>[% Translate("Add Role") | html %]</span></a>
</li>
[% RenderBlockEnd("ActionAdd") %]
</ul>
</div>
</div>
[% RenderBlockEnd("ActionList") %]
[% RenderBlockStart("Filter") %]
<div class="WidgetSimple">
<div class="Header">
<h2><label for="FilterRoles">[% Translate("Filter for Roles") | html %]</label></h2>
</div>
<div class="Content">
<input type="text" id="FilterRoles" class="FilterBox" placeholder="[% Translate("Just start typing to filter...") | html %]" name="FilterRoles" value="" title="[% Translate("Filter for roles") | html %]">
</div>
</div>
[% RenderBlockEnd("Filter") %]
<div class="WidgetSimple">
<div class="Header">
<h2>[% Translate("Hint") | html %]</h2>
</div>
<div class="Content">
<p class="FieldExplanation">
[% Translate("Create a role and put groups in it. Then add the role to the users.") | html %]
</p>
</div>
</div>
<div class='WidgetSimple'>
<div class='Header'>
<h2>[% Translate('Related Actions') | html %]</h2>
</div>
<div class='Content'>
<ul class='ActionList'>
<li>
<a href='[% Env("Baselink") %]Action=AdminRoleGroup' class='CallForAction btn-main btn-primary-ghost btn-width-md'>
<span>
[% Translate('Roles ↔ Groups') | html %]
</span>
</a>
</li>
<li>
<a href='[% Env("Baselink") %]Action=AdminRoleUser' class='CallForAction btn-main btn-primary-ghost btn-width-md'>
<span>
[% Translate('Agents ↔ Roles') | html %]
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="ContentColumn">
<h1 class="InvisibleText">[% Translate("Role Management") | html %]</h1>
[% BreadcrumbPath = [
{
Name => Translate('Role Management'),
Link => Env("Action"),
},
]
%]
[% SWITCH Data.Action %]
[% CASE 'Add' %]
[% BreadcrumbPath.push({ Name => Translate('Add Role'),}) %]
[% CASE 'Change' %]
[% USE EditTitle = String(Translate("Edit Role")) %]
[% BreadcrumbPath.push({ Name => EditTitle.append( ': ', Data.Name ) }) %]
[% END %]
[% INCLUDE "Breadcrumb.tt" Path = BreadcrumbPath %]
<div class="WidgetSimple">
[% RenderBlockStart("OverviewHeader") %]
<div class="Header filter-items">
<h2>[% Translate("List") | html %] ([% Data.AllItemsCount | html %] [% Translate("total") | html %])</h2>
<a href="#" id="ValidFilter" title="[% Translate("Filter") | html %]">
<span class="show-valid">[% Translate("Show Valid") | html %]</span>
<span class="show-all">[% Translate("Show All") | html %]</span>
</a>
</div>
[% RenderBlockEnd("OverviewHeader") %]
[% RenderBlockStart("NoRolesDefined") %]
<div class="Content">
<p>[% Translate("There are no roles defined. Please use the 'Add' button to create a new role.") | html %]</p>
</div>
[% RenderBlockEnd("NoRolesDefined") %]
[% RenderBlockStart("OverviewResult") %]
<div class="Content">
<table class="DataTable" id="Roles">
<thead>
<tr>
<th>[% Translate("Name") | html %]</th>
<th>[% Translate("Comment") | html %]</th>
<th>[% Translate("Validity") | html %]</th>
<th>[% Translate("Changed") | html %]</th>
<th>[% Translate("Created") | html %]</th>
</tr>
</thead>
<tbody>
[% RenderBlockStart("OverviewResultRow") %]
<tr [% IF Data.ValidID != 1 %]class="Invalid"[% END %]>
<td><a class="AsBlock" href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=Change;ID=[% Data.ID | uri %]">[% Data.Name | html %]</a></td>
<td title="[% Data.Comment | html %]">[% Data.Comment | truncate(26) | html %]</td>
<td>[% Translate(Data.Valid) | html %]</td>
<td>[% Data.ChangeTime | Localize("TimeShort") %]</td>
<td>[% Data.CreateTime | Localize("TimeShort") %]</td>
</tr>
[% RenderBlockEnd("OverviewResultRow") %]
<tr class="FilterMessage Hidden">
<td colspan="5">[% Translate("No matches found.") | html %]</td>
</tr>
</tbody>
</table>
</div>
[% RenderBlockEnd("OverviewResult") %]
[% RenderBlockStart("OverviewUpdate") %]
<div class="Header">
[% IF Data.Action == 'Add' %]
<h2>[% Translate("Add Role") | html %]</h2>
[% ELSE %]
<h2>[% Translate("Edit Role") | html %]</h2>
[% END %]
</div>
<div class="Content">
<form action="[% Env("CGIHandle") %]" method="post" class="Validate PreventMultipleSubmits">
<input type="hidden" name="Action" value="[% Env("Action") %]"/>
<input type="hidden" name="Subaction" value="[% Data.Action | uri %]Action"/>
<input type="hidden" name="ID" value="[% Data.ID | html %]"/>
[% IF Data.Action == 'Change' %]
<input type="hidden" name="ContinueAfterSave" id="ContinueAfterSave" value=""/>
[% END %]
<fieldset class="TableLike">
<div class="field-wrapper">
<label class="Mandatory" for="Name"><span class="Marker">*</span> [% Translate("Name") | html %]</label>
<div class="Field">
<input type="text" name="Name" id="Name" value="[% Data.Name | html %]" class="W50pc Validate_Required [% Data.NameInvalid | html %]" maxlength="200"/>
<div id="NameError" class="TooltipErrorMessage">
<p>[% Translate("This field is required.") | html %]</p>
</div>
<div id="NameServerError" class="TooltipErrorMessage">
<p>[% Translate("This field is required.") | html %]</p>
</div>
</div>
</div>
<div class="field-wrapper">
<label class="Mandatory" for="ValidID"><span class="Marker">*</span> [% Translate("Validity") | html %]</label>
<div class="Field">
[% Data.ValidOption %]
</div>
</div>
<div class="field-wrapper">
<label for="Comment">[% Translate("Comment") | html %]</label>
<div class="Field">
<input type="text" name="Comment" id="Comment" value="[% Data.Comment | html %]" class="W50pc" maxlength="250"/>
</div>
</div>
<div class="field-wrapper form-button-actions">
<div class="Field buttons-field">
<a href="[% Env("Baselink") %]Action=[% Env("Action") %]" class="btn-cancel-ghost btn-main btn-width-md">[% Translate("Cancel") | html %]</a>
[% IF Data.Action == 'Change' %]
<button class="CallForAction Primary btn-primary-ghost btn-main btn-width-md" id="Submit" type="submit" value="[% Translate("Save") | html %]"><span>[% Translate("Save and finish") | html %]</span></button>
<button class="CallForAction Primary btn-primary btn-main btn-width-md" id="SubmitAndContinue" type="button" value="[% Translate("Save") | html %]"><span>[% Translate("Save") | html %]</span></button>
[% ELSE %]
<button class="CallForAction Primary btn-primary btn-main btn-width-md" id="Submit" type="submit" value="[% Translate("Save") | html %]"><span>[% Translate("Save") | html %]</span></button>
[% END %]
</div>
</div>
</fieldset>
</form>
</div>
[% RenderBlockEnd("OverviewUpdate") %]
</div>
</div>
</div>
[% RenderBlockEnd("Overview") %]