How to change new email ticket to launch in a pop-up window

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

How to change new email ticket to launch in a pop-up window

Post by Mothra »

I find it useful to raise new tickets in a pop-up window, thereby giving easy access to the rest of OTRS

In SysConfig, go to Ticket -> Frontend::Agent::ModuleRegistration

In the item, Frontend::Module###AgentTicketEmail, add the following to the LinkOption:

Code: Select all

onclick="Core.UI.Popup.OpenPopup('index.pl?Action=AgentTicketEmail'); return false;"
This raises the window in a pop-up; however on submitting the new ticket, you'll still be left with the open pop-up, which will have gone to a new EmailTicket window. If you don't want this, you'll need to edit AgentTicketEmail.dtl (preferably in a custom theme!) and add onSubmit="top.close();" to the form options, thus:

Code: Select all

 
<div class="ContentColumn">
            <form action="$Env{"CGIHandle"}" onSubmit="top.close();" method="post" enctype="multipart/form-data" name="compose" id="NewEmailTicket" class="Validate PreventMultipleSubmits">

You could also add a cancel button at the top of the page by adding this to the same AgentTicketEmaildtl:

Code: Select all

<a onclick="top.close();" href="">cancel</a>
I did this by creating a table for the title:

Code: Select all

<table cellspacing="12">
    <tr>
        <td><h1>$Text{"Create New Email Ticket"}</h1></td>
        <td><a onclick="top.close();" href="">[ cancel ]</a></td>
    </tr>
</table>
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: How to change new email ticket to launch in a pop-up win

Post by Mothra »

IMPORTANT! Having recently tested this against IE8, the "close on submit" part doesn't work. Unfortunately IE8 reads the

Code: Select all

onSubmit=top.close()
from the form before anything else (even validation) and closes the window without posting the form data.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Post Reply