[Vtigercrm-developers] Vtiger Class Loader?
Hamono, Chris (DPC)
Chris.Hamono at sa.gov.au
Thu Jul 16 23:39:31 GMT 2015
Hi Alan
Yes the only real answer is to bake in subclassing or functional intercepting from scratch. Something I doubt we will see anytime soon.
Although I had already resolved my problem by modifying the core code I wanted see if it could be done in a more modular fashion and Prasad's "prepend" solution seemed to hold at least part of the key.
My issue was I needed to restrict users available in the "Assign To" field to a small subset of the users in the system (5 out of ~1500). We considered doing it using roles but it meant we would have had to create an unmanageable tangle of roles.
Instead I have modified the core code to filter the list of users down to those which should be displayed.
Chris
-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Alan Lord
Sent: Thursday, 16 July 2015 10:55 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] Vtiger Class Loader?
On 16/07/15 05:42, Hamono, Chris (DPC) wrote:
> This is the hackiest hack I have ever done... and I have done a few
>
> The problem: *Replace a core class with my own custom class at
> runtime*
>
> The Solution (not overly tested) ...
>
> Change /index.php and add the following after the last include
> statement
Now here's a possibility....
Create a small jQuery Class for your custom module that gets loaded as a HEADERSCRIPT so it will run on all pages.
In this Javascript call, via Ajax, an action in your custom module that registers your Autoloader.
Would that work - or would it be too late?
But anyway - as the others have suggested, it seems to me that the real way to support core class overrides would to suppoort a "custom"
directory at the top level where the entire hierarchy can be replicated (modules, includes, layouts) and get vtiger to look in there first.
Al
_______________________________________________
http://www.vtiger.com/
More information about the vtigercrm-developers
mailing list