[Gelöst] CustomerCompanySupport

Hilfe zu Znuny Problemen aller Art
Locked
Bernie29A
Znuny newbie
Posts: 11
Joined: 09 May 2012, 15:52
Znuny Version: 3.2.8
Real Name: Julian

[Gelöst] CustomerCompanySupport

Post by Bernie29A »

Hallo OTRS-Gemeinde,

nachdem ich jetzt schon zwei Tage erfolglos versucht habe, das World-Wide-Web abzugrasen stelle ich meine Frage doch mal hier, in der Hoffnung, jemand kann mir auf die Sprünge helfen:

Ich habe gelesen, dass man mit der Aktivierung des CustomerCompanySupport Flags in der Config.pm ein Drop-Down-Menü für die Kundennummer beim Anlegen eines neuen Kunden erreichen kann. Ich hoffe, das soweit schon einmal richtig verstanden zu haben.

Mein Problem ist jetzt aber, dass das bei mir einfach nicht funktionieren will. Ich habe die Abschnitte CustomUser und CustomerCompany aus der Default.pm in die Config.pm übernommen und auch den Eintrag CustomerCompanySupport => 1 gesetzt.
Aber es ändert sich nichts, wenn ich im Admin-Bereich einen neuen Kunden-Benutzer anlegen möchte. Hier bleibt es unter Kundennummer bei einem Textfeld.

Habe ich noch irgendetwas übersehen? Muss noch ein Menüpunkt beachtet werden?

Ich hoffe wirklich, mir kann an dieser Stelle jemand helfen ...

Vielen Dank schon mal und beste Grüße,
Julian

Hier mal der Abschnitt aus der Config.pm - im Prinzip alles Standard aus der Default.pm

Code: Select all

