Displaying Company Name (instead of Company ID) ?

Moderator: crythias

Post Reply
RegisK
OTRS newbie
Posts: 4
Joined: 23 Feb 2012, 13:52
OTRS Version?: 30110
Real Name: Regis Karakozian
Company: NAVAHO

Displaying Company Name (instead of Company ID) ?

Post by RegisK » 23 Feb 2012, 13:59

Hello,

Is there a way to display Company Name instead of Company ID in the Queue View ?
In the file "AgentTicketOverviewSmall.dtl", i tried "CustomerCompany" and "CustomerCompanyName" without any success.

Thanks in advance,
Regis

micshi
OTRS wizard
Posts: 191
Joined: 05 Jul 2011, 16:10
OTRS Version?: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

Re: Displaying Company Name (instead of Company ID) ?

Post by micshi » 23 Feb 2012, 15:17

TicketOverviewSmall.pm does not pass Copmany tag to AgentTicketOverviewSmall.dtl.

You need add some code in TicketOverviewSmall.pm to get Company by looking up CustomerID, then pass the Company tag to AgentTicketOverviewSmall.dtl.
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance

RegisK
OTRS newbie
Posts: 4
Joined: 23 Feb 2012, 13:52
OTRS Version?: 30110
Real Name: Regis Karakozian
Company: NAVAHO

Re: Displaying Company Name (instead of Company ID) ?

Post by RegisK » 23 Feb 2012, 18:13

Thanks for this prompt reply.
Could you tell me more about code in TicketOverviewSmall.pm i have to add ?

Regis

majo053
OTRS expert
Posts: 52
Joined: 08 Nov 2011, 17:28
OTRS Version?: 4.0.5

Re: Displaying Company Name (instead of Company ID) ?

Post by majo053 » 26 Feb 2012, 16:13

Hello,

in my opinion it's good idea. micshi can you modify TicketOverviewSmall.pm, please?

Many thanks
OTRS and ITSM 4.0.6 (production), MariaDB Ver 15.1 Distrib 5.5.40-MariaDB, CentOS 7.0.1406 (Core)

micshi
OTRS wizard
Posts: 191
Joined: 05 Jul 2011, 16:10
OTRS Version?: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

Re: Displaying Company Name (instead of Company ID) ?

Post by micshi » 27 Feb 2012, 12:12

Code: Select all

root@helpdesk:/opt/otrs/Kernel/Output/HTML# diff -u TicketOverviewSmall.pm.bak TicketOverviewSmall.pm
--- TicketOverviewSmall.pm.bak  2012-02-27 13:47:12.639548270 +0800
+++ TicketOverviewSmall.pm      2012-02-27 18:08:58.000000000 +0800
@@ -39,6 +39,7 @@

     $Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param);
     $Self->{DynamicFieldObject} = Kernel::System::DynamicField->new(%Param);
+    $Self->{CustomerCompanyObject} = Kernel::System::CustomerCompany->new(%Param);
     $Self->{BackendObject}      = Kernel::System::DynamicField::Backend->new(%Param);

     $Self->{SmallViewColumnHeader}
@@ -167,6 +168,15 @@
                 Space => ' ',
             );

+            my %CustomerCompany;
+            if ( $Article{CustomerID} ) {
+                %CustomerCompany = $Self->{CustomerCompanyObject}->CustomerCompanyGet(
+                    CustomerID => $Article{CustomerID},
+                );
+                if ( $CustomerCompany{CustomerCompanyName} ) {
+                    $Article{CustomerID} = $CustomerCompany{CustomerCompanyName};
+                }
+            }
             # get acl actions
             $Self->{TicketObject}->TicketAcl(
                 Data          => '-',
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance

RegisK
OTRS newbie
Posts: 4
Joined: 23 Feb 2012, 13:52
OTRS Version?: 30110
Real Name: Regis Karakozian
Company: NAVAHO

Re: Displaying Company Name (instead of Company ID) ?

Post by RegisK » 28 Feb 2012, 14:41

Hello,
It is working perfectly.
Thanks a lot !
Regis

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

Re: Displaying Company Name (instead of Company ID) ?

Post by richardf » 14 Oct 2012, 16:10

hello

I made it to work also in the AgentTicketOverviewSmall.dtl for Queue display, and it works great !

in the same type of features, I'd like to do this but for the DASHBOARD ?
I know how to add a new column in the DASHBOARD, but the best I can do today easily, is to show CustomerID, which is not what I want. I want the CustomerName.

I've try to modify DashboardTicketGeneric.pm (in addition of course of AgentDashboardTicketGeneric.dtl for the display), but I cannot get it to show me either nothing or the CompanyID in the best case...

maybe you'll have an idea ?

thanks

richardF

micshi
OTRS wizard
Posts: 191
Joined: 05 Jul 2011, 16:10
OTRS Version?: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

Re: Displaying Company Name (instead of Company ID) ?

Post by micshi » 14 Oct 2012, 16:39

Could you show your modification with diff command for both DashboardTicketGeneric.pm and AgentDashboardTicketGeneric.dtl?
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

Re: Displaying Company Name (instead of Company ID) ?

Post by richardf » 14 Oct 2012, 18:51

hi
thanks for your quick reply.

I'm not an expert in exploiting diff informations, nevertheless I've tried and see below for the answers.
Does this mess makes sense for you ? ;-)

