Hi,
Please note that I am using otrs 3.3.9. Currently, I am developing a feature in otrs. I have created a new menu button in agent portal (Zoom view). When user clicks on this page there are some fields that are filled from some background processing. Now when user clicks on save button, this data should be saved in database for which I have created a new table in database. Can anyone please tell me how to send data from template file to perl file and how to access data in that perl file?
Thank you for your cooperation!
Regards,
Gunjan
How to send data from .dtl file to perl file
Moderator: crythias
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: How to send data from .dtl file to perl file
Hey there 
I recently created two filters to the dashboard queue overview widget. So I need so send that data to the perl file, here is what it looks like:
In the .dtl the actual link:
and the javascript which will submit that data:
In the .pm you can get those parameters like this (it's just copied from other files):
Note that the last part is a fallback where the filter is initialized as empty, if nothing is set.
Does this help you ?
Best regards,
Rolf

I recently created two filters to the dashboard queue overview widget. So I need so send that data to the perl file, here is what it looks like:
In the .dtl the actual link:
Code: Select all
<li class="$QData{"All::Selected"} Last"><a href="#" id="Dashboard$QData{"Name"}All" data-filter="All">$Text{"All tickets"} ($QData{"All"})</a></li>
Code: Select all
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
$('#Dashboard$QData{"Name"}All').unbind('click').bind('click', function(){
Core.AJAX.ContentUpdate($('#Dashboard$QData{"Name"}'), '$Env{"Baselink"}Action=$Env{"Action"};Subaction=Element;Name=$QData{"Name"};Filter=All', function () {
Core.UI.Table.InitCSSPseudoClasses($('#Dashboard$QData{"Name"}'));
});
return false;
});
[...]
//]]></script>
<!-- dtl:js_on_document_complete -->
Code: Select all
$Self->{Filter} = $Self->{ParamObject}->GetParam( Param => 'Filter' ) || '';
Does this help you ?
Best regards,
Rolf
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Re: How to send data from .dtl file to perl file
Thanks Rolf. I also did the same. It is good to hear that my solution was correct. 
