File: AgentTicketOverviewPreview.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 (415 lines) | stat: -rw-r--r-- 21,206 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# --
# 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.
# --
[% RenderBlockStart("DocumentActionRow") %]
<ul class="Actions">
[% RenderBlockStart("DocumentActionRowBulk") %]
    <li class="AlwaysPresent">
        <span>
            <input type="checkbox" title="[% Translate("Select all") | html %]" id="SelectAllTickets" autocomplete="off" />
            <label class="InvisibleText" for="SelectAllTickets">[% Translate("Select all") | html %]</label>
        </span>
    </li>
    <li id="BulkAction" class="AlwaysPresent Inactive [% Data.CSS | html %]">
        <a href="#">[% Translate(Data.Name) | html %]</a>
    </li>
[% RenderBlockEnd("DocumentActionRowBulk") %]
[% RenderBlockStart("DocumentActionRowItem") %]
    <li><a class="[% Data.Class | html %]" href="[% Data.Link | html %]" title="[% Data.Description | html %]">[% Data.Name | html %]</a></li>
[% RenderBlockEnd("DocumentActionRowItem") %]
[% RenderBlockStart("DocumentActionRowHTML") %]
    [% Data.HTML %]
[% RenderBlockEnd("DocumentActionRowHTML") %]
</ul>
[% RenderBlockEnd("DocumentActionRow") %]

[% RenderBlockStart("DocumentHeader") %]
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    Core.UI.ActionRow.Init();

    $('a.AsPopup').bind('click', function (Event) {
        var Matches,
            PopupType = 'TicketAction';

        Matches = $(this).attr('class').match(/PopupType_(\w+)/);
        if (Matches) {
            PopupType = Matches[1];
        }

        Core.UI.Popup.OpenPopup($(this).attr('href'), PopupType);
        return false;
    });
//]]></script>
[% END %]

<ul id="TicketOverviewLarge" class="Overview OverviewLarge [% Data.Class | html %]">
[% RenderBlockEnd("DocumentHeader") %]

[% RenderBlockStart("NoTicketFound") %]
    <li id="EmptyMessageLarge">
        [% Translate("No ticket data found.") | html %]
    </li>
[% RenderBlockEnd("NoTicketFound") %]

[% RenderBlockStart("DocumentContent") %]
    <li id="TicketID_[% Data.TicketID | html %]" class="MasterAction">
        <div class="Content [% Data.AdditionalClasses | html %]">
[% RenderBlockStart("InlineActionRow") %]
            <ul class="Actions InlineActions">
                <li class="ResponsiveActionMenu"><a href="#" id="ResponsiveActionMenu[% Data.TicketID | html %]" title="[% Translate("Open / Close ticket action menu") | html %]"><i class="fa fa-bars"></i></a></li>
[% RenderBlockStart("InlineActionRowItem") %]
                <li><a id="[% Data.ID | html %][% Data.TicketID | html %]" class="[% Data.Class | html %]" href="[% Data.Link | Interpolate | html %]" title="[% Translate(Data.Description) | html %]">[% Translate(Data.Name) | html %]</a></li>
[% RenderBlockEnd("InlineActionRowItem") %]
[% RenderBlockStart("InlineActionRowItemHTML") %]
                [% Data.HTML %]
[% RenderBlockEnd("InlineActionRowItemHTML") %]
            </ul>
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    // Stop propagation on click on a part of the InlienActionRow without a link
    // Otherwise that would trigger the li-wide link to the ticketzoom
    $('ul.InlineActions').click(function (Event) {
        Event.cancelBubble = true;
        if (Event.stopPropagation) {
            Event.stopPropagation();
        }
    });
//]]></script>
[% END %]
[% RenderBlockEnd("InlineActionRow") %]
[% RenderBlockStart("Bulk") %]
            <div class="Checkbox">
                <input class="Checkbox" type="checkbox" name="TicketID" title="[% Translate("Select this ticket") | html %]" value="[% Data.TicketID | html %]" autocomplete="off" />
            </div>