thanks


--- AgentDashboardTicketGeneric_preprod.dtl 2012-10-14 18:22:12.000000000 +0200
+++ AgentDashboardTicketGeneric_original.dtl 2012-10-14 18:22:13.000000000 +0200

@@ -103,24 +103,13 @@
<!-- dtl:block:ContentLargeTicketGenericRowMetaImage -->
</td>
<!-- dtl:block:ContentLargeTicketGenericRowMeta -->
-#modif RFE 14.12.2012
- <td class="W10pc">
- <a href="$Env{"Baselink"}Action=AgentTicketCustomer;TicketID=$LQData{"TicketID"}" class="AsPopup">
- <div title="$QData{"CustomerID"}">$QData{"CustomerCompanyName","15"}</div>
- </a>
-# modif RFE AOUT 2012 - to NOT hide CustomerContact
-# <div title="$QData{"CustomerID"}">$QData{"CustomerID","15"}</div>
- </td>
- <td class="W10pc">
+ <td class="W10pc">
<a href="$Env{"Baselink"}Action=AgentTicketZoom;TicketID=$Data{"TicketID"}" title="$QData{"Title"}" class="AsBlock MasterActionLink">$Data{"TicketNumber"}</a>
</td>
- <td>
- <div title="$QData{"Owner"}">$QData{"Owner","70"}</div>
+ <td class="W50pc">
+ <div title="$QData{"Title"}">$QData{"Title","70"}</div>
</td>
- <td>$QData{"Queue"}</td>
- <td>$QData{"Type"}</td>
- <td>$QData{"Service"}</td>
- <td>$QData{"Time"}</td>
+ <td>$QData{"Time"}</td>
</tr>
<!-- dtl:block:ContentLargeTicketGenericRow -->
<!-- dtl:block:ContentLargeTicketGenericNone -->


--- DashboardTicketGeneric.pm 2012-10-14 18:42:55.000000000 +0200
+++ DashboardTicketGeneric_orig.pm 2012-10-14 17:19:11.000000000 +0200

@@ -14,10 +14,6 @@
use strict;
use warnings;

-#modif RFE. to change CustomerID to CustomerName
-#use Kernel::System::CustomerUser;
-
-
use vars qw($VERSION);
$VERSION = qw($Revision: 1.38.2.1 $) [1];

@@ -35,9 +31,6 @@
{
die "Got no $_!" if ( !$Self->{$_} );
}
-
- #modif RFE. to change CustomerID to CustomerName
- $Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param);

# get current filter
my $Name = $Self->{ParamObject}->GetParam( Param => 'Name' ) || '';
@@ -349,6 +342,7 @@
);
}

+ # show ticket
$Self->{LayoutObject}->Block(
Name => 'ContentLargeTicketGenericRow',
Data => \%Ticket,
@@ -369,16 +363,6 @@
Data => $Item,
);
}
-
- # lookup customer. RFE modif
- my %CustomerUser;
- if ( $Ticket{CustomerUserID} ) {
- %CustomerUser = $Self->{CustomerUserObject}->CustomerUserDataGet(
- User => $Ticket{CustomerUserID},
- );
- }
- my %Data=(%Ticket, %CustomerUser);
-
}
}

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

Re: Displaying Company Name (instead of Company ID) ?

Post by richardf » 14 Oct 2012, 19:26

sorry, little mistake that I've just corrected in AgentDashboardTicketGeneric.dtl:

