Where to modify the history sub panel in cases

Hi, all the email attached to a case appear in history, I would like change the columns on this panel.
I would like to remove the column ‘assigned to’, as this just who the case is assigned to and i would like to put in the sender of the email.

I have looked through studio and there is no history tab and the is no history sub panel in Cases. Where do i edit this view?

Any help would be great.

Version 7.10.7
Sugar Version 6.5.25 (Build 344)

Hello,

This may help you https://community.sugarcrm.com/thread/19115

Thanks, This is exactly what i am after, i followed the post from Francesca Shiekh for changing the contact name to a to, from, cc field. however it is not working, I think it is probably to do with the function he has created.

He has it here var/www/html/custom/include/SugarWidgets, This post is over 4 years old, Is this still the place it should be.

Also the class “extends SugarWidgetField” do you know if this is changed in the last 4 years?

Thanks

looking at this thread: https://suitecrm.com/suitecrm/forum/developer-help/19607-looking-for-help-in-adding-the-custom-sugarwidget-subpanel#68474 The widget class is still used.

So I have in /var/www/html/custom/modules/Emails/metadata/subpanels/ForHistory.php


 'contact_name'=>array(
             'widget_class'         => 'SubPanelDetailViewLinkEmailCustom',
        ),

and then /custom/include/generic/SugarWidgets/SugarWidgetSubPanelDetailViewLinkEmailCustom.php


<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/generic/SugarWidgets/SugarWidgetField.php');
class SugarWidgetSubPanelDetailViewLinkEmailCustom extends SugarWidgetField
{
        function displayList(&$layout_def)
        {
                global $focus;
                $to = array();
                $to_addrs = array();
                $from = array();
                $from_addrs = array();
                $cc = array();
                $cc_addrs = array();
                $return = '';
                $email = new Email();
                $email->retrieve($layout_def['fields']['ID']);
                $to_addrs = array_filter(array_unique(explode(';',str_replace(' ' ,';',str_replace(',',';',$email->to_addrs)))));
                $from_addrs = array_filter(array_unique(explode(';',str_replace(' ' ,';',str_replace(',',';',$email->from_addr)))));
                $cc_addrs = array_filter(array_unique(explode(';',str_replace(' ' ,';',str_replace(',',';',$email->cc_addrs)))));
                $return .= "<small>";
                if(!empty($from_addrs)){
                   $return .= "<b>From: </b>";
                   foreach($from_addrs as $addr){
                      if(!empty($addr)) $return .= '<a href="mailto:'.trim($addr).'"><small>' . trim($addr) .'</small></a><br>';
                   }
                }
                if (!empty($to_addrs)){
                   $return .= "<br><b>To: </b>";
                   foreach($to_addrs as $addr){
                      if(!empty($addr)) $return .= '<a href="mailto:'.trim($addr).'"><small>' . trim($addr) .'</small></a><br>';
                   }
                }
                if(!empty($cc_addrs)){
                   $return .= "<br><b>Cc: </b>";
                   foreach($cc_addrs as $addr){
                      if(!empty($addr)) $return .= '<a href="mailto:'.trim($addr).'"><small>' . trim($addr) .'</small></a><br>';
                   }
                }
                $return .= "</small>";
               return($return);
}
}


These are copied from the post https://community.sugarcrm.com/thread/18716 with the addition of these lines at the to of SugarWidgetSubPanelDetailViewLinkEmailCustom.php


if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/generic/SugarWidgets/SugarWidgetField.php');

and the contact field in the history panel for emails is still blank.,

I have also changed the

 return($return);

to

return("hello");

at the end of the widget and there is still nothing in the contact field in the sub panel, I would assume this means the widget isn’t even being called?

Any Help would be great.

Hi can any one else provide assistance to this,. As far as i can tell the sugar widget class it not being called.

Is this the correct location: /custom/include/generic/SugarWidgets/SugarWidgetSubPanelDetailViewLinkEmailCustom.php?

Any other suggestions would be great.

I am having the same issue. Did you ever resolve your problem?
Thanks,
Dianna

No sorry, I still have the assigned to column and do not have the senders email address!

I stumbled across a solution that worked for me. I noticed that the code was being executed only for the Task history and in Tasks, I had a typo where I had put two underscores in the name that I was using in the metadata. So in your example, you would name it contact__name instead of contact_name. So I changed each of the metadata/subpanel ForHistory.php files to add the double underscore and I achieved the result that I desired…Email, Tasks, Notes, Calls and Meetings all included my new History field produced from the custom SugarWidgets that I created for each of them.
My assumption was that the field name that I was using with the single underscore was used somewhere else and the double underscore name was unique…but running a grep on the entire directory, I did not find it used anywhere else. So I cannot say why it worked, but maybe you should try it as we know that contact_name is not unique.
Dianna