Problem with adding new fields to customer_company

Moderator: crythias

Locked
nextjp
Znuny newbie
Posts: 10
Joined: 09 May 2014, 10:07
Znuny Version: 3.3.8

Problem with adding new fields to customer_company

Post by nextjp »

Hi there,

I'm in the middle of testing OTRS and I came across a problem which I can't seem to solve myself, since I don't really understand what is going wrong.

Here are some facts first:
OS version: CentOS release 6.5 (Final) (x86_64)
OTRS version: 3.3.6
Installed packages: ITSM Bundle 3.3.6, FAQ 2.3.2, OTRS iPhoneHandle 1.3.1, CustomerCompanyImportExport 1.4.0, CustomerUserImportExport 1.10.0
My problem:

I'm trying to add a phone field to "customer company", but for whatever reason, it doesn't appear on my frontend when I either open up an existing customer company or try to add a new customer company.


As described in http://otrs.github.io/doc/manual/admin/ ... er-backend I added a column to the customer_company table this way:
# mysql -p
mysql> use ptrs;
mysql> ALTER TABLE customer_company ADD phone VARCHAR (250);
mysql> quit
Right after that, I edited /Kernel/Config.pm this way:

Code: Select all

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #
    # CustomerCompany configuration
    # ---------------------------------------------------- #
    $Self->{CustomerCompany} = {
        Name   => 'Database Backend',
        Module => 'Kernel::System::CustomerCompany::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=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

            # 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,
        },

        # 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',    'Customer',   'name',        1, 1, 'var', '', 0 ],
            [ 'CustomerCompanyPhone',   'TEL',        'phone',       1, 0, '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 ],
        ],
    };

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #
    # $DIBI$

    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
So all I've really added is:

Code: Select all

 [ 'CustomerCompanyPhone',   'TEL',        'phone',       1, 0, 'var', '', 0 ],
Last but not least, I restarted services like https, mysqld and of course otrs several times. I also flushed mysql cache, but no change. I pretty much searched the whole net the day regarding this problem, but no luck. Basically it seems pretty easy and I'm under the impression that I did it the way it should be done, but somethings seems wrong tho. I would really appreciate it if somebody could help me or point me in the right direction.

Thank you very much!
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Problem with adding new fields to customer_company

Post by RStraub »

Sorry I cannot help you with the DB-settings, but two things you should do after altering stuff manually, is running these two scripts:

[otrs]/bin/otrs.RebuildConfig.pl
[otrs]/bin/otrs.DeleteCache.pl
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
nextjp
Znuny newbie
Posts: 10
Joined: 09 May 2014, 10:07
Znuny Version: 3.3.8

Re: Problem with adding new fields to customer_company

Post by nextjp »

RStraub wrote:Sorry I cannot help you with the DB-settings, but two things you should do after altering stuff manually, is running these two scripts:

[otrs]/bin/otrs.RebuildConfig.pl
[otrs]/bin/otrs.DeleteCache.pl
Thank you for your reply!

I did run both scripts right now, but sadly without visible changes. Restarted https and ptrs services, but still the same.
It seems to be something else I guess... =(
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Problem with adding new fields to customer_company

Post by crythias »

I did exactly what you said and have the Phone listed in Customer Company Management.
The field, of course, is blank, and will not show on TicketZoom without data.
I've added data within Customer Company management and verified data is in the database (note that you copied as using database ptrs, not database otrs. I'm sure typo, but FYI)
I also verified that the Field shows with the data on TicketZoom
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
nextjp
Znuny newbie
Posts: 10
Joined: 09 May 2014, 10:07
Znuny Version: 3.3.8

Re: Problem with adding new fields to customer_company

Post by nextjp »

crythias wrote:I did exactly what you said and have the Phone listed in Customer Company Management.
The field, of course, is blank, and will not show on TicketZoom without data.
I've added data within Customer Company management and verified data is in the database (note that you copied as using database ptrs, not database otrs. I'm sure typo, but FYI)
I also verified that the Field shows with the data on TicketZoom
Thanks for the reply!
Yeah, that was a typo on my end. OS X autocorrected that to ptrs for some reason (probably thinking of multiple PTRs..). Sorry about that.

Well, thats exactly what I expected from my changes, but instead, if I click on "Customers" in the header navigation and go to "Customer Company Administration" > "+ Add Customer", I get this:

Image

I double checked my configuration like ten times, so I can't really come up with a solution myself. Permissions? Problem with one of the packages installed?

EDIT:
Also, you are mentioning "Customer Company Management". Just to be clear, is "Customer Company Management" and "Customer Company Administration" the same thing?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Problem with adding new fields to customer_company

Post by crythias »

This topic is "Problem with adding new fields to customer_company"
nextjp wrote: As described in http://otrs.github.io/doc/manual/admin/ ... er-backend I added a column to the customer_company table this way:
# mysql -p
mysql> use ptrs;
mysql> ALTER TABLE customer_company ADD phone VARCHAR (250);
mysql> quit
If you want the change to apply to Customer, change customer_user, per that link. Also CustomerUser Map

I made a mistake on my response ... yes, it shows "Customer Management"
I don't know what the problem is for your side. I'm unable to replicate.
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
nextjp
Znuny newbie
Posts: 10
Joined: 09 May 2014, 10:07
Znuny Version: 3.3.8

Re: Problem with adding new fields to customer_company

Post by nextjp »

crythias wrote:This topic is "Problem with adding new fields to customer_company"
nextjp wrote: As described in http://otrs.github.io/doc/manual/admin/ ... er-backend I added a column to the customer_company table this way:
# mysql -p
mysql> use ptrs;
mysql> ALTER TABLE customer_company ADD phone VARCHAR (250);
mysql> quit
If you want the change to apply to Customer, change customer_user, per that link. Also CustomerUser Map

I made a mistake on my response ... yes, it shows "Customer Management"
I don't know what the problem is for your side. I'm unable to replicate.
Thanks for clearing that up. Bummer, seems like I'm on my own with this one. Thank you for your support tho!
Locked