Showing posts with label calendars. Show all posts
Showing posts with label calendars. Show all posts

Friday, January 10, 2014

Tiny calender in SP 2010

Customer want a small calenderview. Like the one in Outlook.image

This can be achived using all built in tools with some css tinkering.

You need:

  • A calenderlist using a calenderbased view
  • A content editor web part

Steps:

  1. Insert webpart using calenderview
  2. Insert webpart content editor webpart (CEWP)
  3. Edit CEWP

<style>
.ms-acal-header TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TH {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv {
    OVERFLOW: hidden; FLOAT: right; MARGIN-LEFT: 0px
}
.ms-acal-vitem {
    VISIBILITY: hidden; BACKGROUND-COLOR: #f2f2f2
}
.ms-acal-month-weeksel {
    WIDTH: 5px; VISIBILITY: hidden
}
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
}
.ms-acal-month-top {
    WIDTH: 20px; BORDER-BOTTOM: #b6c5c6 1px solid; COLOR: #919649; PADDING-BOTTOM: 2px; TEXT-ALIGN: center; PADDING-TOP: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px
}
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; HEIGHT: 0em; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
}
.ms-acal-summary-itemrow TD DIV {
    HEIGHT: 0px; WIDTH: 0px
}
.ms-acal-vlink IMG {
    VISIBILITY: hidden; MARGIN-RIGHT: 3px
}
.ms-acal-vlink A:hover {
   
}</style>

4. Save

Now this view will expand the row if there is an item on that week. Not so pretty, but itll work for this case.

  • Onhover on date the events of that day should be displayed
  • Date should be bold or different color if their is events on that day.

image

References:

http://www.sharepointgrind.com/Lists/Posts/Post.aspx?ID=19

http://blog.pathtosharepoint.com/2008/10/06/tiny-sharepoint-calendar-1/

http://erikswenson.blogspot.se/2013/04/small-calendar-for-sharepoint-2010-2013.html

Thursday, December 12, 2013

Setting permissions on calendars

A customer want two specifik users to have edit permissions on certain users in the company. It’s many users, is a situation that might have to be done again and again.

So we use powershell for the solution.

First we created a script to check the current permissions to get a baseline of what we’re working with.

foreach ($user in get-content editcalendarusers.txt)

{

write-host "Permissions for user: $user" -foregroundcolor red -backgroundcolor yellow

get-mailboxfolderpermission ${user}:\calendar

}

Where editcalendarusers.txt is a text with one username per line. This is also a good way of validating your editcalenderusers.txt list, to catch any errors or localized boxes.

Since set-mailboxfolderpermissions only can edit existing userpermissions, not add new ones, we first need to run add-mailboxfolderpermission on our userlist. If an account already exist ps throws an error, but no changes are made. Other users already added to the permssions aren’t modified.

First script

----addperm.ps1----

foreach ($user in get-content editcalendarusers.txt)

{

add-mailboxfolderpermission ${user}:\calendar -user john.doe -Accessrights Editor

write-host "john.doe added as editor for $user."

add-mailboxfolderpermission ${user}:\calendar -user charles.doe -Accessrights Editor

write-host "charles.doe added as editor for $user."

}

-----eof-----

Second script

----setperm.ps1.

foreach ($user in get-content editcalendarusers.txt)
{
set-mailboxfolderpermission ${user}:\calendar -user john.doe -Accessrights Editor
write-host "john.doe added as editor for $user."
set-mailboxfolderpermission ${user}:\calendar -user charles.doe -Accessrights Editor
write-host "charles.doe added as editor for $user."
}

---eof-----

If the permissions already are set the second script reports this and goes on to the next line.

One error we ran into was that a few users had changed the language on their mailbox. On these we exchanged the :\calender for the correct folder. In our case :\kalender .

Now obviously we could have made this less static by adding a second loop to process the editors but in this case there were only two so it wasn’t really necessary in this case.

References:

http://technet.microsoft.com/en-us/library/dd298062%28v=exchg.150%29.aspx

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...