Step 1:
Take a copy of OTRS\Kernel\System\TicketSearch.pm and paste it into OTRS\Custom\Kernel\System\TicketSearch.pm
Any files copied like this automatically get used instead of the default. Prevents it from being overwritten when upgrading.
Step 2:
Edit OTRS\Custom\Kernel\System\TicketSearch.pm:
Just underneath
Code: Select all
# add ticket flag table
if ( $Param{TicketFlag} ) {
my $Index = 1;
for my $Key ( sort keys %{ $Param{TicketFlag} } ) {
$SQLFrom .= "INNER JOIN ticket_flag tf$Index ON st.id = tf$Index.ticket_id ";
$Index++;
}
}
Code: Select all
# add customer user table
my $SQLFrom .= "LEFT JOIN customer_user cu ON st.customer_user_id = cu.login ";
# add user table for owners
my $SQLFrom .= "INNER JOIN users ou ON st.user_id = ou.id ";
# add user table for responsible
my $SQLFrom .= "INNER JOIN users ru ON st.responsible_user_id = ru.id ";
Code: Select all
# other ticket stuff
my %FieldSQLMap = (
TicketNumber => 'st.tn',
Title => 'st.title',
CustomerID => 'st.customer_id',
CustomerUserLogin => 'st.customer_user_id',
Code: Select all
# other ticket stuff
my %FieldSQLMap = (
TicketNumber => 'st.tn',
Title => 'st.title',
CustomerID => 'st.customer_id',
CustomerUserLogin => 'st.customer_user_id',
CustomerUserFirstName => 'cu.first_name',
CustomerUserLastName => 'cu.last_name',
OwnerFirstName => 'ou.first_name',
OwnerLastName => 'ou.last_name',
ResponsibleFirstName => 'ru.first_name',
ResponsibleLastName => 'ru.last_name',
);
Step 3:
Edit your .dtl file (e.g. OTRS\Kernel\Output\HTML\[ThemeName]\AgentDashboardTicketGeneric.dtl
Now instead of only having $QData{"Owner"} or $QData{"Responsible"} which just show user logins, you can now use $QData{"OwnerFirstName"} etc. as defined in TicketSearch.pm
Let me know if you found this useful! I'll be answering questions.