File: AgentLinkObject.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 (173 lines) | stat: -rw-r--r-- 7,242 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
# --
# 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("Link") %]
<div class="LayoutPopup ARIARoleMain">

    <div class="Header">
        <h1>
            [% Translate("Link Object: %s", Data.SourceObjectLong) | html %]
        </h1>
        <p>
            <a href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=Close" id="LinkAddCloseLink">[% Translate("Close dialog") | html %]</a>

[% RenderBlockStart("LinkAddTemporaryLink") %]
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('#LinkAddCloseLink').bind('click', function (Event) {
        window.close();
        return false;
    });
//]]></script>
[% END %]
[% RenderBlockEnd("LinkAddTemporaryLink") %]

[% RenderBlockStart("LinkMenuDelete") %]
            [% Translate("or") | html %]
            <a href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=LinkDelete;Mode=[% Data.Mode | uri %];SourceObject=[% Data.SourceObject | uri %];SourceKey=[% Data.SourceKey | uri %];TargetIdentifier=[% Data.TargetIdentifier | uri %]">
                [% Translate("go to link delete screen") | html %]
            </a>
[% RenderBlockEnd("LinkMenuDelete") %]

        </p>
    </div>

    <div class="Content">
        <form action="[% Env("CGIHandle") %]" method="post" name="compose" id="LinkSearchForm">
            <input type="hidden" name="Action" value="[% Env("Action") %]" />
            <input type="hidden" name="Mode" value="[% Data.Mode | html %]" />
            <input type="hidden" name="SourceObject" value="[% Data.SourceObject | html %]" />
            <input type="hidden" name="SourceKey" value="[% Data.SourceKey | html %]" />

            <div class="WidgetSimple">
                <div class="Header">
                    <h2>[% Translate("Select Target Object") | html %]</h2>
                </div>
                <div class="Content">
                    <fieldset class="TableLike">
                        <label for="TargetIdentifier">
                            [% Translate("Link object %s with", Data.SourceObjectNormal) | html %]:
                        </label>
                        <div class="Field">
                            [% Data.TargetObjectStrg %]
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('#TargetIdentifier').bind('change', function (Event) {
        $('#SubmitSelect').addClass('gotclicked');
        $(this).closest('form').submit();
    });
    // Two submits in this form
    // if SubmitSelect or AddLinks button was clicked,
    // add "gotclicked" class to this button
    $('#SubmitSelect, #AddLinks').bind('click.Submit', function () {
       $('#SubmitSelect').addClass('gotclicked');
    });

    $('#LinkSearchForm').submit(function () {
        // If SubmitSelect button was clicked,
        // "gotclicked" was added as class to the button
        // remove the class and do the search
        if ( $('#SubmitSelect').hasClass('gotclicked') ) {
            $('#SubmitSelect').removeClass('gotclicked');
            return true;
        }

        var SearchValueFlag = false;
        $('#LinkSearchForm input, #LinkSearchForm select').each(function () {
            if ( $(this).attr('name') && $(this).attr('name').match(/^SEARCH\:\:/) ) {
                if ( $(this).val() && $(this).val() !== '' ) {
                    SearchValueFlag = true;
                }
            }
        });

        if ( !SearchValueFlag ) {
           alert(Core.Config.Get('EmptySearchMsg'));
           return false;
        }
    });
//]]></script>
[% END %]
                            <button type="submit" id="SubmitSelect" name="SubmitSelect" value="[% Translate("Select") | html %]">[% Translate("Select") | html %]</button>
                        </div>
                    </fieldset>
                </div>
            </div>

            <div class="WidgetSimple">
                <div class="Header">
                    <h2>[% Translate("Search") | html %] [% Data.TargetRealname | html %]</h2>
                </div>
                <div class="Content">
                    <fieldset class="TableLike FixedLabel">
[% RenderBlockStart("LinkSearchRow") %]
                        <label for="[% Data.FormKey | html %]">
                            [% Translate(Data.Name) | html %]:
                        </label>
                        <div class="Field">
                            [% Data.InputStrg %]
                        </div>
[% RenderBlockEnd("LinkSearchRow") %]
                        <div class="Field">
                            <button type="submit" id="SubmitSearch" name="SubmitSearch" class="CallForAction" value="[% Translate("Search") | html %]"><span><i class="fa fa-search"></i> [% Translate("Search") | html %]</span></button>
                        </div>
                    </fieldset>
                </div>
            </div>

[% RenderBlockStart("LinkTableComplex") %]
            [% Data.LinkTableStrg %]
[% RenderBlockEnd("LinkTableComplex") %]
        </form>
    </div>
</div>
[% RenderBlockEnd("Link") %]

[% RenderBlockStart("Delete") %]
<div class="LayoutPopup ARIARoleMain">

    <div class="Header">
        <h1>
            [% Translate("Unlink Object: %s", Data.SourceObjectNormal) | html %]
        </h1>
        <p>
            <a href="[% Env("Baselink") %]Action=[% Env("Action") %];Subaction=Close" id="LinkDeleteCloseLink">[% Translate("Close dialog") | html %]</a>

[% RenderBlockStart("LinkDeleteTemporaryLink") %]
[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('#LinkDeleteCloseLink').bind('click', function (Event) {
        window.close();
        return false;
    });
//]]></script>
[% END %]
[% RenderBlockEnd("LinkDeleteTemporaryLink") %]

            [% Translate("or") | html %]
            <a href="[% Env("Baselink") %]Action=[% Env("Action") %];Mode=[% Data.Mode | uri %];SourceObject=[% Data.SourceObject | uri %];SourceKey=[% Data.SourceKey | uri %];TargetIdentifier=[% Data.TargetIdentifier | uri %]" class="menuitem">
                [% Translate("go to link add screen") | html %]
            </a>
        </p>
    </div>
    <div class="Content">
        <h2>[% Translate("Select Target Object") | html %]</h2>
        <form action="[% Env("CGIHandle") %]" method="get">
            <input type="hidden" name="Action" value="[% Env("Action") %]" />
            <input type="hidden" name="Subaction" value="LinkDelete" />
            <input type="hidden" name="Mode" value="[% Data.Mode | html %]" />
            <input type="hidden" name="SourceObject" value="[% Data.SourceObject | html %]" />
            <input type="hidden" name="SourceKey" value="[% Data.SourceKey | html %]" />
            <input type="hidden" name="TargetIdentifier" value="[% Data.TargetIdentifier | html %]" />
[% RenderBlockStart("DeleteTableComplex") %]
            [% Data.LinkTableStrg %]
[% RenderBlockEnd("DeleteTableComplex") %]
        </form>
    </div>
</div>
[% RenderBlockEnd("Delete") %]