File: AdminDynamicFieldMultiselect.tt

package info (click to toggle)
otrs2 5.0.16-1%2Bdeb9u6
  • links: PTS
  • area: non-free
  • in suites: stretch
  • size: 141,108 kB
  • sloc: perl: 746,356; xml: 54,469; sql: 10,505; sh: 430; makefile: 64
file content (234 lines) | stat: -rw-r--r-- 16,090 bytes parent folder | download | duplicates (2)
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# --
# Copyright (C) 2001-2017 OTRS AG, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1>[% Translate("Dynamic Fields") | html %] - [% Translate(Data.ObjectTypeName) | html %]: [% Translate(Data.Mode) | html %] [% Translate(Data.FieldTypeName) | html %] [% Translate("Field") | html %]</h1>

    <div class="Clear"></div>

    <div class="SidebarColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("Actions") | html %]</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <li>
                        <a href="[% Env("Baselink") %]Action=AdminDynamicField" class="CallForAction Fullsize Center"><span><i class="fa fa-caret-left"></i>[% Translate("Go back to overview") | html %]</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="ContentColumn">
        <form action="[% Env("CGIHandle") %]" method="post" class="Validate PreventMultipleSubmits">
            <input type="hidden" name="Action" value="AdminDynamicFieldMultiselect" />
            <input type="hidden" name="Subaction" value="[% Data.Mode | html %]Action" />
            <input type="hidden" name="ObjectType" value="[% Data.ObjectType | html %]" />
            <input type="hidden" name="FieldType" value="[% Data.FieldType | html %]" />
            <input type="hidden" name="ID" value="[% Data.ID | html %]" />

            <div class="WidgetSimple">
                <div class="Header">
                    <h2>[% Translate("General") | html %]</h2>
                </div>
                <div class="Content">
                    <div class="LayoutGrid ColumnsWithSpacing">
                        <div class="Size1of2">
                            <fieldset class="TableLike">
                                <label class="Mandatory" for="Name"><span class="Marker">*</span> [% Translate("Name") | html %]:</label>
                                <div class="Field">
                                    <input id="Name" class="W50pc [% Data.NameServerError | html %] [% Data.ShowWarning | html %]  Validate_Alphanumeric" type="text" maxlength="200" value="[% Data.Name | html %]" name="Name" [% Data.ReadonlyInternalField | html %] />
                                    <div id="NameError" class="TooltipErrorMessage"><p>[% Translate("This field is required, and the value should be alphabetic and numeric characters only.") | html %]</p></div>
                                    <div id="NameServerError" class="TooltipErrorMessage"><p>[% Translate(Data.NameServerErrorMessage) | html %]</p></div>
                                    <p class="FieldExplanation">[% Translate("Must be unique and only accept alphabetic and numeric characters.") | html %]</p>
                                    <p class="Warning Hidden">[% Translate("Changing this value will require manual changes in the system.") | html %]</p>
                                </div>
                                <div class="Clear"></div>

                                <label class="Mandatory" for="Label"><span class="Marker">*</span> [% Translate("Label") | html %]:</label>
                                <div class="Field">
                                    <input id="Label" class="W50pc [% Data.LabelServerError | html %] Validate_Required" type="text" maxlength="200" value="[% Data.Label | html %]" name="Label"/>
                                    <div id="LabelError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                    <div id="LabelServerError" class="TooltipErrorMessage"><p>[% Translate(Data.LabelServerErrorMessage) | html %]</p></div>
                                    <p class="FieldExplanation">[% Translate("This is the name to be shown on the screens where the field is active.") | html %]</p>
                                </div>
                                <div class="Clear"></div>

                                <label class="Mandatory" for="FieldOrder"><span class="Marker">*</span> [% Translate("Field order") | html %]:</label>
                                <div class="Field">
                                    [% Data.DynamicFieldOrderStrg %]
                                    <div id="FieldOrderError" class="TooltipErrorMessage"><p>[% Translate("This field is required and must be numeric.") | html %]</p></div>
                                    <div id="FieldOrderServerError" class="TooltipErrorMessage"><p>[% Translate(Data.FieldOrderServerErrorMessage) | html %]</p></div>
                                    <p class="FieldExplanation">[% Translate("This is the order in which this field will be shown on the screens where is active.") | html %]</p>
                                </div>
                                <div class="Clear"></div>
                            </fieldset>
                        </div>
                        <div class="Size1of2">
                            <fieldset class="TableLike">
                                <label for="ValidID">[% Translate("Validity") | html %]:</label>
                                <div class="Field">
                                    [% Data.ValidityStrg %]
                                </div>
                                <div class="Clear"></div>

                                <div class="SpacingTop"></div>
                                <label for="FieldTypeName">[% Translate("Field type") | html %]:</label>
                                <div class="Field">
                                    <input id="FieldTypeName" readonly class="W50pc" type="text" maxlength="200" value="[% Translate(Data.FieldTypeName) | html %]" name="FieldTypeName"/>
                                    <div class="Clear"></div>
                                </div>

                                <div class="SpacingTop"></div>
                                <label for="ObjectTypeName">[% Translate("Object type") | html %]:</label>
                                <div class="Field">
                                    <input id="ObjectTypeName" readonly class="W50pc" type="text" maxlength="200" value="[% Translate(Data.ObjectTypeName) | html %]" name="ObjectTypeName"/>
                                    <div class="Clear"></div>
                                </div>

