Staff Vacation Calendar with Time Cockpit and Office 365

Wednesday, September 30, 2015 by Alexander Huber

In this article, we will show how you can connect time cockpit with Microsoft Office 365 to create a staff vacation calendar in SharePoint  and Outlook. This approach has particularly two benefits:

  • Manage vacations in a single system: You maintain vacations only in time cockpit and the staff vacation calendar is filled automatically.
  • Combine the strengths of time cockpit and Office 365: Time cockpit uses vacation data for doing working time calculations and Office 365 provides a quick overview about vacations to all employees.

The Business Case

Recently, a customer approached us with a business problem that many companies have according to our experience: The company manages vacations and sick leaves in time cockpit. Additionally, they also have an approval workflow for vacations in place. The main benefit of using time cockpit not only for time tracking but also for absence management is that time cockpit is able to calculate target and actual hours for each employee. 

However, time cockpit does not provide an integrated view showing all employees' vacations and vacation overlappings. There are other tools that are very good at displaying team calendars like that - for example Microsoft SharePoint and Microsoft Outlook. Clearly, it does not make much sense to manually enter vacations in both time cockpit and SharePoint/Outlook. So we decided to connect time cockpit and SharePoint/Outlook to get the best of both worlds.

The Benefits at a Glance

  • One leading system to manage vacations (time cockpit), no redundancies
  • A customizable approval workflow (time cockpit)
  • Accurate record of target and actual working hours for employees (time cockpit)
  • Powerful calendar views (SharePoint and Outlook)
  • Vacations also available on mobile platforms (SharePoint and Outlook)

How Does It Work?

This article will not go into much technical details. It explains the basic ideas about how to connect your time cockpit with SharePoint and Outlook in Office 365. This is because the implementation of e.g. the web job component (see below) differs from customer to customer. If you are interested in a solution for your company, please contact us at support@timecockpit.com.

The following figure shows the components involved to integrate time cockpit with SharePoint and Outlook in Office365 (click to enlarge).


As mentioned earlier, time cockpit is used to manage vacations and sick leaves and we will not go into detail about how to manage absence times in time cockpit. If you interested in that topic, please refer to our online documentation and "Higher Mathematics" of Paid Time Off.

Azure Webjobs

For our customer, we implemented an Azure Webjob in his own Microsoft Azure subscription. The web job uses time cockpit's OData Web API to fetch all the vacations for the employees of the company. Further, the web job connects to the SharePoint instance of the customer and queries the vacations that have already been exported to a dedicated calendar app in Sharepoint. Afterwards the web job syncs both calendars by creating new entries, updating existing entries and deleting non-existent entries in the Sharepoint calendar. To connect to the customer's Sharepoint, we use a service proxy generated by Visual Studio. 

SharePoint Calendar App

To have a common calendar for the vacations, we create a Calendar App in SharePoint. Here you can find a video created by Microsoft that shows how to create a SharePoint calendar app.

Please make sure that you create the calendar as a SharePoint app and that the regional settings for the calendar fit your region and time zone.

Of course you can use all the means of configuration in SharePoint afterwards. 


Please be aware that employees must not alter vacation entries in the SharePoint calendar. All the changes will be overwritten when the web job synchronizes the vacations again.

App Principal

To authenticate with our customer's SharePoint, we do not use an Office 365 user. A dedicated user would generate monthly costs, thus we decided to authenticate via an App Principal. You can register an app principal directly in SharePoint. Unfortunately, there is no convenient assistant for that. You need to perform the following steps manually:

  1. Open the URL https://XXX.sharepoint.com/_layouts/AppRegNew.aspx (replace XXX with your company name)
  2. Generate a client id and a client secret

The client id and the secret are used to authenticate with your SharePoint instance. In our implementation we pass the client id and the secret for each request to SharePoint in the Authentication  header.

After you have created your app principal, you need to set permissions for the principal. Again, you need to do that with a specific URL:

  1. Open the URL https://XXX.sharepoint.com/_layouts/AppInv.aspx (replace XXX with your company name)
  2. Enter the client id you created in the previous step
  3. Provide a permission request file

The permission request file looks like the following and lets you configure permissions for the app principal.

<AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="Write" />
</AppPermissionRequests>

After you confirmed the permission request, SharePoint will ask you to select the app you want the app principal to have permission to. Please make sure to select the calendar app you created for time cockpit vacations.

Display Vacations in Outlook

To integrate the SharePoint calendar in Outlook, employees can simply click Connect to Outlook in the menu of the calendar. A dialog window in Outlook will open and guide you through the process. 


After you finished importing the SharePoint calendar, the calendar will show up under the Other Calendars section in your Outlook. From there, you can take benefit from all functions and views of Microsoft Outook. 


Conclusion

There are tools for collaboration, office tasks, time tracking, vacation management, managing customer relations and so on. Although, each tool focuses on a certain aspect of work, their functionality often overlap. Data tends to get inconsistent if it is manually maintained in multiple places.

In this article we showed how time cockpit can be the leading system for absence management without missing the powerful collaboration and visualization features of SharePoint and Outlook.

If you think that this approach would make vacation planning in your company more convenient and accurate, let us know. We are glad to help you connect your time cockpit with other systems in your company.

comments powered by Disqus