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

Thread: tasks assignment email - date = GMT

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

    Default tasks assignment email - date = GMT

    When a task is assigned to a user sugar sends an email

    The date & time on the email is in GMT

    Is there any way to change this so it reports in local time?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  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: tasks assignment email - date = GMT

    Hi, Mike

    It is possible.

    If you take a look at the function set_notification_body in the modules/Tasks/Task.php you will see it set the GMT date time in the notification email.
    You can define a controller for the Task which defines the bean to be called in the save process.
    You can create a new class which extends the Task and override that function converting the date and time to local time.

    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: tasks assignment email - date = GMT

    Quote Originally Posted by andopes
    Hi, Mike

    It is possible.

    If you take a look at the function set_notification_body in the modules/Tasks/Task.php you will see it set the GMT date time in the notification email.
    You can define a controller for the Task which defines the bean to be called in the save process.
    You can create a new class which extends the Task and override that function converting the date and time to local time.

    Cheers
    Andre thanks

    I've done a quick fix in Tasks.php

    Code:
    $query = "SELECT CONVERT_TZ(date_due,'GMT','GB') AS duedate from tasks where id = '$this->id'";
    $result =$this->db->query($query,true, $app_strings['ERR_CREATING_FIELDS']);
    $row = $this->db->fetchByAssoc($result);
    		
    $xtpl->assign("TASK_SUBJECT", $task->name);
    //MFH #13507
    $xtpl->assign("TASK_PRIORITY", (isset($task->priority)?$app_list_strings['task_priority_dom'][$task->priority]:""));
    #$xtpl->assign("TASK_DUEDATE", $task->date_due . " " . $task->time_due); #MJS CHANGE
    $xtpl->assign("TASK_DUEDATE", $row['duedate']); #MJS CHANGE
    Now I just need a way of making it upgrade safe

    Also where is the template for the email held?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  4. #4
    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: tasks assignment email - date = GMT

    Hi Mike.

    Take a look at my previous post:

    You can define a controller for the Task which defines the bean to be called in the save process.
    You can create a new class which extends the Task and override that function converting the date and time to local time.

    This suggestion is the upgrade safe solution.
    If you don't know how to do this, please let me know.

    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.

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

    Default Re: tasks assignment email - date = GMT

    Andre

    Thanks

    Nope don't know how to do it
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  6. #6
    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: tasks assignment email - date = GMT

    Hi Mike.

    This is the content of the controller:

    PHP Code:
    require_once('include/MVC/Controller/SugarController.php');
    require_once(
    'modules/Tasks/CustomTask.php');

    class 
    TaskController extends SugarController {
        function 
    action_save() {
            
    $this->bean = new CustomTask();
            
    $this->bean->save(!empty($this->bean->notify_on_save));
        }

    The class CustomTask will override the function the perform the necessary changes.

    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.

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

    Default Re: tasks assignment email - date = GMT

    Quote Originally Posted by andopes
    Hi Mike.

    This is the content of the controller:

    PHP Code:
    require_once('include/MVC/Controller/SugarController.php');
    require_once(
    'modules/Tasks/CustomTask.php');

    class 
    TaskController extends SugarController {
        function 
    action_save() {
            
    $this->bean = new CustomTask();
            
    $this->bean->save(!empty($this->bean->notify_on_save));
        }

    The class CustomTask will override the function the perform the necessary changes.

    Cheers
    Andre

    Sorry still confused

    Does this code go into a new file?

    If so where should it go and what should it be called
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

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

    Default Re: tasks assignment email - date = GMT

    Quote Originally Posted by andopes
    Hi Mike.

    This is the content of the controller:

    PHP Code:
    require_once('include/MVC/Controller/SugarController.php');
    require_once(
    'modules/Tasks/CustomTask.php');

    class 
    TaskController extends SugarController {
        function 
    action_save() {
            
    $this->bean = new CustomTask();
            
    $this->bean->save(!empty($this->bean->notify_on_save));
        }

    The class CustomTask will override the function the perform the necessary changes.

    Cheers
    Can anyone tell me where this code should go?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  9. #9
    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: tasks assignment email - date = GMT

    Hi Mike.

    This code is the content of the file to be created: custom/modules/Tasks/controller.php

    The CustomTask class is a class which extends Task.
    This class will override the method adjust the GMT date.
    You need to create this class too.

    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.

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

    Default Re: tasks assignment email - date = GMT

    Quote Originally Posted by andopes
    Hi Mike.

    This code is the content of the file to be created: custom/modules/Tasks/controller.php

    The CustomTask class is a class which extends Task.
    This class will override the method adjust the GMT date.
    You need to create this class too.

    Cheers
    Andre thanks

    I had just created it as you posted this

    Getting an error message Fatal error: Call to a member function setup() on a non-object in /srv/www/ivycrm_dev/include/MVC/Controller/ControllerFactory.php on line 59

    Probably something I have done wrong

    Thanks again for all the help
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

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. HOW-TO guide for Email Campaigns.
    By agupta in forum Marketing/Campaign Management
    Replies: 146
    Last Post: 2012-01-31, 03:08 PM
  2. email marketing feature requests
    By maxsutter in forum Feature Requests
    Replies: 1
    Last Post: 2008-10-11, 10:19 AM
  3. Email Date Received
    By mudtel in forum Developer Help
    Replies: 0
    Last Post: 2008-05-16, 08:59 AM
  4. Working with campaings
    By lopes80andre in forum Marketing/Campaign Management
    Replies: 2
    Last Post: 2008-05-16, 07:43 AM
  5. Email Handling and Auto Assignment to Sugar Contacts
    By dakman1 in forum General Discussion
    Replies: 3
    Last Post: 2008-01-22, 04:46 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
  •