Displaying Customer Company Information in AgentTicketZoom

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
marianna
Znuny newbie
Posts: 3
Joined: 28 Mar 2013, 09:44
Znuny Version: 3.2.3
Real Name: Marianna
Location: Russia, Yakutsk

Displaying Customer Company Information in AgentTicketZoom

Post by marianna »

Hi there, I'm newbie at otrs, but really want to learn everything about this helpdesk :) Here the solution:

Editing AgentTicketZoom.pm
1. In the beginning of file:

Code: Select all

use Kernel::System::CustomerCompany;
2. In function sub new {} we need to get params from customercompany library:

Code: Select all

$Self->{CustomerCompanyObject} = Kernel::System::CustomerCompany->new(%Param);
3. Line 1338, below #show customer data :

Code: Select all

my %CustomerCompanyData;
    if ( $Ticket{CustomerID} ) {
        %CustomerCompanyData = $Self->{CustomerCompanyObject}->CustomerCompanyGet(CustomerID=>$Ticket{CustomerID});
    }
    $Ticket{CustomerCompanyName}=$CustomerCompanyData{CustomerCompanyName};
    $Self->{LayoutObject}->Block(
        Name => 'CompanyTable',
        Data => \%Ticket,
    );
As you can see, I got data only for CustomerCompanyName and set block's name 'CompanyTable'. You can (if you want) get CustomerCompanyStreet, CustomerCompanyCountry etc. Correct names can be found in mapping (config file).

4. AgentTicketZoom.dtl

Code: Select all

<div class="WidgetSimple">
                <div class="Header">
                        <h2>$Text{"Customer Company Information"}</h2>
                </div>
                <div class="Content">
<!-- dtl:block:CompanyTable -->
                        <label><strong>$Text{"Company"}: </strong></label>
                        $QData{"CustomerCompanyName"}
<!-- dtl:block:CompanyTable -->
                </div>
</div>
So we'll get cute block on the right side with customer's company name.
Really hope it helpful and please excuse my English :)
andyeaust
Znuny newbie
Posts: 5
Joined: 25 Jun 2013, 09:47
Znuny Version: 3.3.9
Company: PLANAT GmbH

Re: Displaying Customer Company Information in AgentTicketZo

Post by andyeaust »

Hy marianna,

thank you for the little tutorial . This is exactly what we Need :D

It runs, but when i insert new lines, like CustomerCompanyStreet it's not shown in the Interface.
Can you say me how i implement a second line?

Thanks for your help
OTRS 3.2.9
Windows 2008R2 with IIS7.5
MSSQL 2008R2
ActivePerl 5.16.3 Build 1603
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Displaying Customer Company Information in AgentTicketZo

Post by crythias »

I haven't needed to do this once I've enabled Customer Company Support.
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
karlelliott
Znuny newbie
Posts: 12
Joined: 17 Jun 2013, 17:15
Znuny Version: 3.2.6
Real Name: Karl Elliott

Re: Displaying Customer Company Information in AgentTicketZo

Post by karlelliott »

Hi.

Following this through and got to step 3.

Unfortunately I cannot find #show customer data.

I am in /opt/otrs/Kernel/Modules/AgentTicketZoom.pm

Using OTRS 3.2.6

Any ideas?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Displaying Customer Company Information in AgentTicketZo

Post by crythias »

There's no need for this as any Company datafield that has data is shown in AgentTicketZoom as long as Company Support is enabled.

or, in 3.2.6 it's after #customer info
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
karlelliott
Znuny newbie
Posts: 12
Joined: 17 Jun 2013, 17:15
Znuny Version: 3.2.6
Real Name: Karl Elliott

Re: Displaying Customer Company Information in AgentTicketZo

Post by karlelliott »

Hi, Thanks for the quick response.

I have Company Support enabled, at least I think I do, but don't see company name in the ticket zoom.

Cheers
yuri0001
Znuny superhero
Posts: 631
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: Displaying Customer Company Information in AgentTicketZo

Post by yuri0001 »

Hi!
If your customers authorized throuth LDAP/AD you need to add section to Config.pm from Default.pm

Code: Select all

    $Self->{CustomerCompany} = {
        Params => {
            # if you want to use an external database, add the
            # required settings
#            DSN  => 'DBI:odbc:yourdsn',
#            Type => 'mssql', # only for ODBC connections
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_company',
#            ForeignDB => 0,    # set this to 1 if your table does not have create_time, create_by, change_time and change_by fields
        },

        # company unique id
        CustomerCompanyKey             => 'customer_id',
        CustomerCompanyValid           => 'valid_id',
        CustomerCompanyListFields      => [ 'customer_id', 'name' ],
        CustomerCompanySearchFields    => ['customer_id', 'name'],
        CustomerCompanySearchPrefix    => '',
        CustomerCompanySearchSuffix    => '*',
        CustomerCompanySearchListLimit => 250,
        CacheTTL                       => 60 * 60 * 24, # use 0 to turn off cache

        Map => [
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
            [ 'CustomerID',             'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
            [ 'CustomerCompanyName',    'Company',    'name',        1, 1, 'var', '', 0 ],
            [ 'CustomerCompanyStreet',  'Street',     'street',      1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyZIP',     'Zip',        'zip',         1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCity',    'City',       'city',        1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCountry', 'Country',    'country',     1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyURL',     'URL',        'url',         1, 0, 'var', '$Data{"CustomerCompanyURL"}', 0 ],
            [ 'CustomerCompanyComment', 'Comment',    'comments',    1, 0, 'var', '', 0 ],
            [ 'ValidID',                'Valid',      'valid_id',    0, 1, 'int', '', 0 ],
        ],
    };
for each backend.
Only for database this section presents in Default.pm
After it all Company information you will see in Customer Informatiom frame in AgentTicketZoom. :?
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
Post Reply