in older OTRS Version (up to Version 4) i used many output filter to change the output of some .dtl without changing the .dtl.
Couls somebody tell me how I have to do to make my outputfilters work in Version 4?
This doesn't work in Version 4 the same way. Hier ist an exaple:
Code: Select all
package Kernel::Output::HTML::OutputFilterAgentTicketZoom;
use strict;
use warnings;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = \%Param;
bless( $Self, $Type );
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
# check needed objects (needed to be done here because of OTRS 3.0 + Survey package ->
# public.pl?Action=PublicSurvey -> Got no DBObject! at)
for (qw(DBObject EncodeObject TimeObject ConfigObject LogObject MainObject LayoutObject)) {
return if !$Self->{$_};
}
# check needed stuff
if ( !defined $Param{Data} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => 'Need Data!' );
$Self->{LayoutObject}->FatalDie();
}
# return if it's not ticket zoom
return if $Param{TemplateFile} !~ /^(AgentTicketZoom)$/;
# remove not needed fields selection
${ $Param{Data} } =~ s{
(<label>\$Text\{"CustomerID.+?<div\sclass="Clear"></div>)
}
{}sxm;
return $Param{Data};
}
1;
Alejandra Lopez