CustomerUser / CustomerID link

Moderator: crythias

Locked
wongounay
Znuny newbie
Posts: 8
Joined: 27 Nov 2015, 16:39
Znuny Version: 4 soon

CustomerUser / CustomerID link

Post by wongounay »

Hello,

When I add a Customer User, I want the field "CustomerID" to match with an existant CustomerID.
Actually it's a blank text field, and I can input anything it will take it anyway...
I need it to be a dropdown list or a text field with autocompletion.

I tried to change CustomerCompanySupport to 0, to 1 in Config.pm and even in Default.pm, it's not changing anything.

Everything I read is related to this parameter.

I really need to have this working, because we have more than 200 clients that can send us some mails, and not everyone is in the database.
So when a new unknown client send a mail, it create a ticket and we have to add him manually to have the ticket linked to the company.

Here is my Config.pm related to CustomerUsers :

Code: Select all

$Self->{CustomerUser1} = {
        Name   => 'myDatabase',
        Module => 'Kernel::System::CustomerUser::DB',
        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=xxxxxxx;host=xxxxxxxxxxx.com',
            User => 'xxxxxxxxxx',
            Password => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
            Table => 'xxxxxxxxxxxxxxxxxxxx',
            ForeignDB => 0,    # set this to 1 if your table does not have create_time, create_by, change_time and change_by fields

            # CaseSensitive will control if the SQL statements need LOWER()
            #   function calls to work case insensitively. Setting this to
            #   1 will improve performance dramatically on large databases.
            CaseSensitive => 0,
        },

        # customer unique id
        CustomerKey => 'email',

        # customer #
        CustomerID             => 'account_no',
        CustomerValid          => 'valid_id',

        # The last field must always be the email address so that a valid
        #   email address like "John Doe" <john.doe@domain.com> can be constructed from the fields.
        CustomerUserListFields => [ 'firstname', 'lastname', 'email' ],

#        CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
        CustomerUserSearchFields           => ['email', 'firstname', 'lastname', 'account_no', 'accountname', 'email'],
        CustomerUserSearchPrefix           => '',
        CustomerUserSearchSuffix           => '*',
        CustomerUserSearchListLimit        => 250,
        CustomerUserPostMasterSearchFields => ['email'],
        CustomerUserNameFields             => ['salutation', 'firstname', 'lastname'],
        CustomerUserEmailUniqCheck         => 1,

        # show now own tickets in customer panel, CompanyTickets
        CustomerUserExcludePrimaryCustomerID => 0,
        # generate auto logins
        AutoLoginCreation => 0,
        # generate auto login prefix
        AutoLoginCreationPrefix => 'auto',
        # admin can change customer preferences
        AdminSetPreferences => 1,
        # use customer company support (reference to company, See CustomerCompany settings)
        CustomerCompanySupport => 1, 
        # cache time to live in sec. - cache any database queries
#        CacheTTL => 60 * 60 * 24,
        CacheTTL => 0,
        # just a read only source
        ReadOnly => 1,
        Map => [

Can someone help me ?
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: CustomerUser / CustomerID link

Post by RStraub »

Well I would suggest updating to 5.x as it's a default feature there.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
wongounay
Znuny newbie
Posts: 8
Joined: 27 Nov 2015, 16:39
Znuny Version: 4 soon

Re: CustomerUser / CustomerID link

Post by wongounay »

Hey, thanks for the fast answer.

The problem is that I want to use KIX4OTRS, and it doesn't support 5.x yet :(
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: CustomerUser / CustomerID link

Post by RStraub »

cape IT (who develop KIX) decided to fork OTRS... I'd assume they are pretty busy right now :)

As of fixing it with 4.x ... Two ideas come to mind:
You could try to attach javascript to the field such that there is an autocompletion, or

You could modify the customerinformationcenter in a way that when you click "add customer" the customerID is prefilled.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
wongounay
Znuny newbie
Posts: 8
Joined: 27 Nov 2015, 16:39
Znuny Version: 4 soon

Re: CustomerUser / CustomerID link

Post by wongounay »

OK thanks, but I just don't understand why changing CustomerCompanySupport has no effect ... Is it disabled ?
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: CustomerUser / CustomerID link

Post by RStraub »

I guess you didn't post the full CustomerUser ? Because it aborts with map.

I enabled the CustomerCompany support outside of the $Self->{CustomerUser} part via:

Code: Select all

    $Self->{CustomerUser}->{CustomerCompanySupport} = 1;
Though your way should work too if the syntax is correct...
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
wongounay
Znuny newbie
Posts: 8
Joined: 27 Nov 2015, 16:39
Znuny Version: 4 soon

Re: CustomerUser / CustomerID link

Post by wongounay »

I just tried to add $Self->{CustomerUser}->{CustomerCompanySupport} = 1;

To 0 or 1 doesn't change anything

And yes I only posted the interesting part of CustomerUser, I guessed the rest was pointless for the situation (I may have guessed wrong)

I also tried to add this parameter to the original Config.pm (the empty sample), and nothing

At this point I think KIX4OTRS has disabled/enabled this by default, and it cannot be changed
tto
Znuny wizard
Posts: 315
Joined: 09 Jan 2007, 15:24
Znuny Version: OTRS 5.0.x
Real Name: Torsten
Company: c.a.p.e. IT GmbH
Location: Chemnitz
Contact:

Re: CustomerUser / CustomerID link

Post by tto »

wongounay wrote:I just tried to add $Self->{CustomerUser}->{CustomerCompanySupport} = 1;
...
At this point I think KIX4OTRS has disabled/enabled this by default, and it cannot be changed
due to improved multiple customerID support in KIX4OTRS there's an additional parameter which has to be set. Please have a look in the documentation that comes with KIX4OTRS. IT should be sth. like CustomerCompanySupportPrimaryCustomerId (not sure If it's exactly that one and cant look it up mobile).

Regards, T.
--
KIX 17.x (fork of OTRS)
Professional KIX-, or OTRS-integration, development and consulting by c.a.p.e. IT - http://www.cape-it.de
For questions and hints regarding KIX(4OTRS) please go to https://forum.kixdesk.com/
Bei Fragen und Hinweisen zu KIX(4OTRS) bitte an https://forum.kixdesk.com/ wenden.
Locked