Re: [otrs] Add CustomerName in Dashboard (OTRS 3.1)

Hello,
i would like to have a Customers Company Name column in my dashboard.
Using: <td>$QData{"CustomerID","26"}</td> works.
But <td>$QData{"CustomerName","26"}</td> ?seems to be Empty. Where do i define the Customer Company Name?
I guess i need some sort of CustomerID -> CustomerName lookup somewhere?
Thanks, Mario
Mario,
I've been looking to add this info myself. Apparently it is not a widely requested (or needed) feature, as the platform is on its nth iteration and its not been added, nor do many search results come up. So perhaps you and I are the rare birds who would like this kind of info visible on the dashboard. I did find this the other day,
http://wiki.otterhub.org/index.php?title=Show_Customer_Data_in_Dashboard
which appears to be for a prior version, but gives hints as to where to start looking. That said, I have not gotten around to adding customer names, but did successfully modify other displayed info within .../otrs/Kernel/Output/HTML/Standard/AgentDashboardTicketGeneric.dtl
As the wiki.otterhub.org hints at, the dashboard module is by default only pulling data specific to tickets, which is why you can get the ID but not the name - due perhaps to how the tables are setup in the database. My next step, when time allows, would be to find and examine the module related to the QueueView, which does display the customer name, to see how its done within other parts of the system.
Good luck with your search.
best, Dominic
okay, then lets patch it! ;-)
Mario
Mario, The link from wiki.otterhub.org was right on the money - though line numbers from the diff were slightly different in my version of OTRS, 3.1.6. I started by editing (made a backup first of course) ../otrs/Kernel/Output/HTML/DashboardTicketGeneric.pm. DashboardTicketGeneric.pm is the perl module that assembles the data which will be pumped into the AgentDashboardTicketGeneric.dtl template. in DashboardTicketGeneric.pm at around line 16 I added: use Kernel::System::CustomerUser; in DashboardTicketGeneric.pm at around at line 35 I added: $Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param); Then, within the "for my $TicketID" loop of DashboardTicketGeneric.pm, at around at line 365 I added: # lookup customer my %CustomerUser; if ( $Ticket{CustomerUserID} ) { %CustomerUser = $Self->{CustomerUserObject}->CustomerUserDataGet( User => $Ticket{CustomerUserID}, ); } my %Data=(%Ticket, %CustomerUser); and finally, I _replaced_ this line within the (# show ticket) $Self->{LayoutObject}->Block section at around line 375: Data => \%Ticket, with: Data => \%Data, Then saved DashboardTicketGeneric.pm -- all of this is as outlined in http://wiki.otterhub.org/index.php?title=Show_Customer_Data_in_Dashboard Next I edited ../otrs/Kernel/Output/HTML/Standard/AgentDashboardTicketGeneric.dtl Apparently, it can get a little site-specific here because of "The tags you'll have available will differ from setup to setup, because they're the tags you've configured in your customer data source". But if you've got a "vanilla system" like me, I guess you can use UserFirstname and UserLastname as I did here within <table class="DataTable"><tr class="MasterAction"> where I modified three td rows at around line 109: <td class="W20pc">
participants (1)
-
Dominic Ridolfo