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?
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
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.
Andre thanksOriginally Posted by andopes
I've done a quick fix in Tasks.php
Now I just need a way of making it upgrade safeCode:$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
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
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.
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
Hi Mike.
This is the content of the controller:
The class CustomTask will override the function the perform the necessary changes.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));
}
}
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.
AndreOriginally Posted by andopes
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
Can anyone tell me where this code should go?Originally Posted by andopes
Mike Solomon
Development Manager
Ivy Ltd
www.ivy.ltd.uk]www.ivy.ltd.uk
php version 5.2.6
MySql 5.1.59
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.
Andre thanksOriginally Posted by andopes
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks