Results 1 to 5 of 5

Thread: How to Override subpaneldefs.php

  1. #1
    ndrtek is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default How to Override subpaneldefs.php

    I do not like the default many to many relationship between accounts and projects.

    In our organization, one account may have many projects... but there would never be one project shared across accounts... (can anyone explain the logic behind this default set up?)

    So, I have created a one to many relationship from Account -> Project....

    And now I want to remove the extra "Projects" sub panel from the Accounts Detail View, and the Accounts sub-panel from Projects Detail View in an upgrade safe manner.

    So, from the bit of reading I've done in the docs... it says that the folders under the "custom" directory can be used to override default functionality... so, I copied subpaneldefs.php from the primary modules directory into the custom modules directory, and removed the "projects" entry from the array.

    But, no result... I had to change the primary subpaneldefs.php file... which means at next upgrade my change will likely be overwritten...

    Have I missed the boat?

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: How to Override subpaneldefs.php

    Subpanels are a bit different.

    To do this:
    1. Create a file in custom/Extension/modules/Project/Ext/Layoutdefs/ called ndrtek.php or whatever you'd like.
    2. For the contents:
    PHP Code:
    <?php

    unset($layout_defs['Project']['subpanel_setup']['accounts']);

    ?>
    3. Run Quick Repair/Rebuild on the Projects module.

    This should cause the subpanel to disappear. Once you run the repair rebuild you should see your code in custom/modules/Project/Ext/Layoutdefs/layoutdefs.ext.php

  3. #3
    ndrtek is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default Re: How to Override subpaneldefs.php

    Thanks eggsurplus...

    but what you describe is not occuring.

    I have created <sugar_root>/custom/modules/Project/Ext/Layoutdefs/ndrtek.php

    which includes

    PHP Code:
    <?php

    unset($layout_defs['Project']['subpanel_setup']['accounts']);

    ?>

    and I then ran rebuild... but <sugar_root>/custom/modules/Project/Ext/Layoutdefs/layoutdefs.ext.php

    remains empty.

    However, if I copy that bit of code directly into the custom layoutdefs.ext.php, the desired result is achieved.

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: How to Override subpaneldefs.php

    Close, it needs to be created in custom\Extension\modules\Project\.....etc

  5. #5
    ndrtek is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default Re: How to Override subpaneldefs.php

    Ah, you are, of course, correct.

    Thank you very much... I shall do my best to read more closely...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to override editviewdef
    By gopalkalasa in forum Developer Help
    Replies: 9
    Last Post: 2011-07-22, 01:58 PM
  2. location for modified subpaneldefs
    By Raven24 in forum Help
    Replies: 1
    Last Post: 2009-02-15, 06:54 AM
  3. no custom/ subpaneldefs.php?
    By SugarDev.net in forum Developer Help
    Replies: 5
    Last Post: 2008-04-10, 01:29 AM
  4. subpaneldefs.php versus user preferences.
    By arisjr in forum Developer Help
    Replies: 0
    Last Post: 2008-02-15, 10:07 AM
  5. Override functionality
    By florent in forum Help
    Replies: 0
    Last Post: 2005-03-23, 04:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •