[SOLVED] How to add a drop down list / date picker to fields on Edit Customer User screen

Moderator: crythias

Post Reply
JDavis
Znuny newbie
Posts: 24
Joined: 28 Feb 2019, 10:50
Znuny Version: 6.0.16
Real Name: Jeffrey Taavettilan-Davis
Company: USNR

[SOLVED] How to add a drop down list / date picker to fields on Edit Customer User screen

Post by JDavis »

I am using OTRS 6.0.16 on Ubuntu 18.04 with mariadb

In the customer user administration to add / edit a customer The country field does not have a drop down list to pick a country name from.
in the customer company administration there is a drop down list for this field.

I have three questions related to the fields on this screen:
1. When using the form Customer User Management | Edit Customer User how can I have the country field have the same drop down list for country names like the edit customer company form has?

2. I have added a few extra columns to the customer user table and I do have them being displayed on the screens throughout the system. A couple of these extra fields I have added are date fields in the database table. How can I on this same Edit Customer User screen have a date / calendar picker for these fields instead of just typing in the dates?

3. I have a great deal of data in the database (14.5 years worth) and have various other custom columns in the customer_user table. How without replacing all the data in these custom table columns in the database to new dynamic fields in the system, can I create a drop down list for these columns on this screen.

Any help on these would be greatly appreciated.
Last edited by JDavis on 06 Mar 2019, 00:34, edited 1 time in total.
JDavis
Znuny newbie
Posts: 24
Joined: 28 Feb 2019, 10:50
Znuny Version: 6.0.16
Real Name: Jeffrey Taavettilan-Davis
Company: USNR

Re: How to add a drop down list / date picker to fields on Edit Customer User screen

Post by JDavis »

I am just looking for an answer to my first question now below, if anyone can explain to me what I can do to solve it.
I am using OTRS 6.0.16 on Ubuntu 18.04 with mariadb

In the customer user administration to add / edit a customer The country field does not have a drop down list to pick a country name from.
in the customer company administration there is a drop down list for this field.

I have this one remaining question related to the fields on this screen:
1. When using the form Customer User Management | Edit Customer User how can I have the country field have the same drop down list for country names like the edit customer company form has?

I solved the other two questions by scripting all my custom table columns to new dynamic fields in OTRS associated with the customer_user and customer_company data using the otrs tables: dynamic_field, dynamic_field_obj_id_name, and dynamic_field_obj_id_name. I have added the mappings to the Config.pm file.
I am still the process of this scripting but it what I have done so far looks good. I figured since I have used OTRS for quite awhile (version 3 on windows) that now updating to version 6 on Linux I may as well make use of as many of the features the new version has to make it easier going forward.
root
Administrator
Posts: 3968
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: How to add a drop down list / date picker to fields on Edit Customer User screen

Post by root »

Hi,

Add a Selections part into your CustomerUser configuration in Kernel/Config.pm after the mapping. If it's not in this file copy the relevant part from Kernel/Config/Defaults.pm into it. Do not modify Defaults.pm!

Could look like this:

Code: Select all

Selections => {
  UserCountry => {
    '' => '',
    'US' => 'US',
    'CA' => 'CA',
    'MX' => 'MX',
  },
}
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
JDavis
Znuny newbie
Posts: 24
Joined: 28 Feb 2019, 10:50
Znuny Version: 6.0.16
Real Name: Jeffrey Taavettilan-Davis
Company: USNR

Re: How to add a drop down list / date picker to fields on Edit Customer User screen

Post by JDavis »

Thank you Roy.

I grabbed a iso list of country names from online and put into the section as suggested, remembering to escape any single quotes in country names with a backslash \ and it all works.
JDavis
Znuny newbie
Posts: 24
Joined: 28 Feb 2019, 10:50
Znuny Version: 6.0.16
Real Name: Jeffrey Taavettilan-Davis
Company: USNR

Re: How to add a drop down list / date picker to fields on Edit Customer User screen

Post by JDavis »

Thank you Roy.

I grabbed an iso list of country names from online and put into the section as suggested, remembering to escape any single quotes in country names with a backslash \ and it all works.
Post Reply