Adding a javascript to OTRS

English! place to talk about development, programming and coding
Post Reply
ikbenniels
Znuny newbie
Posts: 1
Joined: 31 May 2014, 15:10
Znuny Version: 3.3.X
Real Name: Niels
Company: Scouting Nederland
Location: The Netherlands, Zeist
Contact:

Adding a javascript to OTRS

Post by ikbenniels »

Hey,

I'm developing an OTRS 3.3.x extension and want to use a custom javascript similar to the searchboxes (like ticketsearch). So I took a fairly simple javascript (CustomerInformationCenterSearch) and copied it, changed the filename and namespace name and read http://otrs.github.io/doc/manual/develo ... tml#loader about putting it in the common files. So I have my js file in <OTRS ROOT>/var/httpd/htdocs/js/ and added this to my extension's xml file:

Code: Select all

<ConfigItem Name="Loader::Agent::CommonJS###100-SpecialismList" Required="1" Valid="1">
    <Description Translatable="1">List of JS files to always be loaded for the agent interface for package "SpecialismList".</Description>
    <Group>Framework</Group>
    <SubGroup>Core::Web</SubGroup>
    <Setting>
        <Array>
            <Item>SpecialismList.Agent.Edit.js</Item>
        </Array>
    </Setting>
</ConfigItem>
Long story short, this is not working. I dove into the OTRS HTML page and found that, if configured correctly, the custom js file should end up in some file called CommonJS_[....].js. So I found this file on the server, but it had no trace of my custom javascript file, figured it probably had something to do with caching, renamed the CommonJS_[...].js to CommonJS_[...].js.backup and tried again, the CommonKS_[...].js was back, without my javascript.

Whenever I click the menu item, nothing happens, not even an error message in my syslog or apache's error.log. Do you have any idea why this is not working and is my assumption correct that my javascript should end up in the CommonJS file? Any thoughts on how to get this working or what might be wrong?

Regards.
"If I had an hour to solve a problem I'd spend 55 minutes thinking about the problem and 5 minutes thinking about solutions." - Einstein
Post Reply