This file is indexed.

/usr/share/otrs/Kernel/System/StandardResponse.pm is in otrs2 3.3.5-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
# --
# Kernel/System/StandardResponse.pm - lib for std responses
# Copyright (C) 2001-2014 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.
# --

package Kernel::System::StandardResponse;

use strict;
use warnings;

use base qw(Kernel::System::StandardTemplate);
use Kernel::System::CacheInternal;
use Kernel::System::Valid;
use Kernel::System::VariableCheck qw(:all);

=head1 NAME

Kernel::System::StandardResponse - auto response lib

=head1 SYNOPSIS

All std response functions. E. g. to add std response or other functions.

StandardResponse is now DEPRECATED and it will be removed in further versions of otrs
Pleae use StandardTemplate instead

=head1 PUBLIC INTERFACE

=over 4

=cut

=item new()

create an object

    use Kernel::Config;
    use Kernel::System::Encode;
    use Kernel::System::Log;
    use Kernel::System::Main;
    use Kernel::System::DB;
    use Kernel::System::StandardResponse;

    my $ConfigObject = Kernel::Config->new();
    my $EncodeObject = Kernel::System::Encode->new(
        ConfigObject => $ConfigObject,
    );
    my $LogObject = Kernel::System::Log->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
    );
    my $MainObject = Kernel::System::Main->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
        LogObject    => $LogObject,
    );
    my $DBObject = Kernel::System::DB->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
        LogObject    => $LogObject,
        MainObject   => $MainObject,
    );
    my $StandardResponseObject = Kernel::System::StandardResponse->new(
        ConfigObject => $ConfigObject,
        LogObject    => $LogObject,
        DBObject     => $DBObject,
        MainObject   => $MainObject,
    );

=cut

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless( $Self, $Type );

    # get needed objects
    for (qw(ConfigObject LogObject DBObject EncodeObject MainObject)) {
        if ( $Param{$_} ) {
            $Self->{$_} = $Param{$_};
        }
        else {
            die "Got no $_!";
        }
    }

    # create additional objects
    $Self->{CacheInternalObject} = Kernel::System::CacheInternal->new(
        %{$Self},
        Type => 'StandardTemplate',
        TTL  => 60 * 60 * 24 * 20,
    );
    $Self->{ValidObject} = Kernel::System::Valid->new( %{$Self} );

    return $Self;
}

=item StandardResponseAdd()

DEPRECATED. This function will be removed in firther versions of otrs.

add new std response

    my $ID = $StandardResponseObject->StandardResponseAdd(
        Name         => 'New Standard Response',
        Response     => 'Thank you for your email.',
        ContentType  => 'text/plain; charset=utf-8',
        TemplateType => 'Answer',                     # or 'Forward' or 'Create'
        ValidID      => 1,
        UserID       => 123,
    );

=cut

sub StandardResponseAdd {
    my ( $Self, %Param ) = @_;

    # compat
    if ( !defined $Param{TemplateType} || !$Param{TemplateType} ) {
        $Param{TemplateType} = 'Answer';
    }
    if ( !defined $Param{Template} || !$Param{Template} ) {
        $Param{Template} = $Param{Response} || '';
    }

    return $Self->StandardTemplateAdd(%Param);
}

=item StandardResponseGet()

DEPRECATED. This function will be removed in firther versions of otrs.

get std response attributes

    my %StandardResponse = $StandardResponseObject->StandardResponseGet(
        ID => 123,
    );

Returns:

    %StandardResponse = (
        ID                  => '123',
        Name                => 'Simple response',
        Comment             => 'Some comment',
        Response            => 'Response content',
        ContentType         => 'text/plain',
        TemplateType        => 'Answer',
        ValidID             => '1',
        CreateTime          => '2010-04-07 15:41:15',
        CreateBy            => '321',
        ChangeTime          => '2010-04-07 15:59:45',
        ChangeBy            => '223',
    );

=cut

sub StandardResponseGet {
    my ( $Self, %Param ) = @_;

    my %Response = $Self->StandardTemplateGet(%Param);

    if ( IsHashRefWithData( \%Response ) ) {
        $Response{Response} = $Response{Template};
        return %Response;
    }

    return;
}

=item StandardResponseDelete()

DEPRECATED. This function will be removed in firther versions of otrs.

delete a standard response

    $StandardResponseObject->StandardResponseDelete(
        ID => 123,
    );

=cut

sub StandardResponseDelete {
    my ( $Self, %Param ) = @_;

    return $Self->StandardTemplateDelete(%Param);
}

=item StandardResponseUpdate()

DEPRECATED. This function will be removed in firther versions of otrs.

update std response attributes

    $StandardResponseObject->StandardResponseUpdate(
        ID           => 123,
        Name         => 'New Standard Response',
        Response     => 'Thank you for your email.',
        ContentType  => 'text/plain; charset=utf-8',
        TemplateType => 'Answer',
        ValidID      => 1,
        UserID       => 123,
    );

=cut

sub StandardResponseUpdate {
    my ( $Self, %Param ) = @_;

    # compat
    if ( !defined $Param{TemplateType} || !$Param{TemplateType} ) {
        $Param{TemplateType} = 'Answer';
    }
    if ( !defined $Param{Template} || !$Param{Template} ) {
        $Param{Template} = $Param{Response} || '';
    }

    return $Self->StandardTemplateUpdate(%Param);
}

=item StandardResponseLookup()

DEPRECATED. This function will be removed in firther versions of otrs.

return the name or the std response id

    my $StandardResponseName = $StandardResponseObject->StandardResponseLookup(
        StandardResponseID => 123,
    );

    or

    my $StandardResponseID = $StandardResponseObject->StandardResponseLookup(
        StandardResponse => 'Std Response Name',
    );

=cut

sub StandardResponseLookup {
    my ( $Self, %Param ) = @_;

    # compat
    if (
        ( !defined $Param{StandardTemplateID} || !$Param{StandardTemplateID} )
        && $Param{StandardResponseID}
        )
    {
        $Param{StandardTemplateID} = $Param{StandardResponseID}
    }
    if (
        ( !defined $Param{StandardTemplate} || !$Param{StandardTemplate} )
        && $Param{StandardResponse}
        )
    {
        $Param{StandardTemplate} = $Param{StandardResponse}
    }

    return $Self->StandardTemplateLookup(%Param);
}

=item StandardResponseList()

DEPRECATED. This function will be removed in firther versions of otrs.

get all valid std responses

    my %StandardResponses = $StandardResponseObject->StandardResponseList();

Returns:
    %StandardResponses = (
        1 => 'Some Name',
        2 => 'Some Name2',
        3 => 'Some Name3',
    );

get all std responses

    my %StandardResponses = $StandardResponseObject->StandardResponseList(
        Valid => 0,
    );

Returns:
    %StandardResponses = (
        1 => 'Some Name',
        2 => 'Some Name2',
    );

=cut

sub StandardResponseList {
    my ( $Self, %Param ) = @_;

    return $Self->StandardTemplateList(%Param);
}

1;

=back

=head1 TERMS AND CONDITIONS

This software is part of the OTRS project (L<http://otrs.org/>).

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 L<http://www.gnu.org/licenses/agpl.txt>.

=cut