Linking Company to Customer to ConfigItem

Moderator: crythias

Post Reply
Sophy978
Znuny newbie
Posts: 83
Joined: 06 Jul 2012, 22:01
Znuny Version: 3.1.5
Real Name: Sophy

Linking Company to Customer to ConfigItem

Post by Sophy978 »

Hello, I am using the the CustomerID field to link Company to Customer and the 'Name' field to link ConfigItem to that company. This works fine for now, just a lot of clicks to get to the information needed. I was wondering if there is way to create a link from the 'Name' field to bring up the Company detail record if it's CustomerID matches that 'Name' field value?

This way if an agent is viewing the configID, they can simply click on the 'Name' field which would bring up the detailed Company information (configItem 'linked' to), so they can easily see the address and company details.

Is this even possible? Thanks for your help. :)
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: Linking Company to Customer to ConfigItem

Post by artjoms15 »

Hmmm

What I can suggest...

Easy way
- OTRS add ins -> Customer-ConfigItem link (Really awesome plugin, but yeah, a subscription is needed ;) ) Will allow to make direct links from a customer to a Config Item, without the need to add Company layer.

Hard way:
- Add hyperlinks in according .pm module, like AgentITSMConfigItemZoom.pm
If I understand correctly, you have deployed a Config Item text field, "CustomerID" where the Company is written in ( general cataolog dropdown? need more details in here) and you want to make this a hyperlink, so you don't have to manually search this CustomerID.
Then a solution you can make on your own fear and risk...

1) Backup everything you can
2)Edit AgentITSMConfigItemZoom.pm
3) Change ITSMConfigItemOutputStringCreate function ~ line 410:

Code: Select all

   # create output string
            $Value = $Self->{LayoutObject}->ITSMConfigItemOutputStringCreate(
                Value => $Value,
                Item  => $Item,
            );
To this code:

Code: Select all

# Exception to show link of Company
    if ($Item->{Key} eq 'CustomerID')
    {
               # create output string with hyperlink (need to make <a href= ... but that requires removal of quoting html tags in template)
               $Value = $Self->{LayoutObject}->ITSMConfigItemOutputStringCreate(
                   Value => $Value.' [http://Insertyourdomainnamehere/otrs/index.pl?Action=AdminCustomerCompany;Subaction=Change;CustomerID='.$Value,
                   Item  => $Item,
               );
			}
			else
			{
			   # create output string
               $Value = $Self->{LayoutObject}->ITSMConfigItemOutputStringCreate(
                   Value => $Value,
                   Item  => $Item,
               );
			}
If you need to hide the hyperlink, then make changes to according .dtl file and remove $Quote output to $Data type output to disable HTML escaping (hole in security :D)

P.S. Friday evening, my english has gotten really bad, sorry :)

Smile,
A.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Sophy978
Znuny newbie
Posts: 83
Joined: 06 Jul 2012, 22:01
Znuny Version: 3.1.5
Real Name: Sophy

Re: Linking Company to Customer to ConfigItem

Post by Sophy978 »

Hello thanks for your reply. It seems like the code link would work. If I had a test server, I would try this out. At the moment we don't and now we are changing the fields a bit between Company and CMBD. In the CMBD, we are adding the address and more details of the customer's information. This way the agents only have to view the CMBD and not so many places.
Post Reply