[SOLVED] Use CustomerUser Map to link CustomerCompany

Moderator: crythias

Locked
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

[SOLVED] Use CustomerUser Map to link CustomerCompany

Post by HervE »

Hello crythias,

I have read carefully your how-to.
Thanks to it, I managed to add a link to GoogleMaps to locate an address of a CustomerCompany. Great! Thank you for this.

Now, I would like to add the following:
In the CustomerUser list, I want the CustomerID to be a hyperlink to the related CustomerCompany.
I tried this in Config.pm:

Code: Select all

            [ 'UserCustomerID', 'CustomerID', 'customer_id', 1 1, 'var',  '$Env{"CGIHandle"}?Action=AdminCustomerCompany&Nav=Agent&Subaction=Change&CustomerID=$Data{"UserCustomerID"}', 0 ],
But it doesn't work: no link appears.
Why?

(Edited March 11th) Actually a link does appear, but it appears in the Customer Information section of ticket zoom. Which is fine. But most of all I wanted it to appear in the customer list.

Regards,
HervE
Last edited by HervE on 11 Mar 2011, 10:34, edited 2 times in total.
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by crythias »

Are you asking about otrs/index.pl?Action=AdminCustomerUser;Nav=Agent or otrs/index.pl?Action=AdminCustomerUser;Subaction=Change;ID=xxx;Search=*;Nav=Agent ?
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by HervE »

I think it is the 2nd one, but with AdminCustomerCompany, not AdminCustomerUser.
I want to come directly to the company information - as if I was going to modify them - rather than a result of a search in the company list.

HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by crythias »

I'm sorry, I'm asking where displays the Customer Company you wish to link...
But if I'm thinking you're in the customer user section and want to link to the customer companyid, I'm not sure that's possible right now.
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by HervE »

crythias wrote:But if I'm thinking you're in the customer user section and want to link to the customer companyid
Yes, that's it.
crythias wrote:I'm not sure that's possible right now.
Too bad!

HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by crythias »

well, don't fret. I have a cheat for you.

This edits AdminCustomerUser.dtl and won't survive upgrades.

Tested on version 3.0
in HeaderEdit, make this change.

Code: Select all

<h2>$Text{"Edit Customer"} Company: <span id="company"></span></h2>
after the /form put this:

Code: Select all

<script type="text/javascript">
var co=document.getElementById("UserCustomerID").value;
        document.getElementById("company").innerHTML='<a href="/otrs/index.pl?Action=AdminCustomerCompany;Subaction=Change;CustomerID='+co+';Nav=0">'+co+'</a>';
</script>
if /otrs doesn't work, make sure it reflects your location. The document.getElement line should be one line...

It won't work if CustomerID has a space in it, but what do you want for free? :) :)
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Use CustomerUser Map to link CustomerCompany (http-link)

Post by HervE »

Hello crythias,

It works perfectly.
But I didn't want this link to be from the customer form, I wanted it from the customer list. (Sorry for the misunderstanding.)
But your javascript trick is very interesting and opens many possibilities. I'm likely to use it in another context, if you don't mind.

However, I managed. Inside the OverviewResult block of the same file, I modified the cell this way:

Code: Select all

                            <td><a class="AsBlock" href="$Env{"Baselink"}Action=AdminCustomerCompany;Subaction=Change;CustomerID=$LQData{"UserCustomerID"};Nav=0">$QData{"UserCustomerID"}</a></td>
It works.

Thanks,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
Locked