Results 1 to 7 of 7

Thread: Making the Date fields go Orange/Red

  1. #1
    DanBrown is offline Senior Member
    Join Date
    Jul 2008
    Posts
    95

    Default Making the Date fields go Orange/Red

    Hi All,

    I would like to know how to make the Date fields go orange/red when the date they are set to passes, just like the date fields in the call and meeting schedules.

    I am using sugar 5.2.0k, and would like to implement this function on some custom date fields I have created.

    Any assistance is much appreciated.

    Thanks.

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

    Default Re: Making the Date fields go Orange/Red

    Quote Originally Posted by DanBrown View Post
    Hi All,

    I would like to know how to make the Date fields go orange/red when the date they are set to passes, just like the date fields in the call and meeting schedules.

    I am using sugar 5.2.0k, and would like to implement this function on some custom date fields I have created.

    Any assistance is much appreciated.

    Thanks.
    Look at modules/Tasks/Task.php

    function get_list_view_data
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  3. #3
    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: Making the Date fields go Orange/Red

    Quote Originally Posted by mikesolomon View Post
    Look at modules/Tasks/Task.php

    function get_list_view_data
    Actually you need to create a logic_hook process_record in order to implement that in an upgrade safe way.
    But Mike is right, you can implement into logic_hook a similar code found on modules/Tasks/Task.php

    Regards
    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.

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

    Default Re: Making the Date fields go Orange/Red

    Quote Originally Posted by andopes View Post
    Actually you need to create a logic_hook process_record in order to implement that in an upgrade safe way.
    But Mike is right, you can implement into logic_hook a similar code found on modules/Tasks/Task.php

    Regards
    Andre will doing it as a logic_hook also work for dashlets?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  5. #5
    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: Making the Date fields go Orange/Red

    Quote Originally Posted by mikesolomon View Post
    Andre will doing it as a logic_hook also work for dashlets?
    Definitely!
    The logic_hook process_record is called on Subpanels, Dashlets and ListView.

    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.

  6. #6
    lachmac is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Re: Making the Date fields go Orange/Red

    Quote Originally Posted by mikesolomon View Post
    Look at modules/Tasks/Task.php

    function get_list_view_data
    Could you post the code snippet of rthe "logic hook" version? I have been trying this out, but unsuccesful, sofar...

    Thanks!

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

    Default Re: Making the Date fields go Orange/Red

    Quote Originally Posted by lachmac View Post
    Could you post the code snippet of rthe "logic hook" version? I have been trying this out, but unsuccesful, sofar...

    Thanks!
    My logic_hook
    Code:
    <?php
    require_once('data/SugarBean.php');
    require_once('include/utils.php');
    
    class zz_css_casePR {
    	function zz_css_casePR (&$bean, $event, $arguments)
    	{
    	global $timedate;
    	$date_db = $timedate->to_db_date($bean->target . ' 23:59');
    		$today=date("Y-m-d");
    		
    		if( $date_db < $today && $bean->status == 'Open'){
    			$bean->target = "<font class='overdueTask'>".$bean->target ."</font>";
    		} 
    		
    		if( $date_db == $today && $bean->status == 'Open'){
    			$bean->target= "<font class='todaysTask'>".$bean->target."</font>"; #amber
    		}
    	
    	}
    }
    ?>
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Making All fields audited
    By Yasso in forum Developer Help
    Replies: 1
    Last Post: 2010-02-09, 01:06 PM
  2. Making fields required
    By Fay in forum General Discussion
    Replies: 5
    Last Post: 2009-07-28, 01:19 PM
  3. Replies: 2
    Last Post: 2008-01-31, 02:24 AM
  4. Making fields clickable
    By Jamman960 in forum Help
    Replies: 1
    Last Post: 2006-03-07, 03:00 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
  •