[% RenderBlockStart("InternalField") %]
                                <div class="SpacingTop"></div>
                                <label for="InternalField">[% Translate("Internal field") | html %]:</label>
                                <div class="Field">
                                    <input id="InternalField" readonly class="W50pc" type="text" maxlength="1" value="[% Data.InternalField | html %]" name="InternalField"/>
                                    <p class="FieldExplanation">
                                        [% Translate("This field is protected and can't be deleted.") | html %]
                                    </p>
                                    <div class="Clear"></div>
                                </div>
[% RenderBlockEnd("InternalField") %]
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
            <div class="WidgetSimple">
                <div class="Header">
                    <h2>[% Translate(Data.FieldTypeName) | html %] [% Translate("Field Settings") | html %]</h2>
                </div>
                <div class="Content">
                    <fieldset class="TableLike">
                        <label>[% Translate("Possible values") | html %]:</label>
                        <div class="Field ValueInsert">
                            <input type="hidden" name="ValueCounter" value="[% Data.ValueCounter | html %]" id="ValueCounter" class="ValueCounter" />
[% RenderBlockStart("ValueRow") %]
                            <div class="ValueRow">
                                <label class="Mandatory" for="Key_[% Data.ValueCounter | html %]"><span class="Marker">*</span>[% Translate("Key") | html %]:</label>
                                <input name="Key_[% Data.ValueCounter | html %]" id="Key_[% Data.ValueCounter | html %]" class="DefaultValueKeyItem Validate_Required W20pc [% Data.KeyError | html %]" type="text" maxlength="100" value="[% Data.Key | html %]"/>
                                <div id="Key_[% Data.ValueCounter | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                <div id="Key_[% Data.ValueCounter | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate(Data.KeyErrorStrg) | html %]</p></div>

                                <label class="Mandatory" for="Value_[% Data.ValueCounter | html %]"><span class="Marker">*</span>[% Translate("Value") | html %]:</label>
                                <input name="Value_[% Data.ValueCounter | html %]" id="Value_[% Data.ValueCounter | html %]" class="DefaultValueItem Validate_Required W20pc [% Data.ValueError | html %]" type="text" maxlength="100" value="[% Data.Value | html %]"/>
                                <div id="Value_[% Data.ValueCounter | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                <div id="Value_[% Data.ValueCounter | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>

                                <a href="#" id="RemoveValue_[% Data.ValueCounter | html %]" class="RemoveButton ValueRemove"><i class="fa fa-minus-square-o"></i><span class="InvisibleText">[% Translate("Remove value") | html %]</span></a>
                                <div class="SpacingTopMini" ></div>
                            </div>
[% RenderBlockEnd("ValueRow") %]
[% RenderBlockStart("ValueTemplate") %]
                            <div class="ValueTemplate Hidden">
                                <label class="Mandatory" for="Key"><span class="Marker">*</span>[% Translate("Key") | html %]:</label>
                                <input name="Key_[% Data.ValueCounter | html %]" id="Key" class="DefaultValueKeyItem W20pc" type="text" maxlength="100" value="[% Data.Key | html %]"/>
                                <div id="KeyError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                <div id="KeyServerError" class="TooltipErrorMessage"><p>[% Translate(Data.KeyErrorStrg) | html %]</p></div>

                                <label class="Mandatory" for="Value"><span class="Marker">*</span>[% Translate("Value") | html %]:</label>
                                <input name="Value_[% Data.ValueCounter | html %]" id="Value" class="DefaultValueItem W20pc" type="text" maxlength="100" value="[% Data.Value | html %]"/>
                                <div id="ValueError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                                <div id="ValueServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>

                                <a href="#" id="RemoveValue_[% Data.ValueCounter | html %]" class="RemoveButton ValueRemove"><i class="fa fa-minus-square-o"></i><span class="InvisibleText">[% Translate("Remove value") | html %]</span></a>
                                <div class="SpacingTopMini" ></div>
                            </div>
[% RenderBlockEnd("ValueTemplate") %]
                            <input type="hidden" name="DeletedValue" value="[% Data.DeletedString | html %]" id="DeletedValue" class="DeletedValue" />
                        </div>
                        <div class="Clear"></div>

                        <label for="AddValue">[% Translate("Add value") | html %]:</label>
                        <div class="Field">
                            <a href="#" id="AddValue" class="AddButton"><i class="fa fa-plus-square-o"></i><span class="InvisibleText">[% Translate("Add Value") | html %]</span></a>
                        </div>
                        <div class="Clear"></div>

                        <div class="SpacingTop"></div>
                        <label for="DefaultValue">[% Translate("Default value") | html %]:</label>
                        <div class="Field">
                            [% Data.DefaultValueStrg %]
                            <p class="FieldExplanation">[% Translate("This is the default value for this field.") | html %]</p>
                        </div>
                        <div class="Clear"></div>

                        <div class="SpacingTop"></div>
                        <label for="PossibleNone">[% Translate("Add empty value") | html %]:</label>
                        <div class="Field">
                            [% Data.PossibleNoneStrg %]
                            <p class="FieldExplanation">[% Translate("Activate this option to create an empty selectable value.") | html %]</p>
                        </div>
                        <div class="Clear"></div>

                        <div class="SpacingTop"></div>
                        <label for="TreeView">[% Translate("Tree View") | html %]:</label>
                        <div class="Field">
                            [% Data.TreeViewStrg %]
                            <p class="FieldExplanation">[% Translate("Activate this option to display values as a tree.") | html %]</p>
                        </div>
                        <div class="Clear"></div>

                        <label for="TranslatableValues">[% Translate("Translatable values") | html %]:</label>
                        <div class="Field">
                            [% Data.TranslatableValuesStrg %]
                            <p class="FieldExplanation">[% Translate("If you activate this option the values will be translated to the user defined language.") | html %]</p>
                            <p class="FieldExplanation"><strong>[% Translate("Note") | html %]: </strong>[% Translate("You need to add the translations manually into the language translation files.") | html %]</p>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </div>
            </div>
            <fieldset class="TableLike">
                <div class="Field SpacingTop">
                    <button type="submit" class="Primary CallForAction" value="[% Translate("Submit") | html %]"><span>[% Translate("Submit") | html %]</span></button>
                    [% Translate("or") | html %]
                    <a href="[% Env("Baselink") %]Action=AdminDynamicField">[% Translate("Cancel") | html %]</a>
                </div>
                <div class="Clear"></div>
            </fieldset>
        </form>
    </div>
</div>
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
$('.ShowWarning').bind('change keyup', function (Event) {
    $('p.Warning').removeClass('Hidden');
});

//bind click function to add button
$('#AddValue').bind('click', function () {
    Core.Agent.Admin.DynamicFieldMultiselect.AddValue(
        $(this).closest('fieldset').find('.ValueInsert')
    );
    return false;
});

//bind click function to remove button
$('.ValueRemove').bind('click', function () {
    Core.Agent.Admin.DynamicFieldMultiselect.RemoveValue($(this).attr('id'));
    return false;
});

$('.DefaultValueKeyItem,.DefaultValueItem').bind('keyup', function () {
    Core.Agent.Admin.DynamicFieldMultiselect.RecreateDefaultValueList();
});

Core.Agent.Admin.DynamicField.ValidationInit();
//]]></script>
[% END %]