[Vtigercrm-commits] [vtiger development] #7374: Outlook 2.1 task and calendar sync failing
vtiger development
vtiger-tickets at trac.vtiger.com
Fri Mar 9 03:15:32 PST 2012
#7374: Outlook 2.1 task and calendar sync failing
---------------------------+------------------------------------------------
Reporter: vikas | Owner: developer
Type: defect | Status: new
Priority: critical | Milestone: 5.4.0
Component: outlookplugin | Version: 5.3.0
Severity: Critical | Keywords:
---------------------------+------------------------------------------------
If you are getting one of the following issues
"Outlook events are synced but with wrong date"
or
"events saved with wrong dates"
Then the issue is with the date format that is set in your My Preferences.
Since the date format is other than y-m-d, the outlook does not understand
it and it throws an error.
The fix for this issue is given below,
you need to change modules/WSAPP/Handlers/OutlookHandler.php
you need to replace the function convertRecordToNativeFormat from
{{{
private function convertRecordToNativeFormat($module,$record){
if($module == 'Events' || $module =='Calendar'){
$dformat = "Y-m-d H:i:s";
$record['start_time'] =
date($dformat,strtotime($record['date_start']." ".$record['time_start']));
$record['end_time'] =
date($dformat,strtotime($record['due_date']." ".$record['time_end']));
// convert the start time and end time to
user time zone
$dateTimeField = new
DateTimeField($record['start_time']);
$record['start_time'] =
$dateTimeField->getDisplayDateTimeValue($this->user);
$dateTimeField = new
DateTimeField($record['end_time']);
$record['end_time'] =
$dateTimeField->getDisplayDateTimeValue($this->user);
}
return $record;
}
}}}
to
{{{
private function convertRecordToNativeFormat($module,$record){
if($module == 'Events' || $module =='Calendar'){
$dformat = "Y-m-d H:i:s";
// convert the start time and end time to user time zone
$startDateTimeField = new
DateTimeField($record['start_time']);
$startDateTime =
$startDateTimeField->getDisplayDateTimeValue($this->user);
$record['start_time'] =
DateTimeField::__convertToUserFormat($startDateTime, 'yyyy-mm-dd');
$endDateTimeField = new
DateTimeField($record['end_time']);
$endDateTime =
$endDateTimeField->getDisplayDateTimeValue($this->user);
$record['end_time'] =
DateTimeField::__convertToUserFormat($endDateTime, 'yyyy-mm-dd');
}
return $record;
}
}}}
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7374>
vtiger development <http://trac.vtiger.com/>
vtiger CRM
More information about the vtigercrm-commits
mailing list