#--- CompanyUser ---#
    # CustomerUser
    # (customer user database backend and settings)
    $Self->{CustomerUser} = {
        Name   => 'Database Backend',
        Module => 'Kernel::System::CustomerUser::DB',
        Params => {
            # if you want to use an external database, add the
            # required settings
#            DSN => 'DBI:odbc:yourdsn',
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_user',
            # if your frontend is unicode and the charset of your
            # customer database server is iso-8859-1, use these options.
#           SourceCharset => 'iso-8859-1',
#           DestCharset => 'utf-8',

            # 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 => 'login',

        # customer #
        CustomerID             => 'customer_id',
        CustomerValid          => 'valid_id',
        CustomerUserListFields => [ 'first_name', 'last_name', 'email' ],

#        CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
        CustomerUserSearchFields           => [ 'login', 'first_name', 'last_name', 'customer_id' ],
        CustomerUserSearchPrefix           => '*',
        CustomerUserSearchSuffix           => '*',
        CustomerUserSearchListLimit        => 250,
        CustomerUserPostMasterSearchFields => ['email'],
        CustomerUserNameFields     => [ 'title', 'first_name', 'last_name' ],
        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 => 0,
#        # just a read only source
#        ReadOnly => 1,
              # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target, link class(es)
            [ '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, '', 'AsPopup OTRSPopup_TicketAction' ],
            [ '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 ],
        ],

        # default selections
        Selections => {

            UserTitle => {
                'Herr' => 'Herr',
                'Frau' => 'Frau',
            },
        },
    };
#--- End CompanyUser ---#
#--- CustomerCompany ---#
    $Self->{CustomerCompany} = {
        Params => {
            # if you want to use an external database, add the
            # required settings
#            DSN => 'DBI:odbc:yourdsn',
#            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
        },

        # company unique id
        CustomerCompanyKey          => 'customer_id',
        CustomerCompanyValid        => 'valid_id',
        CustomerCompanyListFields   => [ 'customer_id', 'name' ],
        CustomerCompanySearchFields => ['customer_id', 'name'],
        CustomerCompanySearchPrefix => '',
        CustomerCompanySearchSuffix => '*',
        CustomerCompanySearchListLimit => 250,
        Map                       => [

# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
            [ 'CustomerID',             'CustomerID', 'customer_id',  0, 1, 'var', '', 0 ],
            [ 'CustomerCompanyName',    'Company',    'name',         1, 1, '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 ],
            [ 'CustomerCompanyPhone',   'Phone',      'phone',        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 ],
        ],
    };
#--- End CustomerCompany ---#     Map => [

Last edited by Bernie29A on 06 Mar 2013, 16:29, edited 1 time in total.
OTRS 3.2.8 - MySQL Database | Kix4OTRS 5.0 | SLES11SP2
Bernie29A
Znuny newbie
Posts: 11
Joined: 09 May 2012, 15:52
Znuny Version: 3.2.8
Real Name: Julian

Re: CustomerCompanySupport

Post by Bernie29A »

So, nachdem ich nochmal damit gekämpft habe, bin ich auf des Rätsels Lösung gestoßen, die ich der Community natürlich nicht vorenthalten möchte :)

KIX4OTRS spuckt hier ein bisschen in die Suppe - zumindest, so lange man es nicht weiß:

In der Datei <otrs-home>/KIX4OTRS/Kernel/Modules/AdminCustomerUser.pm nach folgenden Block suchen (ca. Zeile 815) und die aus- und ein-kommentierten Zeilen drehen.
Vorher:

Code: Select all

        # KIX4OTRS-capeIT
        #        elsif (
        #            $Entry->[0] =~ /^UserCustomerID$/i
        #            && $Self->{ConfigObject}->Get( $Param{Source} )->{CustomerCompanySupport}
        #            )
        elsif (
            $Entry->[0] =~ /^UserCustomerID$/i
            && $Self->{ConfigObject}->Get( $Param{Source} )->{CustomerCompanySupport}
            && $Self->{ConfigObject}->Get( $Param{Source} )
            ->{CustomerCompanySupportPersonalCustomerID}
            )

        # EO KIX4OTRS-capeIT
Nachher:

Code: Select all

        # KIX4OTRS-capeIT
                elsif (
                    $Entry->[0] =~ /^UserCustomerID$/i
                    && $Self->{ConfigObject}->Get( $Param{Source} )->{CustomerCompanySupport}
                    )
        #elsif (
        #    $Entry->[0] =~ /^UserCustomerID$/i
        #    && $Self->{ConfigObject}->Get( $Param{Source} )->{CustomerCompanySupport}
        #    && $Self->{ConfigObject}->Get( $Param{Source} )
        #    ->{CustomerCompanySupportPersonalCustomerID}
        #    )
        # EO KIX4OTRS-capeIT
Schon hatte ich mein Drop-Down beim Anlegen eines neuen Kunden. Vielleicht hilft's ja anderen auch weiter.
Grüße,
Julian
OTRS 3.2.8 - MySQL Database | Kix4OTRS 5.0 | SLES11SP2
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: CustomerCompanySupport

Post by tto »

Hallo,

alternativ kann man auch die (zugegebenermaßen etwas versteckte) erweitere Konfiguration in der Config.pm verwenden (siehe Dokumentation KIX4OTRS v1.0.1, Abschnitt 5.7 "Multiple CustomerIDs"):

Code: Select all

CustomerCompanySupportPersonalCustomerID => 1,
...analog zur generellen Aktivierung des Customer-Company-Supports für das Kundendatenbackend:

Code: Select all

CustomerCompanySupport => 1,
Dann ist keine Code-Änderung notwendig. Hintergrund ist dass es neben der freien Auswahl der primären KundenID auch möglich sein sollte eine freie Textauswahl zu tätigen. Der CustomerCompany-Support wird zunächst überhaupt aktiviert und mittels CustomerCompanySupportPersonalCustomerID auch für die primäre KundenID eines Kundenkontaktes.

vG, 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