[% RenderBlockEnd("Bulk") %]
[% RenderBlockStart("Meta") %]
[% RenderBlockStart("MetaIcon") %]
            <div class="[% Data.Class | html %]" title="[% Translate(Data.Title) | html %]">
                <span class="[% Data.ClassSpan | html %]">
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <em>[% Translate(Data.Title) | html %]</em>
                </span>
            </div>
[% RenderBlockEnd("MetaIcon") %]
[% RenderBlockEnd("Meta") %]
            <div class="Infos">
                <h2>
                    <a href="[% Env("Baselink") %]Action=AgentTicketZoom;TicketID=[% Data.TicketID | uri %]" title="[% Data.Title | html %]" class="MasterActionLink">[% Config("Ticket::Hook") %][% Config("Ticket::HookDivider") %][% Data.TicketNumber %] &ndash; [% Data.Title | html %]</a>
                </h2>
[% RenderBlockStart("MenuItem") %]
                <a href="[% Env("Baselink") %][% Data.Link %]" [% Data.LinkParam %] class="menuitem" title="[% Translate(Data.Description) | html %]">[% Translate(Data.Name) | html %]</a>
[% RenderBlockEnd("MenuItem") %]
                <table>
                    <tbody>
                        <tr>
                            <td>
                                <label>[% Translate("Age") | html %]</label>[% Data.Age | html %]
                            </td>
                            <td>
                                <label>[% Translate("Queue") | html %]</label><div title="[% Data.Queue | html %]">[% Data.Queue | truncate(26) | html %]</div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>[% Translate("Created") | html %]</label>[% Data.Created | Localize("TimeLong") %]
                            </td>
                            <td>
                                <label>[% Translate("State") | html %]</label><div title="[% Translate(Data.State) | html %]">[% Translate(Data.State) | html %]</div>
                            </td>
                        </tr>
[% RenderBlockStart("Service") %]
                        <tr>
                            <td>
                                <label>[% Translate("Service") | html %]</label><div title="[% Data.Service | html %]">[% Data.Service | truncate(26) | html %]</div>
                            </td>
                            <td>
[% RenderBlockStart("SLA") %]
                                <label>[% Translate("Service Level Agreement") | html %]</label><div title="[% Data.SLA | html %]">[% Data.SLA | truncate(26) | html %]</div>
[% RenderBlockEnd("SLA") %]
                            </td>
                        </tr>
[% RenderBlockEnd("Service") %]
                        <tr>
                            <td>
                                <label>[% Translate("Owner") | html %]</label><div title="[% Data.UserFirstname | html %] [% Data.UserLastname | html %] ([% Data.Owner | html %])">[% Data.UserFirstname | truncate(15) | html %] [% Data.UserLastname | truncate(15) | html %]</div>
                            </td>
                            <td>
                                <label>[% Translate("Lock") | html %]</label><div title="[% Translate(Data.Lock) | html %]">[% Translate(Data.Lock) | html %]</div>
                            </td>
                        </tr>
                        <tr class="Middle">
                            <td>
[% RenderBlockStart("CustomerID") %]
                                <label>[% Translate("CustomerID") | html %]</label>
[% RenderBlockStart("CustomerIDRW") %]
                                <div title="[% Data.CustomerID | html %]"><a href="[% Config("CustomerDBLink") | Interpolate %]" class="AsPopup PopupType_TicketAction" [% Config("CustomerDBLinkTarget") %]>[% Data.CustomerID | html %]</a></div>
[% RenderBlockEnd("CustomerIDRW") %]
[% RenderBlockStart("CustomerIDRO") %]
                                <div title="[% Data.CustomerID | html %]">[% Data.CustomerID | html %]</div>
[% RenderBlockEnd("CustomerIDRO") %]
[% RenderBlockStart("CustomerName") %]
                                <div title="[% Data.CustomerName | html %]">[% Data.CustomerName | html %]</div>
[% RenderBlockEnd("CustomerName") %]
[% RenderBlockEnd("CustomerID") %]
                            </td>
                            <td>
[% RenderBlockStart("FirstResponseTime") %]
                                <label>[% Translate("First Response Time") | html %]</label>
                                <div title="[% Translate("Service Time") | html %]: [% Data.FirstResponseTimeWorkingTime | html %]" class="[% Data.FirstResponseTimeClass | html %]">[% Data.FirstResponseTimeHuman | html %] / [% Data.FirstResponseTimeDestinationDate | Localize("TimeShort") %]</div>
