Output Filer in OTRS 4

English! place to talk about development, programming and coding
Post Reply
allo9615
Znuny newbie
Posts: 14
Joined: 13 Mar 2015, 13:59
Znuny Version: 3.2.9
Real Name: Alejandra Lopez
Company: TU Ilmenau

Output Filer in OTRS 4

Post by allo9615 »

Hi,
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;
Thank you
Alejandra Lopez
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Output Filer in OTRS 4

Post by reneeb »

Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply