Customer Templates based on customer login [SOLVED]

English! place to talk about development, programming and coding
Post Reply
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Customer Templates based on customer login [SOLVED]

Post by alonso5 »

Hello all,

I'm using OTRS 3.1.4 with KIX4OTRS 4.2.1. I've created some customer templates with the feature provided by KIX.

The problem is that all customer accessing the platform are able to see all templates on "Tickets templates":
Sin título.png
Is there any way to make the visible templates depending on the customer?

Thank you and regards,
You do not have the required permissions to view the files attached to this post.
Last edited by alonso5 on 14 Aug 2013, 09:34, edited 1 time in total.
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Re: Customer Templates based on customer login

Post by alonso5 »

Hi all,

Is there any idea over there? It's really not very appropriate to have templates from different customers in the same window and visible for all of them.

Thank you in advance and regards,

a.
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Customer Templates based on customer login

Post by crythias »

You'd use customer based themes. Besides, the templates should be rather agnostic. That is to say, the demographic information is attached by who submits a ticket. Further making the *ticket* customer centric doesn't make sense. If you could give an example about *why* these templates are customer centric and why you want to do this specialization for every customer, perhaps we could suggest how to provide the same result with variables.
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
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: Customer Templates based on customer login

Post by tto »

alonso5 wrote:Hello all,

I'm using OTRS 3.1.4 with KIX4OTRS 4.2.1. I've created some customer templates with the feature provided by KIX.

The problem is that all customer accessing the platform are able to see all templates on "Tickets templates":
Sin título.png
Is there any way to make the visible templates depending on the customer?
Yes, there is: Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction
  • Key: string consisting of template ID (see URL when editing ticket template + "::" + some customer user attribute; example: 1::UserLogin - for template 1 check for UserLogin
  • Value: some regexp which must mach the value customer user attribute defined after "::" in key, in order to show ticket template; example:"(.*)" - for everyone
Some useful sample:

"1::CustomerCompany" => "(Acme.*|MyCompany.*)" => this shows the ticket template with ID 1 only for customer users which have a attribute CustomerCompany with company "Acme <something>" or "MyCompany <something>".

regards, 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.
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Re: Customer Templates based on customer login

Post by alonso5 »

Thank you Crythias and tto for your answers.

I'll try with Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction and let you know if it works for us.

Crythias, we have several fields applying only in specific customers. This information is given by the customer in the description field of the ticket since we can't use dynamic fields depending of the customer... So we thought a solution based on templates.

Regards,
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Re: Customer Templates based on customer login

Post by alonso5 »

Hi tto,

I've tried with Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction but it doesn't work:
Sin título2.png
I can see two templates no matter what user login. Templates IDs are correct. Do I need to complete ###TemplateRefistration? I have tried to define the templates' name here without success.

Am I doing something wrong?

Thank you and regards,
You do not have the required permissions to view the files attached to this post.
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Re: Customer Templates based on customer login

Post by alonso5 »

Hi all,

maybe I can try to insert this restrictions in Config.pm or ZZZAuto.pm, what do you think? Would it be the sintax something like this?:

$Self->{'Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction'}->{'????????''} = {
'1::CustomerCompany' => '(Acme.*|MyCompany.*)'
}

Must I use Config.pm or ZZZAuto.pm?

Thank you and regards,
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
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: Customer Templates based on customer login

Post by tto »

Hi there,

finally the forum is reachable again. Even though I got some mails I was not able to log in. So it took a while.
alonso5 wrote: [...] I've tried with Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction but it doesn't work:
I can see two templates no matter what user login. Templates IDs are correct. Do I need to complete ###TemplateRefistration? I have tried to define the templates' name here without success.
Am I doing something wrong?
Nope - my fault. Actually using the ID of the template was considered a bug. Therfore it was fixed and now you must/can use the name of the ticket template to configure a template restriction. Keep in mind, that you define who can NOT see the template. Some example:

(1) two customer users with login "aschweitzer" and "rkoch"

(2) I created tow ticket templates name "ASchweitzer-Only" and "RKoch-Only"

(3) configure Ticket::QuickTicketByDefaultSet::Customer###UserAttributeRestriction

Code: Select all

ASchweitzer-Only::UserLogin => ^(?:(?!aschweitzer).)*$
...which means: "ticket template 'ASchweitzer-Only' is NOT shown to customer users where the customer users login does NOT look like '.*aschweitzer.*'".

Code: Select all

RKoch-Only::UserLogin => ^(?:(?!rkoch).)*$
...which means: "ticket template 'RKoch-Only' is NOT shown to customer users where the customer users login does NOT look like '.*rkoch.*'".


Of course you can also restrict the listing of ticket templates based on other attributes than "UserLogin", like "UserCompanyName" or whatever you define in your Config.pm / Customer data backend configuration - another sample:

Code: Select all

TemplateName::UserCustomerCompany => ^(?:(?!(Acme.*|MyCompany.*)).)*$ 
...if only customer users of company "Acme*" or "MyCompany*" should be able to use the template.

Code: Select all

TemplateName::UserCustomerCompany => (Acme.*|MyCompany.*)
...if customer users of company "Acme*" or "MyCompany*" should NOT be able to use the template.


regards, 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.
alonso5
Znuny newbie
Posts: 11
Joined: 18 Jul 2013, 14:28
Znuny Version: 3.1.4
Real Name: Alonso Ruiz

Re: Customer Templates based on customer login [SOLVED]

Post by alonso5 »

Thank you!

It works perfectly.

Regards,
OTRS 3.1.4 on Linux with MySQL database and KIX4OTRS
tim78
Znuny advanced
Posts: 107
Joined: 27 Feb 2014, 10:14
Znuny Version: diverse
Real Name: Tim

Re: Customer Templates based on customer login [SOLVED]

Post by tim78 »

Hello,

is it also possible to work with wildcards for Key?

Something like

ASchweitzer****::UserLogin => ^(?:(?!aschweitzer).)*$

so that customer can see all templates which start with Aschweitzer?



Regards Tim
Grüße
Tim

aktuell im Einsatz: hauptsächlich OTRS 5.0.34 auf Debian mit ein paar Erweiterungen.
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: Customer Templates based on customer login [SOLVED]

Post by tto »

tim78 wrote:Hello,

is it also possible to work with wildcards for Key?

Something like

ASchweitzer****::UserLogin => ^(?:(?!aschweitzer).)*$

so that customer can see all templates which start with Aschweitzer?
...sorry - nope, this is not possible. Regex only apply to the right site of this expression.

regards, 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.
Post Reply