Hi people,
Did something new today, thought share with the sugar community.
I added a field to the activity sub-panel.
This activity does not appear on the studio so we need to do some code and copy some files in custom to do so.
Here is what i did to add a description field to activity sub panel.
Steps to follow:-
1. modules/Tasks/metadate/subpanels/ForActivities.php copy this file and add to custom/module/Tasks/metadate/subpanels/ForActivities.php, create the folder structure if it aint present.
2. Modify this ForActivities.php in the custom/Tasks/metadata/subpanels/ForActivities.php
I added the description field to the subpanel for tasks.PHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$subpanel_layout = array(
//Removed button because this layout def is a component of
//the activities sub-panel.
'where' => "(tasks.status='Not Started' OR tasks.status='In Progress' OR tasks.status='Pending Input')",
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'close_button'=>array(
'widget_class' => 'SubPanelCloseButton',
'vname' => 'LBL_LIST_CLOSE',
'width' => '6%',
'sortable'=>false,
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'description'=>array(
'vname' => 'description',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
'date_due'=>array(
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
'alias' => 'date_start',
'sort_by' => 'date_start',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'time_due'=>array(
'usage'=>'query_only',
'alias' => 'time_start'
) ,
),
);
?>
3. Similarly do the same for the Meeting and Calls. Just Copy the file from subpanels in modules to there respective folders in custom and modify the code.
And Magic! you will see an additional field in activity subpanel, in the example its description.
Plz feel free to rectify any thing that is wrong or i have missed out.
Hope it is helpful !!!


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks