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
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.)