List Customers IP Adress automaticly in new Tickets

Moderator: crythias

Locked
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

List Customers IP Adress automaticly in new Tickets

Post by Manfred »

Hello Forum,

i want to display the customers IP-Adress in the Agents Backend

So I first added at the end of the CustomerTicketMessage.dtl file in OTRS path under OTRS \ Kernel \ Output \ HTML \ Standard the following code.
But i don't know if it's correct.
Now the client's IP address is listed at the source code of a new ticket with

Code: Select all

    
############################################
    # Insert Client IP
    ############################################

    <script type="text/javascript">
    $(function() {
                var ip = '$Env{"HTTP_X_FORWARDED_FOR"}' ? '$Env{"HTTP_X_FORWARDED_FOR"}' : '$Env{"REMOTE_ADDR"}';
                $('.Row_DynamicField_ClientIP').hide();
                $('#DynamicField_ClientIP').val(ip);
    });
    </script>

    ############################################
    <script type="text/javascript">
        Core.Customer.InitFocus();
    </script>
    <!-- dtl:js_on_document_complete -->
Then I created a new Dynamic Felt with the field type text and the object type ticket at the admin area.
The name is ClientIP, The designation is IP-Adress
Next i go to sysconfig in the area Ticket :: Frontend :: Customer Ticket Message ### DynamicField and create a entry called ClientIP with the value 1 .

The field is also displayed in the Customer frontend in every new ticket. However, it is empty. But I would have it automatically filled with the value from the source code, so that automatically the client's IP address is displayed in the ticket system.

The idea behind it, is that the client's IP address is displayed as a link and it automatically starts our remote support software when i click and automatically logs in at the customers client.
This point also already works, but only if the address is entered manually in the frontend.

Who can help me?
Thanks a lot

Sorry for my bad english

Manfred
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: List Customers IP Adress automaticly in new Tickets

Post by eandrex »

try with

Code: Select all

var ip = '$Env{"HTTP_X_FORWARDED_FOR"}' !=='' ? '$Env{"HTTP_X_FORWARDED_FOR"}' : '$Env{"REMOTE_ADDR"}';
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

Re: List Customers IP Adress automaticly in new Tickets

Post by Manfred »

Sorry it don't work.
The Source code Looks like this.

Code: Select all

<script type="text/javascript">
$(function() {
            var ip = '' !=='' ? '' : '10.57.87.107';
            $('.Row_DynamicField_ClientIP').hide();
            $('#DynamicField_ClientIP').val(ip);
});
</script>
Manfred
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
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: List Customers IP Adress automaticly in new Tickets

Post by reneeb »

Try:

Code: Select all

<script type="text/javascript">
            var ip = '' !=='' ? '' : '10.57.87.107';
            $('.Row_DynamicField_ClientIP').hide();
            $('#DynamicField_ClientIP').val(ip);
</script>
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
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

Re: List Customers IP Adress automaticly in new Tickets

Post by Manfred »

Sorry this dont work too ...

The website source code of the Customers Front end looks like this now ..

Code: Select all

<script type="text/javascript">
            var ip = '' !=='' ? '' : '10.57.87.107';
            $('.Row_DynamicField_ClientIP').hide();
            $('#DynamicField_ClientIP').val(ip);
</script>
and the end of
CustomerTicketMessage.dtl
like this

Code: Select all

############################################
# Insert Client IP
###########################################

<script type="text/javascript">
            var ip = '$Env{"HTTP_X_FORWARDED_FOR"}' !=='' ? '$Env{"HTTP_X_FORWARDED_FOR"}' : '$Env{"REMOTE_ADDR"}';
            $('.Row_DynamicField_ClientIP').hide();
            $('#DynamicField_ClientIP').val(ip);
</script>

############################################
<script type="text/javascript">
    Core.Customer.InitFocus();
</script>
<!-- dtl:js_on_document_complete -->
"CustomerTicketMessage.dtl" 220L, 10515C      
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
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: List Customers IP Adress automaticly in new Tickets

Post by reneeb »

Are there any JS errors?
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
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

Re: List Customers IP Adress automaticly in new Tickets

Post by Manfred »

No ... sorry
I' ve looked in
/opt/otrs/var/log/otrs.log and
/var/log/apache2/error.log


Manfred
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
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: List Customers IP Adress automaticly in new Tickets

Post by reneeb »

JS errors occur in the browser...
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
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

Re: List Customers IP Adress automaticly in new Tickets

Post by Manfred »

No Sorry there are no Errors in the Browser
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: List Customers IP Adress automaticly in new Tickets

Post by eandrex »

Do you have another

Code: Select all

<!-- dtl:js_on_document_complete -->
before

Code: Select all

############################################
# Insert Client IP
###########################################
?

I have this

Code: Select all

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">
    $(function() {
			var IP = '$Env{"HTTP_X_FORWARDED_FOR"}' !=='' ? '$Env{"HTTP_X_FORWARDED_FOR"}' : '$Env{"REMOTE_ADDR"}';
			$('#DynamicField_ClientIP').val(IP);
	});
</script>
<script type="text/javascript">
    Core.Customer.InitFocus();
</script>
<!-- dtl:js_on_document_complete -->
at the end of my CustomerTicketMessage.dtl (otrs 3.3) and it works.
Manfred
Znuny newbie
Posts: 50
Joined: 23 Nov 2011, 11:49
Znuny Version: 4.0.14
Real Name: Manfred Werner
Company: Volkswagen Automobile

Re: List Customers IP Adress automaticly in new Tickets

Post by Manfred »

Hello
yes i have one

Code: Select all

<!-- dtl:js_on_document_complete -->
before and after the section
With your code it dont work, too. :(

??
Manfred
Ich bin Root...
Ich darf das... :D

Zur Zeit im Einsatz: SuSE Linux Enterprise Server 11 SP3 --- OTRS 4.0.1 --- MySQL 5.5.31 ---
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: List Customers IP Adress automaticly in new Tickets

Post by crythias »

Please offer more descriptive statements than "doesn't work".

Also, the IP address of how the ticket is submitted may be different from the computer that needs support.
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
Locked