Using external DB for customer information

Moderator: crythias

Locked
persteinar
Znuny newbie
Posts: 2
Joined: 18 Sep 2013, 22:21
Znuny Version: 3.2.1

Using external DB for customer information

Post by persteinar »

Hi,
I have been trying to configure OTRS 3.2 to use an external database (Zencart DB) as customer database, rather than the build-in database.
We are only using phone and e-mail communication, so customers do not need to bed able to authenticate.
As of now, I am able to retrieve user information, but it is not always being displayed.

At the moment, customer information is displayed when I do the following:
* When creating a ticket manually.
* In drop-down menus when I search for a customer.
* Accessing Customer>Customer Management. usernames, email addresses and CustomerIDs are displayed, but names are missing

Where it is missing:
* When I open an existing ticket. The Customer Information-box on the right side displays only "None"
* When opening
* When clicking on a customer in Customer>Customer Management, all fields is empty

Everything else seems to work, There are no SystemLog-events related to the missing customer information.
Are there anyone who know anything about this issue?

Below I have attached the related config from Kernel\Config.pm

Code: Select all

$Self->{CustomerUser} = {
		Name => 'ZenCart',
		Module => 'Kernel::System::CustomerUser::DB',
		Params => {
			# if you want to use an external database, add the
			# required settings
			DSN => 'DBI:mysql:database=c1zencart;host=<IP>',
			User => '<USERNAME>',
			Password => '<PASS>',
			Table => 'customers',
			SourceCharset => 'utf-8',
			DestCharset => 'utf-8',
			CaseSensitive => 0,
		},
		# customer unique id
		CustomerKey => 'customers_id',
		# customer #
		CustomerID => 'customers_id',
		CustomerValid => 1,
		CustomerUserListFields => [ 'customers_firstname', 'customers_lastname', 'customers_email_address' ],
		CustomerUserSearchFields => [ 'customers_email_address', 'customers_lastname', 'customers_id', 'customers_firstname' ],
		CustomerUserSearchPrefix => '*',
		CustomerUserSearchSuffix => '*',
		CustomerUserSearchListLimit => 250,
		CustomerUserPostMasterSearchFields => [ 'customers_email_address' ],
		CustomerUserNameFields => [ 'customers_firstname', 'customers_lastname' ],
		CustomerUserEmailUniqCheck => 1,
	#    # show not own tickets in customer panel, CompanyTickets
	#    CustomerUserExcludePrimaryCustomerID => 0,
	#    # generate auto logins
	    AutoLoginCreation => 0,
	#    AutoLoginCreationPrefix => 'auto',
	#    # admin can change customer preferences
	#    AdminSetPreferences => 1,
	#    # cache time to live in sec. - cache any database queries
	    CacheTTL => 0,
	#    # just a read only source
		ReadOnly => 1,
		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',      'customers_gender',        1, 0, 'var', '', 1 ],
			[ 'UserFirstname',  'Firstname',  'customers_firstname',   1, 1, 'var', '', 1 ],
			[ 'UserLastname',   'Lastname',   'customers_lastname',    1, 1, 'var', '', 1 ],
			[ 'UserLogin',      'Username',   'customers_email_address',        1, 1, 'var', '', 1 ],
			[ 'UserPassword',   'Password',   'customers_password',           0, 0, 'var', '', 1 ],
			[ 'UserEmail',      'Email',      'customers_email_address',        1, 1, 'var', '', 1 ],
			[ 'UserCustomerID', 'CustomerID', 'customers_id',  0, 1, 'var', '', 1 ],
			[ 'UserPhone',      'Phone',      'customers_telephone',        1, 0, 'var', '', 1 ],
			[ 'UserFax',        'Fax',        'customers_fax',          1, 0, 'var', '', 1 ],
			#[ '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',      1,     1, 1, 'int', '', 1 ],
		],
		# default selections
		 Selections => {
		    # UserTitle => {
		        # 'Mr.' => 'm',
		        # 'Mrs.' => 'f',
		    # },
		 },
	};
persteinar
Znuny newbie
Posts: 2
Joined: 18 Sep 2013, 22:21
Znuny Version: 3.2.1

Re: Using external DB for customer information

Post by persteinar »

After a whole day of troubleshooting, I finally found what I did wrong.
I hope that my solution me be of help for somebody else.

What i did (in kernel/Config.pm):
Before:

Code: Select all

CustomerID => 'customers_id'
After:

Code: Select all

CustomerID => 'customers_email_address'
Strangely enough some of the missing customer information was displayed in OTRS 3.1.0 with the wrong configuration.
However, during troubleshooting, I discovered that the kernel/System/CustomerUser/DB.pm had been updated since 3.1.0
Locked