Extern information for clients

Moderator: crythias

Locked
PepeMadrid
Znuny newbie
Posts: 6
Joined: 28 May 2014, 10:51
Znuny Version: 3.3.7
Real Name: Pepe Madrid Molina

Extern information for clients

Post by PepeMadrid »

Hi, I'm quite new in otrs and have a question.

I've linked successfully ticket customers from an external database(postgres), and now I'm able to select the customer when creating a ticket.

However, I don't know how to show on the right place the info of the customer when viewing the ticket created. Could anybody show me how to link the customer info to be shown in a ticket on the right?

Image

This is the code of my Config.pm related to linking of an external database

$Self->{CustomerUser} = {
Module => 'Kernel::System::CustomerUser::DB',
Params => {
DSN => 'DBI:Pg:database=wifib;host=127.0.0.1',
# DSN => 'DBI:Pg:database=wifib;host=127.0.0.1',
User => 'XXXXXX',
Password => 'XXXXXXX',
Table => 'clientes',
#SourceCharset => 'utf-8',
#DestCharset => 'iso-8859-1',
},

# customer uniq id
CustomerKey => 'codcliente',

# customer #
CustomerID => 'codcliente',
#CustomerValid => 'debaja',
CustomerUserListFields => ['nombre', 'email'],
CustomerUserSearchFields => ['nombre', 'email','codcliente'],
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => ['nombre'],
ReadOnly => 1,

Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown, required, storage-type,http-link
[ 'UserCustomerID', 'CodCliente', 'codcliente', 1, 0,'var' ],
[ 'UserLogin', 'Nombre', 'nombre', 1, 1, 'var' ],
[ 'UserEmail', 'email', 'email', 1, 1, 'var' ],
],
};

Thanks a lot.
I've already asked the same in spanish but maybe this could be more universal.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Extern information for clients

Post by crythias »

What do you expect to be there? You're only referencing three fields ...
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
PepeMadrid
Znuny newbie
Posts: 6
Joined: 28 May 2014, 10:51
Znuny Version: 3.3.7
Real Name: Pepe Madrid Molina

Re: Extern information for clients

Post by PepeMadrid »

Thanks a lot @crithias,
I want to display on the right side of the form where there is the Customer Info some fields of the Customer table I reference.
I have referenced only the search fields and now I want to reference the info fields.

I don't know how to indicate wich fields of the table will be shown in there.

Thanks so much.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Extern information for clients

Post by crythias »

Look at the documentation for the code you used to create the Map.
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
PepeMadrid
Znuny newbie
Posts: 6
Joined: 28 May 2014, 10:51
Znuny Version: 3.3.7
Real Name: Pepe Madrid Molina

Re: Extern information for clients

Post by PepeMadrid »

I've been reading the documentation.

http://otrs.github.io/doc/manual/admin/ ... ckend.html

And I haven't been able to show the customer info on the right side of the form.

The fields that I want to show from my external postgres database are:
email, codcliente, nombre

I've seen that the table customer_user in otrs has the following fields expected not to be null:
login,email,customer_id,first_name,last_name,valid_id


So I have tried the following Map:
Map => [
# var, frontend, storage, shown, required, storage-type,http-link
['email','Username','login',1,1,'var','',0],
['email','Email','email',1,1,'var','',0],
['codcliente','CustomerID','customer_id',0,1,'var','',0],
['nombre','Firstname','first_name',1,1,'var','',0 ],
['nombre','Lastname','last_name',0,1,'var','',0],
['codcliente','Valid','valid_id',0,1,'int','',0],
]

What am I doing wrong?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Extern information for clients

Post by crythias »

You are translating field names.
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
PepeMadrid
Znuny newbie
Posts: 6
Joined: 28 May 2014, 10:51
Znuny Version: 3.3.7
Real Name: Pepe Madrid Molina

Re: Extern information for clients

Post by PepeMadrid »

Could you explain me wich are the fields expected in each column?

What I thought:
1: external postgres field name
2: Don't know (tried a name to be shown)
3: otrs db field name
4: shown (1=true)
5: required(1=true)
6: storage-type(var=string, int=int)
7. link

I'm sure I'll be wrong, but I can manage how to put it.

Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Extern information for clients

Post by crythias »

Code: Select all

  Map => [
        # note: Login, Email and CustomerID needed!
        # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
        [ 'UserTitle',      'Title',      'title',      1, 0, 'var', '', 0 ],
        [ 'UserFirstname',  'Firstname',  'first_name', 1, 1, 'var', '', 0 ],
        [ 'UserLastname',   'Lastname',   'last_name',  1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'login',      1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',         0, 0, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',      1, 1, 'var', '', 0 ],

#        [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],

#        [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
        [ 'UserPhone',        'Phone',       'phone',        1, 0, 'var', '', 0 ],
        [ 'UserFax',          'Fax',         'fax',          1, 0, 'var', '', 0 ],
        [ 'UserMobile',       'Mobile',      'mobile',       1, 0, 'var', '', 0 ],
        [ 'UserStreet',       'Street',      'street',       1, 0, 'var', '', 0 ],
        [ 'UserZip',          'Zip',         'zip',          1, 0, 'var', '', 0 ],
        [ 'UserCity',         'City',        'city',         1, 0, 'var', '', 0 ],
        [ 'UserCountry',      'Country',     'country',      1, 0, 'var', '', 0 ],
        [ 'UserComment',      'Comment',     'comments',     1, 0, 'var', '', 0 ],
        [ 'ValidID',          'Valid',       'valid_id',     0, 1, 'int', '', 0 ],
    ],
1) OTRS internal variable
2) Display label
3) storage = database field/column name
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
PepeMadrid
Znuny newbie
Posts: 6
Joined: 28 May 2014, 10:51
Znuny Version: 3.3.7
Real Name: Pepe Madrid Molina

Re: Extern information for clients

Post by PepeMadrid »

Thanks for your response,

I've tried this approach, inserting on the third place the field of my postgres external database, but I'll be doing something wrong because it's not working.

Code: Select all

$Self->{'Ticket::Frontend::CustomerInfoCompose'} = 1;
    $Self->{'Ticket::Frontend::CustomerInfoZoom'} = 1;
        $Self->{CustomerUser} = {
                Module => 'Kernel::System::CustomerUser::DB',
                Params => {
.
.
.
                },

                # customer uniq id
                CustomerKey => 'codcliente',

                # customer #
                CustomerID => 'codcliente',
                #CustomerValid => 'debaja',
                CustomerUserListFields => ['nombre', 'email'],
                CustomerUserSearchFields => ['nombre', 'email','codcliente'],
                CustomerUserPostMasterSearchFields => ['email'],
                CustomerUserNameFields => ['nombre'],
                #ReadOnly => 1,

                Map => [
                        # note: Login, Email and CustomerID needed!
                        # var, frontend, storage, shown, required, storage-type,http-link

							['UserLogin','Username','nombre',1,1,'var','',0],
							['UserEmail','Email','email',1,1,'var','',0],
							['UserCustomerID','CustomerID','codcliente',0,1,'var','',0],
							#['UserFirstname','Firstname','nombre',1,1,'var','',0 ],
							#['UserLastname','Lastname','nombre',1,1,'var','',0],
							#['UserPassword','Password','nombre',0,0,'var','',0],
							#['ValidID','Valid','codcliente',0,1,'int','',0],
                        ]

};
Could you explain me what am I doing wrong?
Thank you so much.
Last edited by crythias on 30 May 2014, 14:37, edited 1 time in total.
Reason: [code] tags
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Extern information for clients

Post by crythias »

I can't fix not working. Error messages or screen shots are helpful.
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
Locked