1 (edited by poncho1234 06/15/2018 03:16:49 pm)

Topic: How to replace an existing 'tab' /module

Reading https://frontaccounting.com/fawiki/inde … ccessSetup near the bottom states:-

Wiki wrote:

Extensions can provide another implementation of core FA area (which are always <100). This way installed extension can e.g. override Purchases tab with another one implemented completely differently.

How is this done exactly?

For example if I wanted to replace the 'Fixed assets' tab with 'My New Extension' tab

Or

Replace the menu item in Dimensions -> 'Dimension Tags' with 'My New Menu Item'

I've tried using the same security codes as the existing menu item, but it keeps appearing as a new menu item.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: How to replace an existing 'tab' /module

I've tried adding the security area again, but still appears as an additional menu item

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: How to replace an existing 'tab' /module

@poncho, I think you are complicating yourself for a simple thing.  You wanted to replace the Tabs for example Purchase with your custom module of Purchase, right,   

Anyhow you have a hook.php file which will inherit the application and create new constructor to create tab for your custom modules. Just use the exiting Slug,it will replace the existing with your module.

Here is my example code for you to understand it .

 
class Kvcodes_app extends application{
    var $apps;
    function __construct()  {
      parent::__construct("AP", _($this->help_context = "&Kvcodes"));
    }
}

This will simply replace your purchase module with Kvcodes and here you have to add the further functions. to replace the links under the menu,

Subscription service based on FA
HRM CRM POS batch Themes

Re: How to replace an existing 'tab' /module

@kvvaradha
Did you test your method ?
as I know function init() of class front_accounting calls all build-in modules before custom modules so the module name of AP (Purchases) will show before the Kvcodes module can change anything.

Phuong

5 (edited by poncho1234 06/17/2018 04:11:43 pm)

Re: How to replace an existing 'tab' /module

@kvvaradha, that works perfectly, thank you. Although I'm not 100% sure how it does though!
Edit after a little thought -
So it is declared using the new ext 'class Kvcodes_app extends application'
then construct the new extension but label it AP -'parent::__construct("AP"...
Then as @notrinos states although the module AP exists calling it again redirects to the new ext?
Is that right?

Now I know I was close last week...I think I tried redeclaring .... 'class AP_app extends applica...' which (I now realise) obviously will not work.

But part of me still thinks apmuthu had something else in mind when he wrote:-

Wiki wrote:

Extensions can provide another implementation of core FA area (which are always <100). This way installed extension can e.g. override Purchases tab with another one implemented completely differently.

Which to me means that the security code has to be re-defined...doesn't it?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: How to replace an existing 'tab' /module

@notrinos,  I tested it with the above code before I post here.  Otherwise I will further add a sentence to "test it on your own". It should work.  Because while I was programming some other module I did it by mistake and it replaced inventory module that time.

Subscription service based on FA
HRM CRM POS batch Themes

Re: How to replace an existing 'tab' /module

@poncho, You dont need to get confused much with this.  Because the extension hook will replace the existing functionality.  The Perfect example is Access security roles. When you define a custom one but it uses the existing system access role numbers, it will override the access permission with new one.

Last, Yes the Wiki talks about the security roles and access permissions.

Subscription service based on FA
HRM CRM POS batch Themes

Re: How to replace an existing 'tab' /module

Yes, sorry I misunderstood your point replacing the whole module not the module name only

Phuong

Re: How to replace an existing 'tab' /module

@kvvaradha you're right I'm over thinking it.

Thanks for all your help

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/