<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
After further testing I confirmed this bug on multiple servers.<br>
<br>
This now works for us after the following changes, please note that
line numbers may be slightly off due to editing the files:<br>
<br>
<blockquote type="cite">modules/Google/connectors/Calendar.php line
143:<br>
</blockquote>
was $maxModifiedTime = date('Y-m-d H:i:s',
strtotime(Google_Contacts_Model::vtigerFormat(end($calendarRecords)->getUpdated()))
+ 1);<br>
now $maxModifiedTime = date('Y-m-d H:i:s',
strtotime(Google_Calendar_Model::vtigerFormat(end($calendarRecords)->getUpdated()))
+ 1);<br>
<br>
<blockquote type="cite">./modules/Google/models/Calendar.php</blockquote>
<blockquote type="cite"> public function vtigerFormat($date) {<br>
// EDIT<br>
$origDate = $date;<br>
// END EDIT<br>
list($date, $timestring) = explode('T', $date);<br>
list($time, $tz) = explode('.', $timestring);<br>
// EDIT - if this is UTC lets change it to correct system
time<br>
if(substr($tz,-1) == 'Z') {<br>
$date = new DateTime($origDate);<br>
$timeZone = new
DateTimeZone(date_default_timezone_get());<br>
$date->setTimezone($timeZone);<br>
$date = $date->format('Y-m-d H:i:s');<br>
return $date;<br>
}<br>
// END EDIT<br>
return $date . " " . $time;<br>
}<br>
</blockquote>
<br>
<blockquote type="cite"> function getStartTimeUTC($user = false)
{ AND function getEndTimeUTC($user = false) {<br>
</blockquote>
was $timeZone = new DateTimeZone('UTC');<br>
now $timeZone = new DateTimeZone(date_default_timezone_get());<br>
<br>
<br>
Would love to get some feedback from the vtiger team.<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 03/03/15 11:54, Richard Hills -
Technologywise wrote:<br>
</div>
<blockquote cite="mid:54F4EA2F.7000801@tw.co.nz" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
Another bit of the puzzle.<br>
<br>
When I change modules/Google/models/Calendar.php functions
getEndTimeUTC and getStartTimeUTC to use the default_timezone set
in config.inc.php I am able to import from google without the
dates being imported incorrectly as UTC.<br>
<br>
The name of this function makes me believe that this is still not
a solution but rather an incorrect workaround, really keen to hear
where the translation from UTC to default timezone is meant to be
done so that I can debug that.<br>
<br>
<div class="moz-cite-prefix">On 02/03/15 14:49, Richard Hills -
Technologywise wrote:<br>
</div>
<blockquote cite="mid:54F3C1BC.4030702@tw.co.nz" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
Just another question should anyone know.<br>
<br>
Inside ./modules/Google/connectors/Calendar.php function
transformToSourceRecord<br>
<br>
time_start/time_end are set up (as utc), but where is the step
where this is meant to be converted to the server timezone? I
could not find this and it is clearly what is failing for us (as
all our imported records are ignoring timezone setting and being
pushed into the database as UTC).<br>
<br>
Thanks<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 02/03/15 11:09, Richard Hills -
Technologywise wrote:<br>
</div>
<blockquote cite="mid:54F38E0B.4020608@tw.co.nz" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
Just confirming this is actually working on a different server
for me. I believe this is an issue with timezone support on
our server. Will let you all know if I can actually find
something to pin the blame on.<br>
<br>
<div class="moz-cite-prefix">On 27/02/15 10:05, Richard Hills
- Technologywise wrote:<br>
</div>
<blockquote cite="mid:54EF8A94.1090106@tw.co.nz" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
As some of you will be aware I have been experiencing issues
with the google sync where entries are brought over from
google with the wrong times.<br>
<br>
I was now able to confirm this issue on a fresh installation
of vtiger and would appreciate someone else verifying to
ensure it is not an issue with our server.<br>
<br>
Steps to verify:<br>
<ul>
<li>Set up a google calendar and set the calendar timezone
to "Auckland New Zealand GMT+12"</li>
<li>Install vtiger 6.2</li>
<ul>
<li>Note, we use GMT+12 as our base time by setting,
$default_timezone = 'Pacific/Auckland'; inside of
config.inc.php<br>
</li>
</ul>
<li>Enable the google calendar sync as outlined here: <a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8482">http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8482</a></li>
<li>Adjust the file modules/Google/connectors/Oauth2.php
on line 122 to remove the / after $site_URL.</li>
<li>Apply the change set here: <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/14431">http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/14431</a><br>
</li>
<li>Create an entry starting at 09:00 and ending at 10:00
in google calendar</li>
<li>Synchronise with the CRM</li>
</ul>
<p>If you get the same results as me you will find a new
calendar event in the CRM scheduled from 20:00 to 21:00.<br>
</p>
<p>Sorry that this is not in trac yet, however as Uma
confirmed that the vtiger team will look at this I thought
maybe I would be duplicating something. Uma did you ever
get any results from that investigation?<br>
</p>
<p>Thank you<br>
</p>
<br>
<br>
<pre class="moz-signature" cols="72">--
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:richard@tw.co.nz">richard@tw.co.nz</a>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.technologywise.co.nz">www.technologywise.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:richard@tw.co.nz">richard@tw.co.nz</a>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.technologywise.co.nz">www.technologywise.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:richard@tw.co.nz">richard@tw.co.nz</a>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.technologywise.co.nz">www.technologywise.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:richard@tw.co.nz">richard@tw.co.nz</a>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.technologywise.co.nz">www.technologywise.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
<a class="moz-txt-link-abbreviated" href="mailto:richard@tw.co.nz">richard@tw.co.nz</a>
<a class="moz-txt-link-abbreviated" href="http://www.technologywise.co.nz">www.technologywise.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
</body>
</html>