Page 1 of 1

Calculate values canned responses

Posted: Tue Oct 19, 2021 11:00 am
by siomosp
Version of script: 2.8.2
Hosting company: stickit.gr
What terms did you try when SEARCHING for a solution: calculate


Hello!
There is a way to create a canned response witch calculate inputs
for example

<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" id="a" value="50">
+<input type="number" id="b" value="25">
=<output name="x" for="a b"></output>
</form>

Re: Calculate values canned responses

Posted: Tue Oct 19, 2021 6:00 pm
by Klemen
Sorry, not something built-in. You'd have to custom-code it.

Re: Calculate values canned responses

Posted: Wed Oct 20, 2021 10:46 am
by siomosp
Thank you Klemen!
Another question
Where i can add at tinymce
extended_valid_elements : 'span',
Thanks!

Re: Calculate values canned responses

Posted: Wed Oct 20, 2021 12:43 pm
by Klemen
You can adjust TinyMCE settings in /inc/tiny_mce/tinymce.inc.php

Open it in a powerful editor such as Notepad++

Re: Calculate values canned responses

Posted: Thu Oct 21, 2021 7:18 am
by siomosp
Hi!
Finally the canned response with auto calculated values , pure html code are working :) , but only at 3.2.4
https://codepen.io/siomosp/pen/porEgxe
At production server i still use HESK 2.8.2 with mods for hesk
But, the auto calculated values are not working, maybe due to tinymce version? :(
I will continue to use 2.8.2 because of the drag and drop attachments
So there is a time table at Hesk 3.x for drag and drop attachments ?
( I have a Hesk license, it is possible to help me for fixing canned response auto calculations at current version?)
Thank you!

Re: Calculate values canned responses

Posted: Thu Oct 21, 2021 6:59 pm
by Klemen
Not sure why your changes are not working in your MfH version. Sorry, but I cannot help with custom modifications to MfH.

Drag&drop attachments are coming in 2022.

Re: Calculate values canned responses

Posted: Fri Oct 22, 2021 1:38 pm
by siomosp
Great news!
Another question
Tickets are saving with html entities.
Rich text editor is enabled for Staff only
example
<p>E&upsilon;&chi;&alpha;&rho;&iota;&sigma;&tau;ώ &pi;&omicron;&lambda;ύ..</p>
Thanks!

Re: Calculate values canned responses

Posted: Fri Oct 22, 2021 1:48 pm
by Klemen
You will need to disable entity encoding in TinyMCE to stop this:
https://www.tiny.cloud/docs/configure/c ... y_encoding

Re: Calculate values canned responses

Posted: Sat Oct 23, 2021 11:01 am
by siomosp
I had to change all 3 instances entity_encoding:"named" > entity_encoding:"raw" at tiny_mce.js
It is fine now!

Re: Calculate values canned responses

Posted: Sat Oct 23, 2021 8:49 pm
by siomosp
At Hesk 3.2.4 b the html is stored at db "clean"
(Field messagehtml)
"<form oninput="x.value=a.valueAsNumber ..."
At Hesk 2.8.2 is stored at db different
(Field message)
"&lt;form&gt;&lt;input ....."
There is a way to store and display the "clean" html at Hesk 2.8.2?

Re: Calculate values canned responses

Posted: Sun Oct 24, 2021 8:46 am
by Klemen
That's probably because of the changes you did?

I strongly recommend not changing any of the settings unless you 100% know what you are doing, as you could be opening up your help desk vulnerable for XSS attacks.

Also note that in 3.2.4 message is saved twice - in message and message_html columns.