I'd like to have a drop down menu instead of the number entry field at Ticket -> People -> Customer -> CustomerID
First time I applied it, I got an error because "OptionStrgHashRef" was replaced by "BuildSelection".
After replacing in my code, too (see below), I got still a error. But I don't know how to solve it:
Code: Select all
Can't call method "BuildSelection" on an undefined value at /opt/otrs//Kernel/Modules/AgentTicketEmail.pm line 3043.
A college gave me something old: (AgentTicketEmail.pm)
Code: Select all
#--Start MyCustomizedFS #1452
my %MyCuCustomerGroup= ();
$MyCuCustomerGroup{SelectedID} = $Param{CustomerID} || '';
my %MyCuCustomerGroups= $Self->{DBObject}->GetTableData(
Table => 'mc_customer_groups',
# Valid => 1,
What => 'id, name'
);
$MyCuCustomerGroups{'999'} = '-';
$Param{'MyCuCustomerIDStrg'} = $Self->{LayoutObject}->OptionStrgHashRef(
Data => \%MyCuCustomerGroups,
Name => 'MyCuCustomerID',
%MyCuCustomerGroup,
);
#--Stop MyCustomizedFS
# get output back
return $Self->{LayoutObject}->Output(TemplateFile => 'AgentTicketEmail', Data => \%Param); # 1469
How I applied it:
Code: Select all
$LayoutObject->Block( #3026
Name => 'RichText',
Data => \%Param,
);
}
#--Start MyCustomizedFS
my %MyCuCustomerGroup= ();
$MyCuCustomerGroup{SelectedID} = $Param{CustomerID} || '';
my $MyCuDBObject = $Kernel::OM->Get('Kernel::System::DB');
$MyCuDBObject->Prepare(SQL => "SELECT id, name FROM mc_customer_groups");
my %MyCuCustomerGroups= $MyCuDBObject->FetchrowArray();
#Table => 'mc_customer_groups',
## Valid => 1,
#What => 'id, name'
#);
$MyCuCustomerGroups{'999'} = '-';
$Param{'MyCuCustomerIDStrg'} = $Self->{LayoutObject}->BuildSelection(
Data => \%MyCuCustomerGroups,
Name => 'MyCuCustomerID',
%MyCuCustomerGroup,
);
#--Stop MyCustomizedFS
# get output back
return $LayoutObject->Output( #3051
Line 3043:
Code: Select all
$Param{'MyCuCustomerIDStrg'} = $Self->{LayoutObject}->BuildSelection( #3043