[% RenderBlockEnd("FirstResponseTime") %]
                            </td>
                        </tr>
                        <tr>
                            <td>
[% RenderBlockStart("Type") %]
                                <label>[% Translate("Type") | html %]</label><div title="[% Data.Type | html %]">[% Data.Type | html %]</div>
[% RenderBlockEnd("Type") %]
                            </td>
                            <td>
[% RenderBlockStart("UpdateTime") %]
                                <label>[% Translate("Update Time") | html %]</label>
                                <div title="[% Translate("Service Time") | html %]: [% Data.UpdateTimeWorkingTime | html %]" class="[% Data.UpdateTimeClass | html %]">[% Data.UpdateTimeHuman | html %] / [% Data.UpdateTimeDestinationDate | Localize("TimeShort") %]</div>
[% RenderBlockEnd("UpdateTime") %]
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
[% RenderBlockStart("SolutionTime") %]
                                <label>[% Translate("Solution Time") | html %]</label>
                                <div title="[% Translate("Service Time") | html %]: [% Data.SolutionTimeWorkingTime | html %]" class="[% Data.SolutionTimeClass | html %]">[% Data.SolutionTimeHuman | html %] / [% Data.SolutionTimeDestinationDate | Localize("TimeShort") %]</div>
[% RenderBlockEnd("SolutionTime") %]
                            </td>
                        </tr>

[% RenderBlockStart("DynamicFieldTableRow") %]
                        <tr class="[% Data.Class %]">
[% RenderBlockStart("DynamicFieldTableRowRecord") %]
                            <td>
                                <label>[% Translate(Data.Label) | html %]</label>
[% RenderBlockStart("DynamicFieldTableRowRecordLink") %]
                                <div title="[% Data.Title | html %]"><a href="[% Data.Link | Interpolate %]" target="_blank" class="DynamicFieldLink">[% Data.Value %]</a></div>
[% RenderBlockEnd("DynamicFieldTableRowRecordLink") %]
[% RenderBlockStart("DynamicFieldTableRowRecordPlain") %]
                                <div title="[% Data.Title | html %]"><span>[% Data.Value %]</span></div>
[% RenderBlockEnd("DynamicFieldTableRowRecordPlain") %]
                            </td>
[% RenderBlockEnd("DynamicFieldTableRowRecord") %]
                        </tr>
[% RenderBlockEnd("DynamicFieldTableRow") %]

# example of how to use fixed dynamic field blocks for customizations
# Note: Field1 and Field2 are the names of the fields and had to be replaced with the actual
# field names
#                    <tr>
#[% RenderBlockStart("DynamicField_Field1_TableRowRecord") %]
#                        <td>
#                            <label>[% Translate(Data.Label) | html %]</label>
#[% RenderBlockStart("DynamicField_Field1_TableRowRecordLink") %]
#                            <div title="[% Data.Title | html %]"><a href="[% Data.Link | Interpolate %]" target="_blank" class="DynamicFieldLink">[% Data.Value %]</a></div>
#[% RenderBlockEnd("DynamicField_Field1_TableRowRecordLink") %]
#[% RenderBlockStart("DynamicField_Field1_TableRowRecordPlain") %]
#                            <div title="[% Data.Title | html %]"><span>[% Data.Value %]</span></div>
#[% RenderBlockEnd("DynamicField_Field1_TableRowRecordPlain") %]
#                        </td>
#[% RenderBlockEnd("DynamicField_Field1_TableRowRecord") %]
#                    </tr>
#                    <tr>
#[% RenderBlockStart("DynamicField_Field2_TableRowRecord") %]
#                        <td>
#                            <label>[% Translate(Data.Label) | html %]</label>
#[% RenderBlockStart("DynamicField_Field2_TableRowRecordLink") %]
#                            <div title="[% Data.Title | html %]"><a href="[% Data.Link | Interpolate %]" target="_blank" class="DynamicFieldLink">[% Data.Value %]</a></div>
#[% RenderBlockEnd("DynamicField_Field2_TableRowRecordLink") %]
#[% RenderBlockStart("DynamicField_Field2_TableRowRecordPlain") %]
#                            <div title="[% Data.Title | html %]"><span>[% Data.Value %]</span></div>
#[% RenderBlockEnd("DynamicField_Field2_TableRowRecordPlain") %]
#                        </td>
#[% RenderBlockEnd("DynamicField_Field2_TableRowRecord") %]
#                    </tr>

                    </tbody>
                </table>
            </div>

