Hot to show the name instead of CustomerID in the dashboard?

Moderator: crythias

Locked
setecastronomy
Znuny newbie
Posts: 28
Joined: 23 Jun 2014, 11:02
Znuny Version: 3.3.7

Hot to show the name instead of CustomerID in the dashboard?

Post by setecastronomy »

In the agent dashboard I can choose which columns to show (for example in the open ticket panel). I have the possibility to add CustomerID, which has the meaning of Company ID and it can be related to a company in the customer_company. That company has a name which can be easier to read. Is there a way to show that name instead of CustomerID ?

Thanks
Filippo
OTRS 4.0.1 on Ubuntu Linux and Mysql DB
setecastronomy
Znuny newbie
Posts: 28
Joined: 23 Jun 2014, 11:02
Znuny Version: 3.3.7

Re: Hot to show the name instead of CustomerID in the dashbo

Post by setecastronomy »

Spent two days trying to learn a bit of Perl and watching Otrs .pm files.
I also read Show customer data in the Dashboard
At the end I have this dirty solution to share:

1) open DashBoardTicketGeneric.pm of OTRS 3.3.8

2) locate

Code: Select all

$Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param);

and add

Code: Select all

#filippo
	$Self->{CustomerCompanyObject} = Kernel::System::CustomerCompany->new(%Param);
3) locate

Code: Select all

   

                 # get customer name
                    my $CustomerName;
                    if ( $Ticket{CustomerUserID} ) {
                        $CustomerName = $Self->{CustomerUserObject}->CustomerName(
                            UserLogin => $Ticket{CustomerUserID},
                        );
                    }
                    $DataValue = $CustomerName;
                }
After that add

Code: Select all

				#filippo
				elsif ( $Column eq 'CustomerID' ) {

                    # get customer company name
                    my $CustomerCompanyName;
                    if ( $Ticket{CustomerID} ) {
						my %CustomerCompany = $Self->{CustomerCompanyObject}->CustomerCompanyGet(
							CustomerID => $Ticket{CustomerID},);
                        $CustomerCompanyName = $CustomerCompany{CustomerCompanyName};
                        
                    }
                    $DataValue = $CustomerCompanyName;
                }
I think this solution is lost after an upgrade. I would be glad if somebody can suggest a way to make it persistent.

Bye
Filippo
OTRS 4.0.1 on Ubuntu Linux and Mysql DB
setecastronomy
Znuny newbie
Posts: 28
Joined: 23 Jun 2014, 11:02
Znuny Version: 3.3.7

Re: Hot to show the name instead of CustomerID in the dashboard?

Post by setecastronomy »

DashBoardTicketGeneric.pm was deeply changed in OTRS 4 and now the solution I proposed is broken. I'm looking to fix it myself but any help is welcome.
OTRS 4.0.1 on Ubuntu Linux and Mysql DB
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Hot to show the name instead of CustomerID in the dashboard?

Post by reneeb »

There is/was a pull request for this on Github (http://github.com/OTRS/otrs).... Have a look at those...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked