init III
This commit is contained in:
61
Perl OTRS/Kernel/Output/HTML/CustomerUser/Generic.pm
Normal file
61
Perl OTRS/Kernel/Output/HTML/CustomerUser/Generic.pm
Normal file
@@ -0,0 +1,61 @@
|
||||
# --
|
||||
# Copyright (C) 2001-2019 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.
|
||||
# --
|
||||
|
||||
package Kernel::Output::HTML::CustomerUser::Generic;
|
||||
|
||||
use parent 'Kernel::Output::HTML::Base';
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $ObjectManagerDisabled = 1;
|
||||
|
||||
sub Run {
|
||||
my ( $Self, %Param ) = @_;
|
||||
|
||||
# check required params
|
||||
my @Params = split /;/, $Param{Config}->{Required};
|
||||
for my $Key (@Params) {
|
||||
return if !$Key;
|
||||
return if !$Param{Data}->{$Key};
|
||||
}
|
||||
|
||||
# get all attributes
|
||||
@Params = split /;/, $Param{Config}->{Attributes};
|
||||
|
||||
# get layout object
|
||||
my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
|
||||
|
||||
# build url
|
||||
my $URL = '';
|
||||
KEY:
|
||||
for my $Key (@Params) {
|
||||
next KEY if !$Param{Data}->{$Key};
|
||||
if ($URL) {
|
||||
$URL .= ', ';
|
||||
}
|
||||
$URL .= $LayoutObject->LinkEncode( $Param{Data}->{$Key} );
|
||||
}
|
||||
$URL = $Param{Config}->{URL} . $URL;
|
||||
|
||||
my $IconName = $Param{Config}->{IconName};
|
||||
|
||||
# generate block
|
||||
$LayoutObject->Block(
|
||||
Name => 'CustomerItemRow',
|
||||
Data => {
|
||||
%{ $Param{Config} },
|
||||
URL => $URL,
|
||||
IconName => $IconName,
|
||||
},
|
||||
);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user