[Vtigercrm-developers] Poss. to have HEADERSCRIPT dependent on vtiger version?

Alan Lord alanslists at gmail.com
Fri Oct 6 13:51:52 GMT 2017


I have a small extension on the marketplace that I would like to make 
compatible with vtiger 7, but I want to keep it compatible with vtiger 6 
too.

As the module was released it has a single Javascript file which is 
loaded via a HEADERSCRIPT link.

In v7 some libraries are not immediately available (hoverIntent in my 
example) so I have re-written part of the code to use the available 
qTip2 library instead.


So my question is how can I either:

1. Load a different javascript file via the HEADERSCRIPT depending on 
vtiger version

or

2. Determine during my javascript initialisation the version of vtiger 
and register an appropriate function/handler

For #2 I couldn't find anything that looked remotely helpful in app.js 
or helper.js or several other library files and there doesn't appear to 
be a value anywhere in the dom either (apart from the "Powered By vtiger 
.." bit but that is unreliable to say the least).

I can't use the layout/{vlayout,v7}/ route as this is an extension 
module and doesn't have any real "views".

TIA

Al





More information about the vtigercrm-developers mailing list