This is an old revision of the document!


Google Calendar Sync

mod61.01

ALTER TABLE `vtiger_google_oauth` ADD `additional` TEXT NOT NULL AFTER `userid`;

/* modified by swarnat - mod61.01 */

At first install latest version of my Vtiger Tools. This is absolutely necessary, because I use this module to implement to logic.

File: /modules/Google/connectors/Calendar.php

$query = $calendars->newEventQuery($query);

Insert after

        /* modified by swarnat - mod61.01 */
        if($this->calendarId !== null) {
            $query->setUser($this->calendarId);
        }
        /* modified by swarnat - mod61.01 */

Search

$createdEntry = $gContact->insertEvent($entity);

Replace this line with

                    /* modified by swarnat - mod61.01 */
                    try {
                        if($this->calendarId !== null) {
                            $createdEntry = $gContact->insertEvent($entity, "http://www.google.com/calendar/feeds/".$this->calendarId."/private/full");
                        } else {
                            $createdEntry = $gContact->insertEvent($entity);
                        }
                    } catch (Exception $e) {
                        var_dump($e->getMessage());
                    }
                    /* modified by swarnat - mod61.01 */

Search (The end of this file)

}
?>

Insert before

    /* modified by swarnat - mod61.01 */
    public function getCalendarList() {
        $gdata = new Zend_Gdata_Calendar($this->apiInstance);
        $calendarList = $gdata->getCalendarListFeed();
        $calendars = array();
        foreach ($calendarList as $calendar) {
            $calendars[] = array('title' => (string)$calendar->title, 'id' => (string)$calendar->id);
        }
        return $calendars;
    }
    protected $calendarId = null;
    public function setCalendarId($calendarId) {
        $this->calendarId = $calendarId;
    }
    /* modified by swarnat - mod61.01 */