File: AdminSelectBox.tt

package info (click to toggle)
otrs2 6.0.32-6
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 197,336 kB
  • sloc: perl: 1,003,018; javascript: 75,060; xml: 70,883; php: 51,819; sql: 22,361; sh: 379; makefile: 51
file content (145 lines) | stat: -rw-r--r-- 6,757 bytes parent folder | download
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
# --
# Copyright (C) 2001-2021 OTRS AG, https://otrs.com/
# --
# 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.
# --

<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1 class="InvisibleText">[% Translate("SQL Box") | html %]</h1>

    [% BreadcrumbPath = [
            {
                Name => Translate('SQL Box'),
            },
        ]
    %]

    [% INCLUDE "Breadcrumb.tt" Path = BreadcrumbPath %]

    <div class="SidebarColumn">
[% RenderBlockStart("ResultFilter") %]
        <div class="WidgetSimple">
            <div class="Header">
                <h2><label for="FilterResults">[% Translate("Filter for Results") | html %]</label></h2>
            </div>
            <div class="Content">
                <input type="text" id="FilterResults" class="FilterBox" placeholder="[% Translate("Just start typing to filter...") | html %]" name="FilterResults" value="" title="[% Translate("Filter for results") | html %]">
            </div>
        </div>
[% RenderBlockEnd("ResultFilter") %]
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("Hint") | html %]</h2>
            </div>
            <div class="Content">
[% RenderBlockStart("ExplanationOnlySelect") %]
                <p class="FieldExplanation">
                    [% Translate("Here you can enter SQL to send it directly to the application database. It is not possible to change the content of the tables, only select queries are allowed.") | html %]
                </p>
[% RenderBlockEnd("ExplanationOnlySelect") %]
[% RenderBlockStart("ExplanationAllSqlQueries") %]
                <p class="FieldExplanation">
                    [% Translate("Here you can enter SQL to send it directly to the application database.") | html %]
                </p>
[% RenderBlockEnd("ExplanationAllSqlQueries") %]
            </div>
        </div>
    </div>

    <div class="ContentColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("Options") | html %]</h2>
            </div>
            <div class="Content">

                <form action="[% Env("CGIHandle") %]" method="post" class="Validate" id="AdminSelectBoxForm">
                    <input type="hidden" name="Action" value="[% Env("Action") %]"/>
                    <input type="hidden" name="Subaction" value="Select"/>
                    <fieldset class="TableLike FixedLabelSmall">

                        <label class="Mandatory" for="SQL"><span class="Marker">*</span> [% Translate("SQL") | html %]:</label>
                        <div class="Field">
                            <textarea name="SQL" id="SQL" rows="3" class="W100pc Validate_Required [% Data.SQLInvalid | html %]">[% Data.SQL | html %]</textarea>
                            <div id="SQLError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                            <div id="SQLServerError" class="TooltipErrorMessage">
                                <p>
[% RenderBlockStart("FieldRequiredServerError") %]
                                    [% Translate("This field is required.") | html %]
[% RenderBlockEnd("FieldRequiredServerError") %]
[% RenderBlockStart("SQLIsNotSelectServerError") %]
                                    [% Translate("Only select queries are allowed.") | html %]
[% RenderBlockEnd("SQLIsNotSelectServerError") %]
[% RenderBlockStart("SQLSyntaxServerError") %]
                                    [% Translate("The syntax of your SQL query has a mistake. Please check it.") | html %]
[% RenderBlockEnd("SQLSyntaxServerError") %]
[% RenderBlockStart("BindParamServerError") %]
                                    [% Translate("There is at least one parameter missing for the binding. Please check it.") | html %]
[% RenderBlockEnd("BindParamServerError") %]

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

                        <label for="Max">[% Translate("Limit") | html %]:</label>
                        <div class="Field">
                            <input type="text" name="Max" id="Max" value="[% Data.Max | html %]" class="W50px" />
                        </div>
                        <div class="Clear"></div>

                        <label for="ResultFormat">[% Translate("Result format") | html %]:</label>
                        <div class="Field">
                            [% Data.ResultFormatStrg %]
                        </div>
                        <div class="Clear"></div>

                        <div class="Field SpacingTop">
                            <button class="Primary CallForAction" type="submit" id="Run" value="[% Translate("Run Query") | html %]"><span>[% Translate("Run Query") | html %]</span></button>
                        </div>
                    </fieldset>
                </form>
            </div>
        </div>

[% RenderBlockStart("Result") %]
        <div class="WidgetSimple">
            <div class="Header">
                <h2>[% Translate("%s Results", Data.MatchesFound) | html %]</h2>
            </div>
            <div class="Content">
                <table class="DataTable" id="Results">
                    <thead>
                        <tr>
[% RenderBlockStart("ColumnHead") %]
                            <th>[% Data.ColumnName | html %]</th>
[% RenderBlockEnd("ColumnHead") %]
                        </tr>
                    </thead>
                    <tbody>
[% RenderBlockStart("NoMatches") %]
                        <tr><td colspan="[% Data.Colspan | html %]">[% Translate("No matches found.") | html %]</td></tr>
[% RenderBlockEnd("NoMatches") %]
[% RenderBlockStart("NoSelectResult") %]
                        <tr><td colspan="[% Data.Colspan | html %]">[% Translate("Query is executed.") | html %]</td></tr>
[% RenderBlockEnd("NoSelectResult") %]
[% RenderBlockStart("Row") %]
                        <tr>
[% RenderBlockStart("Cell") %]
                            <td title="[% Data.Content | html %]">[% Data.Content | truncate(80) | html %]</td>
[% RenderBlockEnd("Cell") %]
                        </tr>
[% RenderBlockEnd("Row") %]
                        <tr class="FilterMessage Hidden">
                            <td colspan="999">[% Translate("No matches found.") | html %]</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
[% RenderBlockEnd("Result") %]
    </div>
    <div class="Clear"></div>
</div>