Modify Activities Subpanel on Opportunity view in Sugar 6.5

  • Home
  • Blog
  • Modify Activities Subpanel on Opportunity view in Sugar 6.5
5 Ways CRM makes Every Employee a Customer Expert 1

If you are looking to Modify Activities Subpanel in SugarCRM 6.5 CE Opportunity view to show different custom date values in the date modified column, leave all other History Views as they are and then copy the following files:

1.   /modules/Calls/metadata/subpanels/ForHistory.php à …/ForOppHistory.php
2.   /modules/Emails/metadata/subpanels/ForHistory.php à …/ForOppHistory.php
3.   /modules/Meetings/metadata/subpanels/ForHistory.php à …/ForOppHistory.php
4.   /modules/Notes/metadata/subpanels/ForHistory.php à …/ForOppHistory.php
5.   /modules/Tasks/metadata/subpanels/ForHistory.php à …/ForOppHistory.php

Then open: /modules/Opportunities/metadata/subpaneldefs.php and change the 5 lines

PHP Code:

  'history' => array( 
    'order' => 20, 
    'sort_order' => 'desc', 
    'sort_by' => 'date_modified', 
          'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE', 
    'type' => 'collection', 
    'subpanel_name' => 'history',   //this values is not associated with a physical file. 
    'module'=>'History', 
    'top_buttons' => array( 
    array('widget_class' => 'SubPanelTopCreateNoteButton'), 
    array('widget_class' => 'SubPanelTopArchiveEmailButton'), 
             array('widget_class' => 'SubPanelTopSummaryButton'), 
    ), 
    'collection_list' => array(  
     'meetings' => array( 
      'module' => 'Meetings', 
      'subpanel_name' => 'ForHistory', 
      'get_subpanel_data' => 'meetings', 
     ), 
     'tasks' => array( 
      'module' => 'Tasks', 
      'subpanel_name' => 'ForHistory', 
      'get_subpanel_data' => 'tasks', 
     ), 
     'calls' => array( 
      'module' => 'Calls', 
      'subpanel_name' => 'ForHistory', 
      'get_subpanel_data' => 'calls', 
     ),  
     'notes' => array( 
      'module' => 'Notes', 
      'subpanel_name' => 'ForHistory', 
      'get_subpanel_data' => 'notes', 
     ),  
     'emails' => array( 
      'module' => 'Emails', 
      'subpanel_name' => 'ForHistory', 
      'get_subpanel_data' => 'emails', 
     ),  
    )    
   ),

to

PHP Code:

  'history' => array( 
    'order' => 20, 
    'sort_order' => 'desc', 
    'sort_by' => 'date_modified', 
          'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE', 
    'type' => 'collection', 
    'subpanel_name' => 'history',   //this values is not associated with a physical file. 
    'module'=>'History', 
    'top_buttons' => array( 
    array('widget_class' => 'SubPanelTopCreateNoteButton'), 
    array('widget_class' => 'SubPanelTopArchiveEmailButton'), 
             array('widget_class' => 'SubPanelTopSummaryButton'), 
    ), 
    'collection_list' => array(  
     'meetings' => array( 
      'module' => 'Meetings', 
      'subpanel_name' => 'ForOppHistory', 
      'get_subpanel_data' => 'meetings', 
     ), 
     'tasks' => array( 
      'module' => 'Tasks', 
      'subpanel_name' => 'ForOppHistory', 
      'get_subpanel_data' => 'tasks', 
     ), 
     'calls' => array( 
      'module' => 'Calls', 
      'subpanel_name' => 'ForOppHistory', 
      'get_subpanel_data' => 'calls', 
     ),  
     'notes' => array( 
      'module' => 'Notes', 
      'subpanel_name' => 'ForOppHistory', 
      'get_subpanel_data' => 'notes', 
     ),  
     'emails' => array( 
      'module' => 'Emails', 
      'subpanel_name' => 'ForOppHistory', 
      'get_subpanel_data' => 'emails', 
     ),  
    )    
   ),

Now open all these ForOppHistory.php files and search the ‘date_modified’ definitions and change them as follows:

  • In Calls:

PHP Code:

//    'date_modified'=>array( 
 //       'vname' => 'LBL_LIST_DATE_MODIFIED', 
 //       'width' => '10%', 
 //    ), 
       'date_start' => array( 
          'alias'   => 'date_modified', 
          'sort_by' => 'date_modified', 
          'vname'   => 'Date', 
          'width'   => '10%', 
       ),
  • In Emails:

PHP Code:

//    'date_modified' => array( 
 //       'width'              => '10%', 
 //    ), 
       'date_sent' => array( 
          'alias'   => 'date_modified', 
          'sort_by' => 'date_modified', 
          'vname'   => 'Date', 
          'width'   => '10%', 
       ),
  • In Meetings:

PHP Code:

//      'date_modified'=>array( 
 //          'vname' => 'LBL_LIST_DATE_MODIFIED', 
 //          'width' => '10%', 
 //      ), 
       'date_start' => array( 
          'alias'   => 'date_modified', 
          'sort_by' => 'date_modified', 
          'vname'   => 'Date', 
          'width'   => '10%', 
       ),
  • In Notes:

PHP Code:

//    'date_modified'=>array( 
 //        'vname' => 'LBL_LIST_DATE_MODIFIED', 
 //        'width' => '10%', 
 //    ), 
       'date_entered' => array( 
          'alias'   => 'date_modified', 
          'sort_by' => 'date_modified', 
          'vname'   => 'Date', 
          'width'   => '10%', 
       ),
  • In Tasks:

PHP Code:

//    'date_modified'=>array( 
 //        'vname' => 'LBL_LIST_DATE_MODIFIED', 
 //        'width' => '10%', 
 //    ), 
       'date_due' => array( 
          'alias'   => 'date_modified', 
          'sort_by' => 'date_modified', 
          'vname'   => 'Date', 
          'width'   => '10%', 
       ),

Finally run “Quick Repair & Rebuild” from Administration for Quick Repair and Rebuild.

Rolustech is a SugarCRM Certified Developer & Partner Firm. We have helped more than 600 firms with various SugarCRM Customization and Integration. Get in touch today for your FREE Business Analysis. We will be happy to assist you!