<div title="$QData{"CustomerID"}">$QData{"CustomerCompanyName","15"}</div>

is indeed :

<div title="$QData{"CustomerID"}">$QData{"CustomerID","15"}</div>

So I'm successful to get CustomerID, but of course, not Customer Name (ie. name of the company and not just an ID...)
:(

richard

micshi
OTRS wizard
Posts: 191
Joined: 05 Jul 2011, 16:10
OTRS Version?: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

Re: Displaying Company Name (instead of Company ID) ?

Post by micshi » 15 Oct 2012, 02:26

Your modification did no thing with customer company Name.

1. In DashboardTicketGeneric.pm, you should get the customer company name by looking up CustomerID and pass it to dtl file.
You need call sub CustomerCompanyGet to get customer company name.

2. In order to show the customer company name, you should insert some code in AgentDashboardTicketGeneric.dtl, simalar like the following:

Code: Select all

<td>$QData{"CustomerCompanyName"}</td>,
or

Code: Select all

<td class="W50pc">
    <div title="$QData{"CustomerCompanyName"}">$QData{"CustomerCompanyName","30"}</div>
</td>
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

Re: Displaying Company Name (instead of Company ID) ?

Post by richardf » 15 Oct 2012, 18:03

hello

thanks.
but indeed, this where I have no clue about : "You need call sub CustomerCompanyGet to get customer company name. "
could you send me some code samples or some links to do so ?
I've tried to do as described for another similar request (TicketOverviewSmall.pm), but it seems it's not exactly the same.

thanks again if you can provide me with more details...

richard

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

Re: Displaying Company Name (instead of Company ID) ?

Post by richardf » 18 Oct 2012, 22:19

I was successful at the end with this feature.
I'm not sure how it works precisely, but it works.

If this helps some of you, here is the code :

Modif 1 : FILE : /opt/otrs/Kernel/Output/HTML/DashboardTicketGeneric.pm :
a) Before # get current filter :
#modif RFE. to change CustomerID to CustomerName
$Self->{CustomerUserObject} = Kernel::System::CustomerUser->new(%Param);

b) Modify \%Ticket before # show ticket flags :
# show ticket
#modif RFE sur Data (old : Data <--> Ticket). 18/10/2012
$Self->{LayoutObject}->Block(
Name => 'ContentLargeTicketGenericRow',
Data => \%Data,
);
c) Add before b) :
# lookup customer. RFE modif . 18/10/2012
my %CustomerUser;
if ( $Ticket{CustomerUserID} ) {
%CustomerUser = $Self->{CustomerUserObject}->CustomerUserDataGet(
User => $Ticket{CustomerUserID},
);
}
my %Data=(%Ticket, %CustomerUser);

Modif 2 : FILE : /opt/otrs/Kernel/Output/HTML/Standard/ AgentDashboardTicketGeneric.dtl

<!-- dtl:block:ContentLargeTicketGenericRowMeta -->
#modif RFE 14.12.2012
<td class="W10pc">
<a href="$Env{"Baselink"}Action=AgentTicketCustomer;TicketID=$LQData{"TicketID"}" class="AsPopup">
<div title="$QData{"CustomerCompanyName"}">$QData{"CustomerCompanyName","15"}</div>
</a>
</td>

richardf
OTRS newbie
Posts: 10
Joined: 01 Jun 2012, 15:37
OTRS Version?: ITSM 3.0.5
Real Name: richard
Company: navaho

SOLVED - Re: Displaying Company Name (instead of Company ID)

Post by richardf » 20 Oct 2012, 18:49

SOLVED

northraxx
OTRS newbie
Posts: 1
Joined: 20 Oct 2012, 20:20
OTRS Version?: 3.0.10
Real Name: Raphael
Company: Intaxia

Re: Displaying Company Name (instead of Company ID) ?

Post by northraxx » 20 Oct 2012, 20:23

Yeah, i was looking for something like this. A lot helped me 8)

____________________________________
Raphael Anter
Designer
Pozycjonowanie

huschfor2
OTRS newbie
Posts: 40
Joined: 15 Apr 2013, 17:42
OTRS Version?: 3.2.3

Re: Displaying Company Name (instead of Company ID) ?

Post by huschfor2 » 16 Apr 2013, 09:11

Hi,

can u tell me how i can display the Customer Name instead of the Company Name?

Post Reply