[Solved] Extend the Customer Information Widget with [..]

English! place to talk about development, programming and coding
Post Reply
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

[Solved] Extend the Customer Information Widget with [..]

Post by RStraub »

Hello!

As there is no way (without a feature add-on) to link CIs with a customercompany, we are trying this approach:
1) Using the package "ITSM-CIAttributeCollection" we extended the CI Class Definition with a field of the type 'CIACCustomerCompany' (allows us search the customer database)
2) Add a link to the customer information which will execute a search over all CIs (of a given class) that contain the current customercompany.
Widget_Example.PNG
This link is currently hardcoded in the AgentCustomerTableView.dtl and looks like this:

Code: Select all

index.pl?Action=AgentITSMConfigItemSearch&Subaction=Search&ClassID=26&SearchDialog=1&EmptySearch=&Profile=last-search&ProfileName=&CustomerUserCompany=*CompanyName*&AttributeOrig=Number&PreviousVersionSearch=1&ResultForm=Normal
So my question then is: How can I make this link dynamic, such that CustomerUserCompany is replaced with the current Company?

Best Regards,
Rolf Straub
You do not have the required permissions to view the files attached to this post.
Last edited by RStraub on 09 May 2014, 11:39, edited 1 time in total.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Extend the Customer Information Widget with a generic se

Post by RStraub »

Another approach which might be "cleaner". I wrote a custom.xml file to Kernel/Config/Files and copied this block into it (derived from the XING item, thus the xing.css leftovers):

Code: Select all

<otrs_config version="1.0" init="Framework">
    <ConfigItem Name="Frontend::CustomerUser::Item###4-LinkedCIs" Required="0" Valid="0">
        <Description Translatable="1">Defines a customer item, which generates a hyperlink to a search-result containing all CIs that are linked with this customer.</Description>
        <Group>Framework</Group>
        <SubGroup>Frontend::Customer</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::CustomerUserGeneric</Item>
                <Item Key="Required">UserFirstname;UserLastname;</Item>
                <Item Key="Attributes">CustomerUserCompany;</Item>
                <Item Key="CSS">Core.Agent.CustomerUser.Xing.css</Item>
                <Item Key="CSSClass">Xing</Item>
                <Item Key="Target">_blank</Item>
                <Item Key="Text">CustomSearch (CIs)</Item>
                <Item Key="URL">index.pl?Action=AgentITSMConfigItemSearch&Subaction=Search&ClassID=26&SearchDialog=1&EmptySearch=&Profile=last-search&ProfileName=&AttributeOrig=Number&PreviousVersionSearch=1&ResultForm=Normal&CustomerUserCompany=</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
The link properly shows up and is clickable, but the attribute "CustomerUserCompany" is not appended to the URL.

Is that attribute name not accessible or just a wrong name? Maybe I need to call a different module? Does anyone have an idea on how to get the CustomerUserCompany - name appended?

Best Regards,
Rolf



EDIT:

Found it in the Defaults.pm, it's called "UserCustomerID". Marking this topic as solved.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Post Reply