@greencrm@lord_alan I am impressed with magento's core, commercial and local folder structure. With some extra effort, we may extend the core classes into the local classes with customization. The loader will check local, then commercial and core. Commercial may be a future plan to keep extensions, so always core folder will be untouched.
Problem with the custom Folder is, it allows exactly one modified version of a file/class.
AND (What I think is a real problem): It increase the propability a function behave different, then expected. This would result in an extra layer within major modules, to workaround different implementations. Also if someone could "replace" javascript files in a prepared way, I cannot be sure to provide a usable third party module. (Explain me, if I'm wrong and why)
I'm also not sure why overrides of core files are necessary.
I would not like to develope a completely new Query Generator. I would only increase / extend the functionality.
When I need to use core modification for modifications, I like and use the system from Wordpress. Maybe someone know it.
(Regardless if you think Wordpress is not a good software. The success show, they make things right.)
This system is build on hooks (actions / filters), which are included within core files, and which provide defined points, where third party software could put in code.
In Wordpress most arguments, lists or return values are filtered to allow modifications of values, by third party modules.
In case of Query Generator I would include (because I already use it in this way) filters, which could modify Advanced Conditions, Fields, Query, etc.
But this requires to modify every class and function to add such calls.
This is a lot of work, if it should not too much, which will be too slow.
@stefanwarnat Thanks for the contribution. That sounds like a great target, but not something I can see vtiger ever implementing as it would just take far too long and involve a complete re-write of most of the core... The comment about the QueryGenerator was mostly down to some hardcoded assumptions which have been made. I've discussed things like this before, such as if you change the Entityfield definition for the User module from first_name,last_name to, user_name. It breaks everything ;-) It can be extended. (See the "EnhancedQueryGenerator" class) and tested for like:
if (!class_exists('EnhancedQueryGenerator')) {...
Also, the custom folder or whatever concept used, could be namespaced to allow for multiple independent modifications.