Hide invalid customer from dropdown list

Moderator: crythias

Post Reply
User avatar
ebaccini
OTRS newbie
Posts: 16
Joined: 04 Sep 2017, 11:52
OTRS Version?: erizone 5.0.18
Real Name: Emiliano Baccini
Company: ENAV s.p.a.

Hide invalid customer from dropdown list

Post by ebaccini » 05 Feb 2018, 18:35

hi,
i would like to hide the customer that are set as "invalid" from the dropdown "Customer User" list in "Compose New Phone Ticket" Agent interface.

There's a way to do it?

Thanks in advance.
Emiliano Baccini

ENAV S.p.A. - SIO Roma Ciampino

OTRS 5.0.11
EriZone 5

User avatar
ebaccini
OTRS newbie
Posts: 16
Joined: 04 Sep 2017, 11:52
OTRS Version?: erizone 5.0.18
Real Name: Emiliano Baccini
Company: ENAV s.p.a.

Re: Hide invalid customer from dropdown list

Post by ebaccini » 08 Feb 2018, 13:45

Or this question is too silly or is too difficult... :? I guess is the first case.

But I can't find a way to do it.

Noone want to help?
Emiliano Baccini

ENAV S.p.A. - SIO Roma Ciampino

OTRS 5.0.11
EriZone 5

fcasal
OTRS wizard
Posts: 134
Joined: 21 Apr 2014, 16:14
OTRS Version?: 6.0.7

Re: Hide invalid customer from dropdown list

Post by fcasal » 08 Feb 2018, 15:55

That is not the expected behaviour. In our otrs the disable customer are not selectable. Which version of otrs are you using?

sommerzeit
OTRS newbie
Posts: 9
Joined: 15 Dec 2017, 17:12
OTRS Version?: 6.0.2
Real Name: Florian Sommer

Re: Hide invalid customer from dropdown list

Post by sommerzeit » 09 Feb 2018, 17:39

Try to clean your browser cache, maybe the now disabled entries are still saved there, hence why you still see it.

User avatar
ebaccini
OTRS newbie
Posts: 16
Joined: 04 Sep 2017, 11:52
OTRS Version?: erizone 5.0.18
Real Name: Emiliano Baccini
Company: ENAV s.p.a.

Re: Hide invalid customer from dropdown list

Post by ebaccini » 12 Feb 2018, 14:48

hi,
thanks for the replys. OTRS 5 and the cache has been already cleaned.
:-/
This is a bit disappointing to me looks like my installation has a bug...
Emiliano Baccini

ENAV S.p.A. - SIO Roma Ciampino

OTRS 5.0.11
EriZone 5

wurzel
OTRS guru
Posts: 2380
Joined: 08 Jul 2010, 22:25
OTRS Version?: 6.0.x

Re: Hide invalid customer from dropdown list

Post by wurzel » 12 Feb 2018, 15:21

Hi,

The implementation is not buggy, as it is running on many instances without errors.
So it might be your instance? Let's check...

Did you configure your own CustomeUser Backend? If yes - it might be your config.


Florian
    ((OTRS)) Community Edition 6.0.x, LAMP LIVE auf Debian 9
    OTRS 6 Managed Silver

    -- Ich beantworte keine Forums-Fragen PN - No PN please

    I won't answer to unfriendly users any more. A greeting and regards are just polite.

    User avatar
    ebaccini
    OTRS newbie
    Posts: 16
    Joined: 04 Sep 2017, 11:52
    OTRS Version?: erizone 5.0.18
    Real Name: Emiliano Baccini
    Company: ENAV s.p.a.

    Re: Hide invalid customer from dropdown list

    Post by ebaccini » 12 Feb 2018, 16:47

    Hi,
    yes we import our customers from an LDAP and mark certain as INVALID thru the import. The problem is that if I mark some customer as INVALID via the CUSTOMER MANAGMENT INTERFACE is still selectable from the dropdown list.

    I really don't know where to check...
    Emiliano Baccini

    ENAV S.p.A. - SIO Roma Ciampino

    OTRS 5.0.11
    EriZone 5

    wurzel
    OTRS guru
    Posts: 2380
    Joined: 08 Jul 2010, 22:25
    OTRS Version?: 6.0.x

    Re: Hide invalid customer from dropdown list

    Post by wurzel » 12 Feb 2018, 16:50

    Hi,

    why import ldap data? Why not attach it as a datasource directly?


    May we have a look at your Customer Config Files?

    Florian
      ((OTRS)) Community Edition 6.0.x, LAMP LIVE auf Debian 9
      OTRS 6 Managed Silver

      -- Ich beantworte keine Forums-Fragen PN - No PN please

      I won't answer to unfriendly users any more. A greeting and regards are just polite.

      root
      Moderator
      Posts: 1162
      Joined: 18 Dec 2007, 12:23
      OTRS Version?: 4/5/6
      Real Name: Roy Kaldung
      Company: Znuny Inc.
      Contact:

      Re: Hide invalid customer from dropdown list

      Post by root » 12 Feb 2018, 17:18

      Hi,
      ebaccini wrote: I really don't know where to check...

      Maybe you'll show us your config and we may be able to help.

      - Roy
      OTRS 4/5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

      You need professional services? Check out http://znuny.com/

      User avatar
      ebaccini
      OTRS newbie
      Posts: 16
      Joined: 04 Sep 2017, 11:52
      OTRS Version?: erizone 5.0.18
      Real Name: Emiliano Baccini
      Company: ENAV s.p.a.

      Re: Hide invalid customer from dropdown list

      Post by ebaccini » 12 Feb 2018, 17:23

      hi,
      this is the customer part (and BTW thanks for the help). We use both back ends DB and LDAP (via crontab sync)

      Code: Select all

          #---------------------------------------------------------
          # CUSTOMER TABLE FOR DATABASE BACKEND MANAGEMENT
          #---------------------------------------------------------
          $Self->{CustomerUser} = {
              Name   => 'Local Database',
              Module => 'Kernel::System::CustomerUser::DB',
              Params => {
                  Table => 'customer_user',
                  CaseSensitive => 0,
              },
      
              # customer unique id
              CustomerKey => 'login',
      
              # customer #
              CustomerID             => 'customer_id',
              CustomerValid          => 'valid_id',
      
              # The last field must always be the email address so that a valid
              #   email address like "John Doe" <john.doe@domain.com> can be constructed from the fields.
              CustomerUserListFields => [  'first_name', 'last_name', 'email' ],
              
              CustomerUserSearchFields           => [ 'login', 'first_name', 'last_name',  ], 
              CustomerUserSearchPrefix           => '*',
              CustomerUserSearchSuffix           => '*',
              CustomerUserSearchListLimit        => 500,
              CustomerUserPostMasterSearchFields => ['email'],
              CustomerUserNameFields             => [ 'title', 'first_name', 'last_name',  ],
              CustomerUserEmailUniqCheck         => 0,
      #        CustomerUserEmailUniqCheck         => 1,
      
              CustomerCompanySupport => 1,
              CacheTTL => 60 * 60 * 24,
      #        ReadOnly => 1, # 
              Map => [
      
                  # 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)
      #            [ 'UserID',          'ID',              'id',         0, 0, 'var', '', 0 ],
                 # [ '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 ],
      #            [ 'UserLogin',       'Username',        'login',      1, 1, 'var', '$Env{"CGIHandle"}?Action=AdminCustomerUser;Subaction=Change;Nav=None;Source=CustomerUser;ID=$Data{"UserID"};', 0, '', 'AsPopup OTRSPopup_TicketAction'  ],
                  [ 'UserPassword',     'Password',        'pw',          0, 0, 'var', '', 0 ],
                  [ 'UserEmail',        'Email',           'email',       1, 1, 'var', '', 0 ],
                  [ 'UserCustomerID',   'customer_id',     'customer_id', 1, 1, 'var', '', 0 ],
                  [ 'UserCustomerIDs', 'CustomerIDs (delimit , without space)', 'customer_ids', 0, 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 ],
                  [ 'UserCountry',      'Country',         'country',         1, 0, 'var', '', 0 ],
                  # [ 'UserComment',    'Comment',         'comments',        0, 0, 'var', '', 0 ],
                  [ 'ValidID',          'Valid',           'valid_id',        0, 1, 'int', '', 0 ],
              ],
      
              # default selections
              Selections => {
              },
          };
       
          #---------------------------------------------------------
          # CUSTOMER SYNC TABLE FROM LDPA/ACTIVE DIRIECTORY 
          #---------------------------------------------------------
          $Self->{CustomerUser2} = {
              Name   => 'Active Directory Sync',
              Module => 'Kernel::System::CustomerUser::DB',
              Params => {
                  Table => 'customer_user_ad',
                  CaseSensitive => 0,
              },
      
              # customer unique id
              CustomerKey => 'login',
      
              # customer #
              CustomerID             => 'customer_id',
      #        CustomerValid          => 'valid_id',
      
              # The last field must always be the email address so that a valid
              #   email address like "John Doe" <john.doe@domain.com> can be constructed from the fields.
              CustomerUserListFields => [  'first_name', 'last_name', 'email' ],
              
              CustomerUserSearchFields           => [ 'login', 'first_name', 'last_name',  'dn',  ], 
              CustomerUserSearchPrefix           => '*',
              CustomerUserSearchSuffix           => '*',
              CustomerUserSearchListLimit        => 250,
              CustomerUserPostMasterSearchFields => ['email'],
              CustomerUserNameFields             => [ 'title', 'first_name', 'last_name',  ],
              CustomerUserEmailUniqCheck         => 1,
      
              CustomerCompanySupport => 1,
              CacheTTL => 60 * 60 * 24, 
              ReadOnly => 0, #
              Map => [
      
                  # 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)
      #            [ 'UserID',          'ID',              'id',         0, 0, 'var', '', 0 ],
                 # [ '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 ],
      #            [ 'UserLogin',       'Username',        'login',      1, 1, 'var', '$Env{"CGIHandle"}?Action=AdminCustomerUser;Subaction=Change;Nav=None;Source=CustomerUser;ID=$Data{"UserID"};', 0, '', 'AsPopup OTRSPopup_TicketAction'  ],
                  [ 'UserPassword',     'Password',        'pw',          0, 0, 'var', '', 0 ],
                  [ 'UserEmail',        'Email',           'email',       1, 1, 'var', '', 0 ],
                  [ 'UserCustomerID',   'customer_id',     'customer_id', 1, 1, 'var', '', 0 ],
                  [ 'UserCustomerIDs', 'CustomerIDs (delimit , without space)', 'customer_ids', 0, 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 ],
                  [ 'UserDepartment',   'Department',      'department',      1, 0, 'var', '', 0 ],
                  [ 'UserCountry',      'Country',         'country',         1, 0, 'var', '', 0 ],
                  #[ 'UserCompanyName',  'Company',         'company',     1, 0, 'var', '', 0 ],
                  # [ 'UserComment',    'Comment',         'comments',        0, 0, 'var', '', 0 ],
                  [ 'ValidID',          'Valid',           'valid_id',        0, 1, 'int', '', 0 ],
                  [ 'UserDirectManagerDN',  'Manager',     'directmanagerdn', 1, 0, 'var', '', 0 ],
                  [ 'UserDN',               'DN',          'dn',              1, 0, 'var', '', 0 ],
              ],
      
              # default selections
              Selections => {
              },
          };
      
      Emiliano Baccini

      ENAV S.p.A. - SIO Roma Ciampino

      OTRS 5.0.11
      EriZone 5

      wurzel
      OTRS guru
      Posts: 2380
      Joined: 08 Jul 2010, 22:25
      OTRS Version?: 6.0.x

      Re: Hide invalid customer from dropdown list

      Post by wurzel » 12 Feb 2018, 17:31

      hi,

      as far as I can tell you (I am not 100% sure)

      # CustomerValid => 'valid_id',

      you disabled it.

      You really should not sync LDAP, but connect it directly.

      Florian
        ((OTRS)) Community Edition 6.0.x, LAMP LIVE auf Debian 9
        OTRS 6 Managed Silver

        -- Ich beantworte keine Forums-Fragen PN - No PN please

        I won't answer to unfriendly users any more. A greeting and regards are just polite.

        User avatar
        ebaccini
        OTRS newbie
        Posts: 16
        Joined: 04 Sep 2017, 11:52
        OTRS Version?: erizone 5.0.18
        Real Name: Emiliano Baccini
        Company: ENAV s.p.a.

        Re: Hide invalid customer from dropdown list

        Post by ebaccini » 12 Feb 2018, 17:40

        Hi,
        this part

        Code: Select all

                # customer #
                CustomerID             => 'customer_id',
        #        CustomerValid          => 'valid_id',
        
        is due to the fact that in the LDAP the CustomerValid field can assume a number of values, part of this values means that the user is not able to do "something". We've mapped this vales in a query that set valid_id to "2" when inserting the customer in the Customer_user_ad table.

        I've noticed furthermore by making some tests that if the user is recorded in the LOCAL db (meaning the customer_user table) when is set to INVALID it'll not appear in the dropdown, on the other hand if is in the customer_user_ad table it'll appear in the dropdown either it is INVALID or VALID. My guess is that the interface is making his "checks" only on the local DB table...

        BTW the choice on this configuration was not on me and nor me nor my colleagues can argue with this. Our mission is just "to make it work" :(
        Emiliano Baccini

        ENAV S.p.A. - SIO Roma Ciampino

        OTRS 5.0.11
        EriZone 5

        root
        Moderator
        Posts: 1162
        Joined: 18 Dec 2007, 12:23
        OTRS Version?: 4/5/6
        Real Name: Roy Kaldung
        Company: Znuny Inc.
        Contact:

        Re: Hide invalid customer from dropdown list

        Post by root » 12 Feb 2018, 18:16

        Hi,
        ebaccini wrote:

        Code: Select all

        #        CustomerValid          => 'valid_id',
        
        This says which column OTRS should evaluate if a customer user is valid or not. With commenting this out all of your customer user in this table are valid.

        - Roy
        OTRS 4/5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

        You need professional services? Check out http://znuny.com/

        User avatar
        ebaccini
        OTRS newbie
        Posts: 16
        Joined: 04 Sep 2017, 11:52
        OTRS Version?: erizone 5.0.18
        Real Name: Emiliano Baccini
        Company: ENAV s.p.a.

        Re: Hide invalid customer from dropdown list

        Post by ebaccini » 12 Feb 2018, 18:19

        root wrote:Hi,
        ebaccini wrote:

        Code: Select all

        #        CustomerValid          => 'valid_id',
        
        This says which column OTRS should evaluate if a customer user is valid or not. With commenting this out all of your customer user in this table are valid.

        - Roy
        Thanks for the explanation.

        I'll test it out.

        Thank you
        Emiliano Baccini

        ENAV S.p.A. - SIO Roma Ciampino

        OTRS 5.0.11
        EriZone 5

        User avatar
        ebaccini
        OTRS newbie
        Posts: 16
        Joined: 04 Sep 2017, 11:52
        OTRS Version?: erizone 5.0.18
        Real Name: Emiliano Baccini
        Company: ENAV s.p.a.

        Re: Hide invalid customer from dropdown list

        Post by ebaccini » 12 Feb 2018, 18:24

        As you said it's perfectly working. My implementation have a huge lack of know-how. Thanks again for this help.
        Emiliano Baccini

        ENAV S.p.A. - SIO Roma Ciampino

        OTRS 5.0.11
        EriZone 5

        Post Reply