Skip to content

Commit

Permalink
Issue #1938: Localizing the fix for printed by data
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Sep 19, 2022
1 parent 4722195 commit 37aed00
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Kernel/Output/PDF/Ticket.pm
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,8 @@ sub GeneratePDF {
# Get customer info.
my $CustomerUserObject = $Kernel::OM->Get('Kernel::System::CustomerUser');
my %CustomerData;
if ( $Interface{Customer} ) {
%CustomerData = $CustomerUserObject->CustomerUserDataGet(
User => $Param{UserID},
);
}
my %PrintingCustomerData;

elsif ( $Ticket{CustomerUserID} ) {
%CustomerData = $CustomerUserObject->CustomerUserDataGet(
User => $Ticket{CustomerUserID},
Expand All @@ -189,6 +186,17 @@ sub GeneratePDF {
);
}

if ( $Interface{Customer} ) {
%PrintingCustomerData = $CustomerUserObject->CustomerUserDataGet(
User => $Param{UserID},
);
}

if ( !defined %PrintingCustomerData )
{
%PrintingCustomerData = %CustomerData;
}

# Transform time values into human readable form.
$Ticket{Age} = $LayoutObject->CustomerAge(
Age => $Ticket{Age},
Expand Down Expand Up @@ -268,8 +276,8 @@ sub GeneratePDF {
. ', ' . $Time;
}
elsif ( $Interface{Customer} ) {
$PrintedBy .= ' ' . $CustomerData{UserFullname} . ' ('
. $CustomerData{UserEmail} . ')'
$PrintedBy .= ' ' . $PrintingCustomerData{UserFullname} . ' ('
. $PrintingCustomerData{UserEmail} . ')'
. ', ' . $Time;
}

Expand Down

0 comments on commit 37aed00

Please sign in to comment.