[% RenderBlockStart("ArticlesPreviewArea") %]
            <div class="Preview">
                <ul class="[% Data.Class | html %]">
[% RenderBlockStart("ArticlePreview") %]
                    <li class="[% Data.Class | html %]">
                        <h3>
                            <a href="#" title="[% Data.From | html %] &ndash; [% Data.Subject | html %] &ndash; [% Data.Created | Localize("TimeShort") %]">
                                <span class="Headline">
                                    [% Data.FromRealname | truncate(50) | html %] &ndash;
                                    <span class="Subject">[% Data.Subject | truncate(70) | html %]</span>
                                </span>
                                <span class="DateTime">[% Data.Created | Localize("TimeShort") %]</span>
                                <span class="Clear"></span>
                            </a>
                        </h3>
                        <div class="HiddenBlock">
[% RenderBlockStart("ArticlePreviewActionRow") %]
                            <div class="ActionRow">
                                <ul class="Actions">
[% RenderBlockStart("ArticlePreviewActionRowItem") %]
                                    <li class="[% Data.Class | html %]">
                                        <form title="[% Translate(Data.Name) | html %]" action="[% Env("CGIHandle") %]" method="post" id="[% Data.FormID | html %]">
                                            <input type="hidden" name="Action" value="[% Data.Action | html %]"/>
                                            <input type="hidden" name="TicketID" value="[% Data.TicketID | html %]"/>
                                            <input type="hidden" name="ArticleID" value="[% Data.ArticleID | html %]"/>
                                            <input type="hidden" name="ReplyAll" value="[% Data.ReplyAll | html %]"/>
                                            <label for="ResponseID[% Data.ArticleID | html %]" class="InvisibleText">[% Translate(Data.Name) | html %]:</label>
                                            [% Data.StandardResponsesStrg %]
                                        </form>
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('#[% Data.FormID | html %] select[name=ResponseID]').bind('change', function (Event) {
        var URL;

        if ($(this).val() > 0) {
            var URL = Core.Config.Get('Baselink') + $(this).parents().serialize();
            Core.UI.Popup.OpenPopup(URL, 'TicketAction');
            // reset the select box so that it can be used again from the same window
            $(this).val('0');
        }
    });
    // make sure this click event does not bubble up to the table row and execute its click handler
    $('#[% Data.FormID | html %] select[name=ResponseID]').bind('click', function (Event) {
        Event.stopPropagation();
        return false;
    });
//]]></script>
[% END %]
                                    </li>
[% RenderBlockEnd("ArticlePreviewActionRowItem") %]
                                </ul>
                                <div class="ClearLeft"></div>
                            </div>
[% RenderBlockEnd("ArticlePreviewActionRow") %]
                            <div class="Content ArticleBody">
[% Data.BodyNote %]
[% Data.Body %]
                            </div>
                        </div>
                    </li>
[% RenderBlockEnd("ArticlePreview") %]
                </ul>
            </div>
[% RenderBlockEnd("ArticlesPreviewArea") %]
            <div class="Clear"></div>
        </div>
    </li>
[% RenderBlockEnd("DocumentContent") %]

[% RenderBlockStart("DocumentFooter") %]
</ul>


<form name="bulk" action="">
    <input type="hidden" name="TicketID" value=""/>
</form>

<form action="[% Env("CGIHandle") %]" method="post" enctype="multipart/form-data" name="matrix">
    <input type="hidden" name="Action" value="AgentTicketBulk"/>
[% RenderBlockStart("DocumentFooterBulkItem") %]
    <input type="hidden" name="TicketID" value=""/>
[% RenderBlockEnd("DocumentFooterBulkItem") %]
    <input type="hidden" name="TicketID" value=""/>
