Outdated documentation

You are looking at the documentation for an older release. For the latest information, please see current release documentation.

客户

使用此屏幕将客户单位添加到系统中。 默认情况下,新的OTRS安装不包含任何客户。 客户管理屏幕位于 用户、组和角色 组的 客户 模块中。

Customer Management Screen

客户管理屏幕

管理客户

注解

只能通过使用数据库后端来添加或编辑客户。 使用LDAP等外部目录服务将禁用客户管理功能。

若要添加一个客户:

  1. 点击左侧边栏的 添加客户 按钮。
  2. 填写必填字段。
  3. 点击 保存 按钮。
Add Customer Screen

添加客户屏幕

警告

无法从系统中删除客户。 只能通过将 有效性 选项设置为 无效临时无效 来停用它们。

若要编辑一个客户:

  1. 点击客户列表中的一个客户。
  2. 修改字段。
  3. 点击 保存保存并完成 按钮。
Edit Customer Screen

编辑客户屏幕

若要查找一个客户:

  1. 在左侧边栏的搜索框中输入搜索字词。
  2. 单击字段右侧的放大镜图标或敲击一下 回车 键。

注解

如果将多个客户添加到系统中,请使用搜索框查找特定客户。 默认情况下仅列出前1000个客户。

客户设置

添加或编辑此资源时,可以使用以下设置。 标有星号的字段是必填字段。

客户ID *
客户的内部名称。 应该只包含字母,数字和一些特殊字符。
客户 *
此资源的名称。 可以在此字段中输入任何类型的字符,包括大写字母和空格。 名称将显示在概览表中。
街道
客户的街道名称。
邮编
客户的邮编。
城市
客户总部所在城市。
国家
客户的国家。 从列表中选择一个国家/地区。
网址
客户的网页或其他URL。
注释
向此资源添加其它信息。 为了更清晰,建议始终将此字段填充为带有完整句子的资源描述,因为注释也将显示在概览表中。
有效性 *
设置此资源的有效性。 如果此字段设置为 有效,则每个资源即可仅在OTRS中使用。 将此字段设置为 无效临时无效 将禁止此资源的使用。

Customer Back Ends

The system works with many customer data attributes such as customer ID, customer name, location information etc. These attributes are displayed in the agent interface and can be displayed in the external interface.

Customer data used or displayed within the system is highly customizable. The customer ID is always needed.

The administrator interface does not support the configuration of external back ends. Administrators need to edit the file Kernel/Config.pm by copying and pasting code snippets from Kernel/Config/Defaults.pm manually in case of using On-Premise system.

If you already have another customer back end (e.g. SAP), it is possible to write a module that uses it.

警告

不要修改 Kernel/Config/Defaults.pm 文件,在升级升级后它会被覆盖!而是复制并粘贴代码片段到 Kernel/Config.pm 文件中。

注解

This feature is only available to On-Premise customers. If you are a Managed customer, this feature is taken care of by the Customer Solutions Team in OTRS. Please contact us via support@otrs.com or in the OTRS Portal.

Customer Back End - Database

The default back end for customers is the OTRS database. With this back end, all customer data can be edited via the administrator interface.

    $Self->{CustomerCompany} = {
        Name   => Translatable('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 defines if the data storage of your DBMS is case sensitive and will be
            # preconfigured within the database driver by default.
            # If the collation of your data storage differs from the default settings,
            # you can set the current behavior ( either 1 = CaseSensitive or 0 = CaseINSensitive )
            # to fit your environment.
            #
#            CaseSensitive => 0,

            # SearchCaseSensitive will control if the searches within the data storage are performed
            # case sensitively (if possible) or not. Change this option to 1, if you want to search case sensitive.
            # This can improve the performance dramatically on large databases.
            SearchCaseSensitive => 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 => [
            # Info about dynamic fields:
            #
            # Dynamic Fields of type CustomerCompany can be used within the mapping (see example below).
            # The given storage (third column) then can also be used within the following configurations (see above):
            # CustomerCompanySearchFields, CustomerCompanyListFields
            #
            # Note that the columns 'frontend' and 'readonly' will be ignored for dynamic fields.

            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
            [ 'CustomerID',             Translatable('CustomerID'), 'customer_id', 0, 1, 'var', '', 0 ],
            [ 'CustomerCompanyName',    Translatable('Customer'),   'name',        1, 1, 'var', '', 0 ],
            [ 'CustomerCompanyStreet',  Translatable('Street'),     'street',      1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyZIP',     Translatable('Zip'),        'zip',         1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCity',    Translatable('City'),       'city',        1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCountry', Translatable('Country'),    'country',     1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyURL',     Translatable('URL'),        'url',         1, 0, 'var', '[% Data.CustomerCompanyURL | html %]', 0 ],
            [ 'CustomerCompanyComment', Translatable('Comment'),    'comments',    1, 0, 'var', '', 0 ],
            [ 'ValidID',                Translatable('Valid'),      'valid_id',    0, 1, 'int', '', 0 ],

            # Dynamic field example
#            [ 'DynamicField_Name_Y', undef, 'Name_Y', 0, 0, 'dynamic_field', undef, 0 ],
        ],
    };

If you want to customize the customer data, change the columns or add new ones to the customer_company table in the database.

For example, to add a new field for VAT number:

  1. Add a new column vat to table customer_company.

    MySQL 或 MariaDB:

    root> mysql -u root -p -e 'ALTER TABLE otrs.customer_company ADD vat VARCHAR (50)'
    

    PostgreSQL (从 /opt/otrs 目录):

    otrs> psql -c 'ALTER TABLE customer_company ADD COLUMN vat varchar(50)'
    
  2. Copy the $Self->{CustomerCompany} section from Kernel/Config/Defaults.pm into Kernel/Config.pm.

  3. 将新列添加到 Map 数组中。

    [ 'VATNumber', 'VAT Number', 'vat', 0, 1, 'var', '', 0 ],
    

    注解

    建议始终使用英文单词作为名称。

    参见

    Names can be translated into other languages with custom language files. For more information, see the Custom Language File chapter.