Customer attachment refreshes the page

Moderator: crythias

Locked
MargauxG
Znuny newbie
Posts: 68
Joined: 11 Apr 2014, 16:14
Znuny Version: 3.0.11
Real Name: Margaux Grandhomme
Company: Haulotte Group
Location: France

Customer attachment refreshes the page

Post by MargauxG »

Hello,

I've been looking for a solution for a week now on how to disable the page refresh when a customer uploads an attachment.
I have some kind of ticket form where dynamic fields appear and disappear depending on the selected service (I can show you the (long) code for that). But as soon as the attachment is uploaded, the page refreshes and every single dynamic fields appear whereas I want some to stay hidden.
I think I've tried every solution found on the internet...
in the attachment block (just below the RichText block) on the CustomerTicketMessage.dtl I tried :
- return false;
- Event.preventDefault;
- window.stop();
- some function to remove the meta tag
- changing the function "Core.Form.Validate.disableValidation" (which seems to be causing the refresh)
...
I even tried to modify the header using the agent one and the HTMLHeadBlockEvent function... Because for some reason, when an agent uploads an attachment, my ticket form doesn't change (which is what I want).

Has anyone a solution for me ? I'm beginning to desperate because that is my major bug preventing us from upgrading our current OTRS (3.0.11) to OTRS 3.3.1.

Thank you in advance.
OTRS 3.0.11 with ITSM, CMDB, FAQ...
Windows Server 2008 R2
Testing OTRS 3.2.16 and 3.3.1 on Ubuntu server with MSSQL
MargauxG
Znuny newbie
Posts: 68
Joined: 11 Apr 2014, 16:14
Znuny Version: 3.0.11
Real Name: Margaux Grandhomme
Company: Haulotte Group
Location: France

Re: Customer attachment refreshes the page

Post by MargauxG »

Anyone please ?
OTRS 3.0.11 with ITSM, CMDB, FAQ...
Windows Server 2008 R2
Testing OTRS 3.2.16 and 3.3.1 on Ubuntu server with MSSQL
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Customer attachment refreshes the page

Post by jojo »

as you changed the code you have to check your code
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Customer attachment refreshes the page

Post by reneeb »

You should research what the differences are between the customer interface and the agent interface...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
MargauxG
Znuny newbie
Posts: 68
Joined: 11 Apr 2014, 16:14
Znuny Version: 3.0.11
Real Name: Margaux Grandhomme
Company: Haulotte Group
Location: France

Re: Customer attachment refreshes the page

Post by MargauxG »

The problem is not my code (I used this subject viewtopic.php?f=60&t=8032). I also tried global variable and cookies. Still doesn't work
The only difference with the agent interface is the header, and when I use the agent's header, nothing works anymore (can't event open the ticket page)
OTRS 3.0.11 with ITSM, CMDB, FAQ...
Windows Server 2008 R2
Testing OTRS 3.2.16 and 3.3.1 on Ubuntu server with MSSQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Customer attachment refreshes the page

Post by crythias »

The answer is to figure out where to put the code so it's parsed upon refresh. Chances are, it may need to be outside of whatever dtl block it is.
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
MargauxG
Znuny newbie
Posts: 68
Joined: 11 Apr 2014, 16:14
Znuny Version: 3.0.11
Real Name: Margaux Grandhomme
Company: Haulotte Group
Location: France

Re: Customer attachment refreshes the page

Post by MargauxG »

it's seems the refresh occurs either at

Code: Select all

Core.Form.Validate.DisableValidation($Form);
 $Form.find('#AttachmentUpload').val('1').end().submit();
I tried to copy the code for hiding the dynamic fields in the function Attachment (having saved the serviceID before). But as you can imagine, it doesn't work either. I tried to put in the same block but not in the function, still nothing. So I have no other idea where to put it.
If I change those lines, I can't delete the attachment.
OTRS 3.0.11 with ITSM, CMDB, FAQ...
Windows Server 2008 R2
Testing OTRS 3.2.16 and 3.3.1 on Ubuntu server with MSSQL
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: Customer attachment refreshes the page

Post by Giulio Soleni »

I faced a similar issue some years ago and I used a javascript popup to ask me if I would like to keep the ticket compiled data or clean them up as soon as a refresh should update the page.
viewtopic.php?f=60&t=8032#p66824
This was more a workaround than a fix, tho...
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
MargauxG
Znuny newbie
Posts: 68
Joined: 11 Apr 2014, 16:14
Znuny Version: 3.0.11
Real Name: Margaux Grandhomme
Company: Haulotte Group
Location: France

Re: Customer attachment refreshes the page

Post by MargauxG »

Yes I saw your post, but quite franckly, I didn't really understand what your code did... and your code was for a template.In my case, strangely, the value of the dynamic field doesn't change (still got what was written inside), but every fields appears.
OTRS 3.0.11 with ITSM, CMDB, FAQ...
Windows Server 2008 R2
Testing OTRS 3.2.16 and 3.3.1 on Ubuntu server with MSSQL
Locked