Results 1 to 4 of 4

Thread: Add Accounts Subpanel to the Contacts Module

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    764

    Default Add Accounts Subpanel to the Contacts Module

    Hi, here is my issue.

    An Account can have many contacts and all these contacts are shown in the Contact Subpanel of an Account.

    But a Contact can also be a member of many accounts.

    How do I show the Accounts that a Contact is a member of in the Contacts Module

    Rgds
    C

  2. #2
    gunni is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Cologne, Germany
    Posts
    402

    Default Re: Add Accounts Subpanel to the Contacts Module

    In my Sugar one Contact can only have one Account ...

    P.S.: Hate that:
    Sorry! The administrator has specified that users can only post one message every 90 seconds.

  3. #3
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    764

    Default Re: Add Accounts Subpanel to the Contacts Module

    Contacts - Account should be many to many relationship and if it already is it should show the Account subpanel in the contacts module

  4. #4
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Add Accounts Subpanel to the Contacts Module

    Hi chrislynch8,

    there is a way to show the Accounts subpanel in Contacts:

    1. Copy file <sugar>/modules/Contacts/metadata/subpanels/ForAccounts.php to folder <sugar>/modules/Accounts/metadata/subpanels/
    2. edit file <sugar>/modules/Contacts/metadata/subpaneldefs.php adding to the subpanels arry the following code:
      PHP Code:
      'accounts' => array(
         
      'order' => 90,
         
      'sort_order' => 'asc',
         
      'sort_by' => 'name',
         
      'module' => 'Accounts',
         
      'subpanel_name' => 'ForAccounts',
         
      'get_subpanel_data' => 'accounts',
         
      'add_subpanel_data' => 'account_id',
         
      'title_key' => 'LBL_MODULE_ID',
         
      'top_buttons' => array(
          array(
      'widget_class' => 'SubPanelTopButtonQuickCreate'),
          array(
      'widget_class' => 'SubPanelTopSelectButton''mode'=>'MultiSelect')
         ),
        ), 
    3. Admin->Repair->Clear Template Data Cache
    4. Admin->Repair->Rebuild Relationships
    This solution is NOT upgrade-safe, so you will loose these changes after a sugar upgrade; I've never tried it in an upgrade-safe way, maybe there is one...
    What do you think the cookie monster eats ?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 2011-11-21, 05:17 PM
  2. Replies: 2
    Last Post: 2008-01-14, 05:39 PM
  3. Probleme Subpanel lors duplication d'un module
    By holyfire in forum Français
    Replies: 1
    Last Post: 2007-06-27, 07:08 AM
  4. Replies: 2
    Last Post: 2006-07-30, 01:34 AM
  5. Replies: 0
    Last Post: 2006-07-26, 08:42 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
  •