Company name in customer search results

Moderator: crythias

Post Reply
andy1967
Znuny newbie
Posts: 15
Joined: 13 Jun 2012, 08:42
Znuny Version: 3.1.7
Real Name: Andy Grootens

Company name in customer search results

Post by andy1967 »

Hi there!,

I would like to display the company name in the search results on the customer search. I have found a partial solution from Crythias and HervE here viewtopic.php?f=61&t=8576&p=33754&hilit ... mer#p33754

This shows the CompanyID in the results, but now is the question: how to add the company name? Something like this:

https://picasaweb.google.com/lh/photo/p ... feat=email

Any help would be very appreciated!

Kind regards,
Andy
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Company name in customer search results

Post by crythias »

Checking the URL ...
AdminCustomerUser
Kernel/Modules/AdminCustomerUser.pm
seems to grab everything
in sub _Overview

Code: Select all

 my %UserData = $Self->{CustomerUserObject}->CustomerUserDataGet( User => $ListKey );
This gets anything that's in the CustomerUser Map in Config.pm ... it doesn't grab from CustomerCompany.
Use a hint from here: viewtopic.php?t=14215&p=55015
stick a line after that one with a call to

Code: Select all

my %CompanyData = $Self->{CustomerCompanyObject}->CustomerCompanyGet(
                    CustomerID => $UserData{CustomerID},
                );
%UserData{ keys %CompanyData } = values %CompanyData; 
(This isn't tried. It may work, it may not. It assumes no key collisions, and I may have missed a reference or something}

Kernel/Output/HTML/Standard(or your theme)/AdminCustomerUser.dtl

Code: Select all

  <thead>
                        <tr>
                            <th>$Text{"Username"}</th>
                            <th>$Text{"Name"}</th>
                            <th>$Text{"Email"}</th>
                            <th>$Text{"CustomerID"}</th>
                            <th>$Text{"Last Login"}</th>
                            <th>$Text{"Valid"}</th>
                        </tr>
                    </thead>
and

Code: Select all

<tr>
<!-- dtl:block:OverviewResultRowLink -->
                            <td><a class="AsBlock" href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=Change;ID=$LQData{"UserLogin"};Search=$LQData{"Search"};Nav=$LQData{"Nav"}">$QData{"UserLogin"}</a></td>
<!-- dtl:block:OverviewResultRowLink -->
<!-- dtl:block:OverviewResultRowLinkNone -->
                            <td><a class="AsBlock" href="#">$QData{"UserLogin"}</a></td>
<!-- dtl:block:OverviewResultRowLinkNone -->
                            <td>$QData{"UserFirstname"} $QData{"UserLastname"}</td>
                            <td>$QData{"UserEmail"}</td>
                            <td>$QData{"UserCustomerID"}</td>
                            <td>$TimeShort{"$QData{"UserLastLoginTimestamp"}"}</td>
                            <td>$Text{"$Data{"Valid"}"}</td>
                        </tr>
Stick what field you'd expect from CustomerCompany in here.
I probably should have tested this before posting.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply