User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:calendar_google_integration [2015/01/13 19:18]
joebordes [Here's a step by step guide to help you configure your Google Account.]
en:calendar_google_integration [2016/09/10 02:01] (current)
Line 1: Line 1:
 ====== Google Integration in Calendar module ====== ====== Google Integration in Calendar module ======
 +
 +===== Google Synchronization =====
 +
 +You can view or synchronize your Google events with your coreBOS events using the Calendar. Firstly you have to [[en:​calendar_google_integration#​configuring_your_connection_with_google_calendar|set up your Google account/​credentials]].
 +
 +  * In case you have more calendars within your Google account, please select the calendar which you would like to use. Please note that one activity type can be synchronized with only one Google calendar.
 +
 +{{ :​en:​corebos:​calendar:​4_4_google_sync_settings.png?​600 |}}
 +
 +  * An additional step is to define export and import i.e. synchronization:​
 +    * Export “activity_name” to calendar – checked means that all new created events in the Calendar will be also exported and visible in the Google calendar. In addition any change of these events will be synchronized towards Google calendar. These events are marked with an icon.
 +    * Import from calendar to “activity_name” - checked means that all new created events in Google calendar will be also visible in the Calendar. In addition any change of these events in Google calendar will be synchronized towards the Calendar. These events are marked with an icon and are not editable on the Calendar side.
 +  * Click on the [Save] button to save the synchronization settings.
 +
 +The Calendar allows you to add Google events into coreBOS (see blue link “Add into coreBOS” in the below picture). Please click on this link to add this event to coreBOS.
 +
 +{{ :​en:​corebos:​calendar:​4_5_synchronized_google.png?​700 |}}
 +
 +<WRAP center round important 70%>​Important note: Events added from Google to coreBOS have to be updated/​edited/​moved in the Calendar only (not in the Google calendar) in order to synchronize the changes done in the Calendar towards Google calendar.</​WRAP>​
 +
 +
 +===== Separating Events/​Calendars =====
 +
 +??? The problem I am facing is that personal events that I have on my Google calendar are showing up on my task list in coreBOS. How can I get this to stop?  I do not keep 2 calendars and I prefer to work with only one. I see in calendar settings that "​Google is connected"​ for my user name. Is this why my task list is picking up everything from my Google calendar?
 +
 +!!! Have a [[en:​calendar_google_separating_events|read at this page]] for some indications.
 +
 +
 +===== Setup calendar event synchronization =====
 +
 +In the image below you can see a simple example of synchronization with Google via separate activity “//Google events//​”. These are the steps:
 +
 +  * Using CRM Settings > Picklist Editor create a new Activity Type for “Events” called “//Google events//” (you can name it as you wish).
 +  * In your Google calendar create a new separate calendar – in the example the name used was //ITS4You meetings// (again, you can name it according to your needs).
 +  * Set up synchronization with Google calendar by clicking on the small "​down"​ arrow that appears when you hover over the newly created event.
 +  * You will see that “//Google events//” are visible in both Calendars with a separate activity type and color.
 +
 +{{ :​en:​corebos:​calendar:​6_1_synch_with_google.png?​600 |}}
 +
 +We implement this approach so it is easy to define which events should be imported to and from Google. It is also suitable in case you don’t need to synchronize your activities with Google anymore and you want to deactivated it.
 +
 +===== Configuring your connection with Google Calendar =====
  
 <WRAP center round important 70%>​**Starting at coreBOS release December 2014**</​WRAP>​ <WRAP center round important 70%>​**Starting at coreBOS release December 2014**</​WRAP>​
Line 5: Line 47:
 We have updated Google Integration from API v.1 //(already deprecated by Google)// to the newest API v.3. We have updated Google Integration from API v.1 //(already deprecated by Google)// to the newest API v.3.
  
-The integration is being done through ​Service Account, which lets a user login to Google Calendar in background by previously entering ​three parameters: ​+The integration is being done through ​Web Application Client ID, which lets a user login to Google Calendar in the background by previously entering ​these parameters: ​
   * API Key,    * API Key, 
-  * Service Account ​Client ID. +  * Client ID. 
-  * p12 Key file.+  * Client Secret 
 +  * Redirect URL.
  
-Due to Google Security issues, integration does not require user's email password anymore. So a user has to configure ​his Google Account in order to get those three values ​and give privileged access ​to certain ​calendars.+Due to Google Security issues, integration does not require user's email password anymore. So you just have to configure ​the parameters above and validate the **admin user**, the rest of users, just need to click on the **//​Authorize ​and Connect//** link to give permission ​to the admin user to manage and share their calendars.
  
  
-=====Here'​s ​a step by step guide to help you configure your Google Account.=====+=====Here ​is a step by step guide to help you configure your Google Account.=====
  
 1.- Go to the link [[https://​console.developers.google.com/​project]] 1.- Go to the link [[https://​console.developers.google.com/​project]]
Line 19: Line 62:
 2.- Create your project 2.- Create your project
  
-{{:​createproj.png?​700|}}+{{ :​createproj.png?​700 |}}
  
 3.- Go to the Project. Click API in **APIs&​auth** section and activate the Calendar API 3.- Go to the Project. Click API in **APIs&​auth** section and activate the Calendar API
  
-{{:​calendarapi.png?​700|}}+{{ :​calendarapi.png?​700 |}}
  
-4.- Go to the Credentials section and create the Public API Key by clicking Create New Key. Choose Server Key+4.- Go to the Credentials section and create the Public API Key by clicking ​**Create New Key**. Choose Server Key
  
- {{:​createapikey.png?​700|}}+{{ :​createapikey.png?​700 |}}
  
-5.- Create ​Service Account ​by clicking **Create New Client ID**. Choose Service Account Option+5.- Create ​Web Application ​by clicking **Create New Client ID** in the OAuth section. Choose Service Account Option 
 +{{ :​en:​crear_id_cliente_1.png?​700 |}}
  
-{{:​serviceacc.png?700|}}+6.- For permit you to create this Client ID , you have to set the values for you Authoritation Screen
  
-6.- Automatically a file will be downloaded. Save it. It is the Key file you will need as one of the three parameters+{{ :​en:​pantalla_de_autorizacion.png?700 |}}
  
-{{:p12file.png?700|}}+7.- Now you can finish to config the Client ID, here is important that you write the url to your coreBOS/​sync.php in Redirect URI. For example**http://​yourcorebos.com/​sync,​php**
  
-7.- You'll get a view like the next image. The selected text is the Client Id or the second parameter you'll need (only put that part) and the API Key is the third one+{{ :​en:​crear_id_cliente_2.png?700 |}}
  
-{{:​serviceacckey.png?700|}}+==== After that, you can see the all data that you need to config Calendar4You====
  
-8.- Now Copy the Email Address field of the Service Account ​ 
  
-{{:emailservacc.png?700|}}+{{ :en:​todos_los_datos.png?800 |}}
  
-9.- Now go into your Google Calendar. Open the Settings (up on the right corner of the calendar). Go into the second tab, Calendars and choose the Calendar/s you want to share with coreBOS Calendar+8.- Now access to your coreBOS like a admin user to copy the last parameters in Calendar4You **settings** ​
  
-{{:calendars.png?700|}}+{{ :en:​administrator.png?350 |}}
  
-10.- Choose ​the second tab, Share this Calendar and in the Share with specific persons section Paste the Email address previously copied. Give write access to that email address and Save. Do this for the other calendars as well.+9.- Press on **Settings** icon to paste the next value in the next window.
  
-{{:share.png?700|}}+{{ :en:settings.png?250 |}}
  
-11.- Now your configuration is done. All you have to do is go into coreBOS Calendar Module. Click the **Setting** button and upload the p12 file you previously downloaded+  ​API Key, 
 +  ​Client ID. 
 +  ​Client Secret 
 +  ​Redirect URL. 
 +{{ :​en:​calendar_settings_1.png?700 |}}
  
-{{:​upload.png?700|}}+==== The checkbox, **insert from Google?** is for read the old and new events that you create in you Google Calendar and create this events in you Calendar4You in coreBOS. ====
  
-{{:googlekeys.png?700|}}+{{ :en:​calendar_settings_2.png?700 |}}
  
-12.- Now you can put the three configuration parameters in the three fields+=== Now you can press Save button to verify this data and if this date is correct ​the window will be close===
  
-{{:calconfig.png?700|}}+11.- After to save the previous data, you have click again in **Settings** ​{{ :en:settings.png?250 |}} and you can see that you can clic in a new link called **Authorize and Connect** , for permit coreBOS to manage your calendars. Now this Authorization is for the actual google user that you have connect in your browser. If you disconnect, you will can to choose an other user to give this authorization
  
-13.- And choose the calendar you want to synchronize on the right of Call or Meeting Activity List+{{ :​en:​authorize_and_connect_1.png?700 |}}
  
-{{:calselect.png?700|}}+{{ :en:​authorize_and_connect_2.png?700 |}}
  
-14.- Create an event and you'll see it on Google Calendar+11.- After to permit, ​you can to select your calendars to add a event type like a Meetings
  
-{{:event.png?700|}}+{{ :en:​select_calendars.png?700 |}}
  
-{{:eventgoogle.png?700|}}+12.- Now your configuration is done, and the rest of users just have to access to their Calendar4You , try to add a google calendar to a event type and in the first time they will see the famous **Authorize and Connect** link. 
 +{{ :en:​omar_llorens.png?​250 |}} 
 + 
 +{{ :​en:​omar_authorize_connect_1.png?​700 |}} 
 + 
 +== Click on the link , permit coreBOS to manage the calendars and finally you will can to select your calendars to your event types. == 
 + 
 + 
 +{{ :​en:​omar_authorize_connect_2.png?​700 |}} 
 +{{ :​en:​omar_authorize_connect_3.png?​700 |}} 
 + 
 + 
 +13.- Just an other thing. For active the Calendar4You Crons to sync the events with Google Calendar, you have to go to coreBOS Settings -> Scheduler the last two crons that you can see the next image. 
 + 
 +{{ :​en:​cron_tasks_c4y.png?700 |}}
  
  
 That's it. Enjoy! That's it. Enjoy!
 +
 +
 +===== Considerations =====
 +
 +  * Google calendar update cron updates only **NOT HELD** events:<​code>​ (vtiger_activity.status != '​Held'​ OR vtiger_activity.status IS NULL)</​code>​
 +  * Deleting the event from google calendar doesn'​t delete it from the calendar in Corebos just from the table of google cal events
 +  * Deleting a google calendar event from Corebos is done one by one (just for the deleted records) using the beforedelete handler.
 +