diff --git a/packages/vtiger/optional/Google.zip b/packages/vtiger/optional/Google.zip index 69a3b0c2c368357d452a2003370852082d588d47..6e192f0a9aa35b4216d895c587fee324be87a866 100644 Binary files a/packages/vtiger/optional/Google.zip and b/packages/vtiger/optional/Google.zip differ diff --git a/pkg/vtiger/modules/Google/modules/Google/connectors/Calendar.php b/pkg/vtiger/modules/Google/modules/Google/connectors/Calendar.php index eb59097aec6fc7b176e8e1a779c7c016cdbe31ca..01dd5f5068886c9c111cab31460d4f7b29be3453 100644 --- a/pkg/vtiger/modules/Google/modules/Google/connectors/Calendar.php +++ b/pkg/vtiger/modules/Google/modules/Google/connectors/Calendar.php @@ -142,17 +142,18 @@ Class Google_Calendar_Connector extends WSAPP_TargetConnector { $this->client->setAccessToken($this->apiConnection->getAccessToken()); $this->service = new Google_Service_Calendar($this->client); } - $query = array( - 'maxResults' => $this->maxResults, - 'orderBy' => 'updated', - 'singleEvents' => true, - ); + if (Google_Utils_Helper::getSyncTime('Calendar', $user)) { $query['updatedMin'] = $this->googleFormat(Google_Utils_Helper::getSyncTime('Calendar', $user)); //shows deleted by default } - + $query['updatedMin'] = date('Y-m-d\TH:i:s\Z', strtotime("-7 days")); + + $query['orderBy'] = 'startTime'; + $query['timeMin'] = date('c',strtotime("-30 days")); + $query['showDeleted'] = false; + $calendarId = Google_Utils_Helper::getSelectedCalendarForUser($user); if(!isset($this->calendars)) { $this->calendars = $this->pullCalendars(true); diff --git a/pkg/vtiger/modules/Google/modules/Google/connectors/Contacts.php b/pkg/vtiger/modules/Google/modules/Google/connectors/Contacts.php index 9465ea03c53198c4ce1534638736f98749ff815f..7b3ea729b7791cb45baf2f98bc911094300c5b6b 100644 --- a/pkg/vtiger/modules/Google/modules/Google/connectors/Contacts.php +++ b/pkg/vtiger/modules/Google/modules/Google/connectors/Contacts.php @@ -643,6 +643,13 @@ Class Google_Contacts_Connector extends WSAPP_TargetConnector { $payLoad = html_entity_decode($atom->asXML(), ENT_QUOTES, $default_charset); $response = $this->sendBatchRequest($payLoad); + + + $main1 = new SimpleXMLElement($payLoad); + $main1->entry->addAttribute('gd:etag', '*'); + $payLoad = $main1->asXML(); + + if($response) { $responseXml = simplexml_load_string($response); $responseXml->registerXPathNamespace('gd', $this->NS['gd']); @@ -711,6 +718,12 @@ Class Google_Contacts_Connector extends WSAPP_TargetConnector { } } $payLoad = html_entity_decode($atom->asXML(), ENT_QUOTES, $default_charset); + + $main1 = new SimpleXMLElement($payLoad); + $main1->entry->addAttribute('gd:etag', '*'); + $payLoad = $main1->asXML(); + + $response = $this->sendBatchRequest($payLoad); $responseXml = simplexml_load_string($response); if($responseXml) {