customer frontend ticket template

Moderator: crythias

Post Reply
meraj
Znuny newbie
Posts: 6
Joined: 24 Jun 2010, 23:30
Znuny Version: 2.4.7

customer frontend ticket template

Post by meraj »

Hello,

I have been unable to find anything about this in the documentation, and the forum won't let me search for some reason. My question is about the "New Ticket" page in the customer frontend. Is it possible to pre-populate the text area of the editor to contain some default text? For example, I would like to have the customer automatically see the following text already in the message area when they compose a new ticket:

Code: Select all

Case Number: 
Application: 
Error Message(s): 
Description: 
I would like to achieve it this way rather than creating custom text fields for the sake of simplicity.

Thanks,

-m
OTRS 3.0.4, Windows Server 2008, MySQL
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

You could do that.

Your Mileage May Vary, but:

Edit CustomerTicketMessage.dtl (Kernel/Output/HTML/Standard) Line 122 But you should likely do this in your own theme...
Original:

Code: Select all

<textarea id="RichText" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaNote"}">$QData{"Body"}</textarea>
Modified:

Code: Select all

<textarea id="RichText" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaNote"}">$QData{"Body"}Put Some Text Here<br>This is line2</textarea>
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
DenisBY
Moderator
Posts: 54
Joined: 19 Aug 2010, 08:33
Znuny Version: 3.0 CVS
Location: Minsk, Belarus

Re: customer frontend ticket template

Post by DenisBY »

Is it possible to create different template for different queue? I'm using 3.0 beta 1
OTRS 3.0 SVN, CentOS, MySQL, Lotus LDAP for Agents and Customers. Production (Yes, I'm crazy).
DavidM
Znuny newbie
Posts: 5
Joined: 20 Aug 2010, 12:49
Znuny Version: 3.0

Re: customer frontend ticket template

Post by DavidM »

My boss just asked me the same question on creating specific templates depending on the customer or queue.
Considering the template is based on CustomerTicketMessage.dtl I am not expecting the answer to be yes (or easy), but still curious on a reply.

Thanks

--
Also on the 3.0 beta 1, great product.
OTRS: 3.0 Beta 3
OS: CentOS 5.5 x86_64
DenisBY
Moderator
Posts: 54
Joined: 19 Aug 2010, 08:33
Znuny Version: 3.0 CVS
Location: Minsk, Belarus

Re: customer frontend ticket template

Post by DenisBY »

OTRS 3.0 SVN, CentOS, MySQL, Lotus LDAP for Agents and Customers. Production (Yes, I'm crazy).
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

I use http://www.jotform.com to create forms that send emails for a specific queue. I can customize it however I wish and then the result gets emailed in the body of the ticket. Pretty painless.
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
DenisBY
Moderator
Posts: 54
Joined: 19 Aug 2010, 08:33
Znuny Version: 3.0 CVS
Location: Minsk, Belarus

Re: customer frontend ticket template

Post by DenisBY »

it's cool, but it would be nice to have all in one place :)
OTRS 3.0 SVN, CentOS, MySQL, Lotus LDAP for Agents and Customers. Production (Yes, I'm crazy).
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

I didn't check earlier, but since this thread has already added authors and a topic change, are you asking for different text as described above, based upon queue selection?

If so, it would be of medium difficulty to add a javascript onchange to the queue selection.

edit: I'm deeply sorry for the misspelling earlier. My phone's autocorrect was not behaving well.
Last edited by crythias on 23 Aug 2010, 13:44, edited 1 time in total.
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
DenisBY
Moderator
Posts: 54
Joined: 19 Aug 2010, 08:33
Znuny Version: 3.0 CVS
Location: Minsk, Belarus

Re: customer frontend ticket template

Post by DenisBY »

sorry. not quite understand what you mean.
OTRS 3.0 SVN, CentOS, MySQL, Lotus LDAP for Agents and Customers. Production (Yes, I'm crazy).
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

The original post author wanted to know how to fill in the Body of the customer "create new ticket" for 2.4.7. That was answered.

Then, two more people are asking a different (?) question on 3.0 beta 1 (how to create different templates based upon Customer or Queue.)

Without more information, I am asking:

Do you want different themes?

Do you simply want to do what the original post author did, but change the value of the form's Textarea based upon Queue Selection?

In either case, I'm asking to please create a new topic with a good subject and a body that indicates what you're trying to accomplish, and it'll hopefully be answered, because the original question already has been answered.
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
DenisBY
Moderator
Posts: 54
Joined: 19 Aug 2010, 08:33
Znuny Version: 3.0 CVS
Location: Minsk, Belarus

Re: customer frontend ticket template

Post by DenisBY »

Yes, I want to:
do what the original post author did, but change the value of the form's Textarea based upon Queue Selection
OTRS 3.0 SVN, CentOS, MySQL, Lotus LDAP for Agents and Customers. Production (Yes, I'm crazy).
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

First, this is only tested on 2.4.7.
I made a change to two files, and I don't know what one change (removing document.compose.submit();) will break.

in otrs/Kernel/Modules/CustomerTicketMessage.pm I made this change (Line 492):

Code: Select all

        OnChange   => "document.compose.Expand.value='3'; toChange(this.value); return false;",
in otrs/Kernel/Output/HTML/Standard (or your theme! recommended!)/CustomerTicketMessage.dtl I added this code before function submit_compose():

Code: Select all

function toChange(queue) {
   var oEditor = FCKeditorAPI.GetInstance('RichText');
   //ideally, we should put stuff somewhere else so this is easier to edit, but ...
   switch(queue)
   {
   case "3\|\|Junk":
        oEditor.SetHTML('this is line one<br/>and line2');
     break;
   default:
       oEditor.SetHTML('');
   }
}
"How do I add my own Queues?"
you can add

Code: Select all

alert (queue);
before the switch to see what they are [edit: or view source on the web page], and add appropriate case statements.

Seriously, this is a kludge. It will work if you're paying attention, but I don't know what removing the document.compose.submit() item will do wrong. But keeping it disrupts my update code. If you don't know what javascript is or does, you'll find this rather puzzling, but, in a nutshell:

The first part basically provides the "onChange" code for the To: field.
The second part is the code, and it's rather simple: get the running instance of the Rich Text Editor. Based upon the choice of queue, switch to the case that matches the choice, and set the HTML in the code. If there is no valid queue to case, it will DELETE THE CONTENT of the BODY.

NOTE: This is DESTRUCTIVE. That is to say, if you use this code, and someone (for some reason) changes the queue after he puts content in the TextArea, it will DISAPPEAR (but only before submit. After the ticket is submitted, it doesn't do anything evil.)
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
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: customer frontend ticket template

Post by Mothra »

crythias wrote:... but I don't know what removing the document.compose.submit() item will do wrong.
It will prevent any subsequent drop down lists from updating that would have calculated their values by the selected Queue.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
elthea
Znuny newbie
Posts: 1
Joined: 30 Aug 2011, 12:39
Znuny Version: 3.0.10
Real Name: Dorota

Re: customer frontend ticket template

Post by elthea »

Hi,

Cristhias, your modifications are really great and helpfull:)

Could you please help me a little how to implement it with OTRS 3.0.10 with ITSM? I'm not very familiar with JS :)

Regards,
Elthea
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: customer frontend ticket template

Post by crythias »

This topic is very old. You should look at this: http://forums.otrs.org/viewtopic.php?f=60&t=8032

If anyone has a question, please start a new topic.
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
Post Reply