Thursday, November 14, 2013

Using gantt view with the SP Calendar

A frequent need is to have calendar with an easy overview of who is absent or working out of office. The built-in SP calendar can get you some of the way, but the information tends to be a little hard to read.

I discovered that you could create a Gantt view of your calendar, but that too have some drawbacks so I decided to create a little SP Calendar in Gantt view Control Panel script.

The out of the box gantt view of a calendar looks like this if you set up Title to gantt Title, Start Date to be gantt Start Date and End Time to be gantt Due Date and remove all other fields from the view:

Not very pretty and if you try to add an entry you are likely to end up with an error because of the date time format.

So to make a long story short I searched the internet for solutions and produced a script while stealing with arms and legs. Now my calendar looks like this: 
The New button opens a modal New event dialog, Edit sends you to the Current Events list, Zoom in and Zoom out increases or decreases the detail level and finally the Today button centers the view on the current date, if possible. To make the scrollbars visible, you need to click somewhere inside the calendar. 

So, how do you set up your own gantt view calendar with the SPGanttControlPanel script? 

Let's take it step by step: 
1. Find the calendar you'll use or create a new one.
2. Open the view Current Events.

3. Right-click the Add new event link and click Copy Shortcut

4. Open a new Notepad (or similar) and paste the link for later use.

5. Go back to the view and copy the link to the view from the address bar by clicking F4 + Ctrl + C. 
6. Paste this below the other link in the notepad. 
7. Now create a new view using the Gantt View.

8.Give the view a name and select the columns

9.Set the Gantt Columns

10. Ok and ugly.
11. Now Site Actions, Edit Page.

12. Click Add a Web Part, select Media and Content, Content Editor and click Add

13. Click on the Click here to add new Content or click here.
14. In the Markup Ribbon, click HTML, Edit HTML Source

15. Grab a copy of the script here.
16. Paste the script into the editor window so it looks something like this:

17. Go to the top of the Editor window and replace the text with the two links you previously copied.
The first you copied goes to the Link2NewItem, the second to StrEditLink, remember to keep the ""

18. Click OK, then Page and Stop Editing.

Give it a try and let me know what you think!

No comments:

Post a Comment