OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Moderator: crythias

Post Reply
Thomymaster
Znuny newbie
Posts: 76
Joined: 26 Sep 2016, 10:50
Znuny Version: 5.0.12
Company: MPImF Heidelberg

OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by Thomymaster »

Hi


In my installation i am pulling customer data from our company LDAP.
What i want to achieve is that the department name is displayed in the customer data (and this inside the tickets).
For this i set in the data map among others:

[ 'UserComment', 'Department ID', 'gidNumber', 1, 1, 'var', '', 0 ],

This now displays the primary group ID from that person in LDAP.
As we don't have a text attribute for this, i am looking for a substition logic. Can i make this happen with OTRS, to have a map like:

1000 -> Department1
1001 -> Department2

If nothing on the map is matched, the number is shown as currently. :)

Best,
Thomas
OTRS 5.0.12 on Ubuntu 14.04 LTS
OTRS 5.0.27 on Ubuntu 16.04 LTS
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by root »

Hi,

This should work with the translation logic, but be aware that this could also translate in other areas.
For an example see Kernel/Language/xx_Custom.pm and create your own de_Departments.pm (or en_*).

- 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 ?
Thomymaster
Znuny newbie
Posts: 76
Joined: 26 Sep 2016, 10:50
Znuny Version: 5.0.12
Company: MPImF Heidelberg

Re: OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by Thomymaster »

Hi

I created de_Departments.pm with the following content:

Code: Select all

package Kernel::Language::de_Departments;

use strict;
use warnings;
use utf8;

sub Data {
    my $Self = shift;

    # $$START$$

    # own translations
    $Self->{Translation}->{'3500'}   = 'Dept 1';
    $Self->{Translation}->{'4000'} = 'Dept 2';
}

1;

But in the ticket view it still shows:

Department ID: 3500

Do i have to register/activate the module somehow? And how does it know that it has to only translate the date for the "Department ID" field in the ticket view (or in the Customer user data)?

What am i doing wrong? :/

Best,
Thomas
OTRS 5.0.12 on Ubuntu 14.04 LTS
OTRS 5.0.27 on Ubuntu 16.04 LTS
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by root »

HI,

Let me check this, I strongly suggest that CustomerUser values are not translated by default. Would be great if you could try to copy the value into a dynamic field with DynamicFieldFromCustomerUser (search the SysConfig). DFs should be translated always. If not, pm me.

- 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 ?
Thomymaster
Znuny newbie
Posts: 76
Joined: 26 Sep 2016, 10:50
Znuny Version: 5.0.12
Company: MPImF Heidelberg

Re: OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by Thomymaster »

I got the dynamic field from LDAP customer data working but still i need the translation (both dynamic field and its value). I sent you a pm :)
OTRS 5.0.12 on Ubuntu 14.04 LTS
OTRS 5.0.27 on Ubuntu 16.04 LTS
Thomymaster
Znuny newbie
Posts: 76
Joined: 26 Sep 2016, 10:50
Znuny Version: 5.0.12
Company: MPImF Heidelberg

Re: OTRS 5.0.21 substition (key->value in UI) for customer data from LDAP possible?

Post by Thomymaster »

Via de_Custom.pm i am able to translate the dynamic field label but not its value (like i need, see above)
OTRS 5.0.12 on Ubuntu 14.04 LTS
OTRS 5.0.27 on Ubuntu 16.04 LTS
Post Reply