Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Change History Subpanel

  1. #1
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Change History Subpanel

    I would like to change the history subpanel so that it displays an addittional date

    To make it more complicated this date is different depending on the activity

    tasks - date_due
    calls - date_start
    meetings - date_start
    notes- date_entered
    emails - date_entered

    Is this possible?

    At the moment the only way I can think to do it is to have 5 different history subpanels

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Change History Subpanel

    Hi, Mike.

    It is possible to do.
    Fortunately you can do that in a Upgrade Safe way.
    You have to extend the forHistory.php subpanel definition inside each modules which is included into the collection list of the SubPanel History.

    For the field definition inside the ForHistory.php you have to do the following:

    PHP Code:
            'date_due'=>array(
                
    'vname' => 'LBL_LIST_DATE_DUE,
                '
    width' => '10%',
                '
    alias' => additional_date',
            ), 
    This is a sample for the Task ForHistory.php subpanel definitions.
    What does it say to Sugar: Show the field date_due but insert an alias in the query, this alias to additional_date.
    So all the fields date you want to add must have the alias pointing to the same field, in this case: additional_date.

    I hope it helped you.
    Cheers.
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Change History Subpanel

    Quote Originally Posted by andopes
    Hi, Mike.

    It is possible to do.
    Fortunately you can do that in a Upgrade Safe way.
    You have to extend the forHistory.php subpanel definition inside each modules which is included into the collection list of the SubPanel History.

    For the field definition inside the ForHistory.php you have to do the following:

    PHP Code:
            'date_due'=>array(
                
    'vname' => 'LBL_LIST_DATE_DUE,
                '
    width' => '10%',
                '
    alias' => additional_date',
            ), 
    This is a sample for the Task ForHistory.php subpanel definitions.
    What does it say to Sugar: Show the field date_due but insert an alias in the query, this alias to additional_date.
    So all the fields date you want to add must have the alias pointing to the same field, in this case: additional_date.

    I hope it helped you.
    Cheers.
    Andre - thats exactly what I needed to know

    Now just to complicate things more is it possible to change it so that the order by is the new field?

    At the moment it is ordered by date_modified

    I'm presuming that it is doing a union statement so I guess if I change it so that instead of

    'sort_by' => 'date_start',

    I change it to

    'sort_by' => '5', where 5 is the 5th field selected it might work

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Change History Subpanel

    Quote Originally Posted by andopes
    Hi, Mike.

    It is possible to do.
    Fortunately you can do that in a Upgrade Safe way.
    You have to extend the forHistory.php subpanel definition inside each modules which is included into the collection list of the SubPanel History.

    For the field definition inside the ForHistory.php you have to do the following:

    PHP Code:
            'date_due'=>array(
                
    'vname' => 'LBL_LIST_DATE_DUE,
                '
    width' => '10%',
                '
    alias' => additional_date',
            ), 
    This is a sample for the Task ForHistory.php subpanel definitions.
    What does it say to Sugar: Show the field date_due but insert an alias in the query, this alias to additional_date.
    So all the fields date you want to add must have the alias pointing to the same field, in this case: additional_date.

    I hope it helped you.
    Cheers.
    Andre

    Almost there

    It almost worked

    The problem comes for emails

    'emails' => array(
    'module' => 'Emails',
    'subpanel_name' => 'ForHistory',
    'get_subpanel_data' => 'emails',
    ),
    'linkedemails' => array(
    'module' => 'Emails',
    'subpanel_name' => 'ForUnlinkedEmailHistory',
    'get_subpanel_data' => 'function:get_unlinked_email_query',
    'generate_select'=>true,
    'function_parameters' => array('return_as_array'=>'true'),
    ),

    Changing the email ForHistory makes no impact so I end up with an sql error

    I commented out the lines above and it works which is ok for the time being but I will need emails in the future

    any ideas?

  5. #5
    thancock is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    11

    Default Re: Change History Subpanel

    Andre,

    You say that this mod to ForHistory.php is upgrade safe. can you please explain how so? Does Sugar check for changes to these files?

    I am on Sugar Pro 5f

    Thanks for any help - you are one of the most helpful contributors to these forums - thank you

    Tony

  6. #6
    Rust is offline Member
    Join Date
    Mar 2009
    Posts
    17

    Default Re: Change History Subpanel

    Is it possible to specify the font color of the field in the subpanel somehow? Say by the date?

  7. #7
    drxg7 is offline Member
    Join Date
    Jun 2007
    Posts
    6

    Default Re: Change History Subpanel

    Quote Originally Posted by mikesolomon View Post
    Andre

    Almost there

    It almost worked

    The problem comes for emails

    'emails' => array(
    'module' => 'Emails',
    'subpanel_name' => 'ForHistory',
    'get_subpanel_data' => 'emails',
    ),
    'linkedemails' => array(
    'module' => 'Emails',
    'subpanel_name' => 'ForUnlinkedEmailHistory',
    'get_subpanel_data' => 'function:get_unlinked_email_query',
    'generate_select'=>true,
    'function_parameters' => array('return_as_array'=>'true'),
    ),

    Changing the email ForHistory makes no impact so I end up with an sql error

    I commented out the lines above and it works which is ok for the time being but I will need emails in the future

    any ideas?
    Hi,
    I'm facing the same problem. Commented out those lines ok for now. Also need emails in the future.
    Browse within forums found this:http://www.sugarcrm.com/forums/showthread.php?t=30336

    Quote Originally Posted by DragonflyMaster View Post
    Ok, so..
    I was looking into this and found in \modules\Accounts\metadata\subpaneldefs.php the following:
    PHP Code:
    'linkedemails' => array(
           
    'module' => 'Emails',
           
    'subpanel_name' => 'ForUnlinkedEmailHistory',
           
    'get_subpanel_data' => 'function:get_unlinked_email_query',
           
    'generate_select'=>true,
           
    'function_parameters' => array('return_as_array'=>'true'),
    ), 
    In particular I assume that
    PHP Code:
    'get_subpanel_data' => 'function:get_unlinked_email_query' 
    is a method for retrieving data for Emails subpanels through a javascript function called get_unlinked_email_query that should be defined in <sugar-root>\include\SugarEmailAddress\SugarEmailAddress. js

    I'm not sure but maybe you can use the same syntax with a custom function.
    I'm pointing at:
    through a javascript function called get_unlinked_email_query that should be defined in <sugar-root>\include\SugarEmailAddress\SugarEmailAddress. js
    I couldn't find get_unlinked_email_query function within SugarEmailAddress.js.
    Is this function really caused those emails couldn't passed to the details list? Do we need to define it? How we're going to do that?

    Cheers

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

    Default Re: Change History Subpanel

    Hope to help;

    I had the same error "cant find funcion" .....
    Looking for this function in sugardev.net, I found that this "get_unlinked_email_query", is defined in class account.php, located at SugarCRM\modules\Accounts directory. Probably, a module installation replaced account.php with an incompatible version.

    The workaround I found, for my sugar installation is to look for account.php in some other directory of my installation, and there was one, dated two days ago. So I renamed SugarCRM\modules\Accounts\account.php to "old" and copied the cached copy of account.php to modules\Accounts directory.

    In my case, get it working ok inmediatly.

  9. #9
    blablaz is offline Senior Member
    Join Date
    Jan 2011
    Posts
    25

    Default Re: Change History Subpanel

    Hello everyone,

    I'm looking for a way to change the fields that appear in the subpanels in SugarCRM 6.1
    I can't find the file "ForHistory.php"

    Can anyone help??
    Thanks in advance

  10. #10
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Change History Subpanel

    The file ForHistory.php can be found at modules/<ModuleName>/metadata/subpanels/
    Where <ModuleName> can be: Calls, Emails, Meetings, Notes, Tasks.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2009-08-07, 11:59 AM
  2. Add History Subpanel to Calls Module in 5.0.0b
    By ftloop in forum Developer Help
    Replies: 3
    Last Post: 2008-04-04, 01:04 AM
  3. Change data displayed in history tab
    By christineeff in forum Developer Help
    Replies: 0
    Last Post: 2007-07-02, 08:39 AM
  4. Replies: 3
    Last Post: 2006-07-18, 10:22 AM
  5. Cases and Oportunity module / History of Change
    By highcrm in forum Feature Requests
    Replies: 0
    Last Post: 2006-02-04, 01:42 AM

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
  •