</form>
[% RenderBlockEnd("DocumentFooter") %]

[% RenderBlockStart("DocumentMenuItemMoveForm") %]
<li class="[% Data.Class | html %]">
    <form title="[% Translate("Move ticket to a different queue") | html %]" action="[% Env("CGIHandle") %]" method="get">
        <input type="hidden" name="Action" value="AgentTicketMove"/>
        <input type="hidden" name="QueueID" value="[% Data.QueueID | html %]"/>
        <input type="hidden" name="TicketID" value="[% Data.TicketID | html %]"/>
        <label for="DestQueueID" class="InvisibleText">[% Translate("Change queue") | html %]:</label>
        [% Data.MoveQueuesStrg %]
    </form>
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('.InlineActions, .OverviewActions').on('change', 'select[name=DestQueueID]', function (Event) {
        $(this).closest('form').submit();
    });
//]]></script>
[% END %]
</li>
[% RenderBlockEnd("DocumentMenuItemMoveForm") %]

[% WRAPPER JSOnDocumentComplete %]
[% RenderBlockStart("DocumentReadyActionRowAdd") %]
[% FOREACH MenuElement IN Data.Data %]
    [% MenuElement.Name = Interpolate(MenuElement.Name) %]
    [% MenuElement.Link = Interpolate(MenuElement.Link) %]
    [% MenuElement.Description = Interpolate(MenuElement.Description) %]
[% END %]
<script type="text/javascript">//<![CDATA[
    Core.UI.ActionRow.AddActions($('#TicketID_[% Data.TicketID | html %]'), [% JSON(Data.Data) %]);
//]]></script>
[% RenderBlockEnd("DocumentReadyActionRowAdd") %]
[% RenderBlockStart("DocumentReadyStart") %]
<script type="text/javascript">//<![CDATA[
    Core.UI.InitCheckboxSelection($('div.Checkbox'));
    $('.MasterAction').bind('click', function (Event) {
        var $MasterActionLink = $(this).find('.MasterActionLink');

        // if the user is trying to select text from an article, MasterAction should not be executed
        if (typeof Event.target === 'object' && ($(Event.target).hasClass('ArticleBody') || $(Event.target).hasClass('ActionRow'))) {
            return false;
        }

        // prevent MasterAction on Dynamic Fields links
        if ($(Event.target).hasClass('DynamicFieldLink')) {
            return true;
        }

        // only act if the link was not clicked directly
        if (Event.target !== $MasterActionLink.get(0)) {
            if (Event.ctrlKey || Event.metaKey) {
                window.open($MasterActionLink.attr('href'));
            }
            else {
                window.location = $MasterActionLink.attr('href');
            }
            return false;
        }
    });
    Core.UI.Accordion.Init($('.Preview > ul'), 'li h3 a', '.HiddenBlock');

    if ($('body').hasClass('TouchDevice')) {
        $('ul.InlineActions li:not(.ResponsiveActionMenu)').hide();
    }
    $('li.ResponsiveActionMenu').on('click.ToggleResponsiveActionMenu', function () {
        $(this).siblings().toggle();
        $(this).toggleClass('Opened')
        return false;
    });

    $('.OverviewLarge li').on('mouseenter', function() {
        $(this).find('ul.InlineActions').css('top', '0px');
    });
    $('.OverviewLarge li').on('mouseleave', function(Event) {

        // Workaround for bug#12403: The inlineActions would hide if hovering
        // over the queue selection due to a bug in IE. As this is working fine
        // in MS Edge with the former pure css solution, this whole function
        // TargetNS.InitInlineActions could be dropped as soon as IE11 support is
        // ceased for OTRS. Remember to re-add the needed css in this case:
        //      .OverviewLarge > li:hover ul.InlineActions { top: 0px; }    (Core.OverviewLarge.css)
        //      .OverviewPreview > li:hover ul.InlineActions { top: 0px; }  (Core.OverviewMedium.css)
        if (Event.target.tagName.toLowerCase() === 'select') {
            return false;
        }
        $(this).find('ul.InlineActions').css('top', '-30px');
    });

//]]></script>
[% RenderBlockEnd("DocumentReadyStart") %]
[% END %]