Filter Calendar view SharePoint WWS 3.0

Posted by lerac on Stack Overflow See other posts from Stack Overflow or by lerac
Published on 2010-03-23T21:24:59Z Indexed on 2010/03/24 1:53 UTC
Read the original article Hit count: 523

Filed under:
|
|
|

Hi all,

I have a SP site with a calendarview and would like to filter this on the basis of the current user. Don't be afraid I already figured out how do to this with a list customizing some excisting jScripts and working with Content Editor WebPart. Yet this jScript does not work in a Calendar.

To paint a picture I have columns like:

Judge1 Lawyer Clerk (example).

Underneath these columns there are names ofcourse. However these are not shown in Calendar view, so it is hard to filter on something that is not displayed only the casenumbers.

Now I've been thinking (not always wise) perhaps I can adjust the aspx page of calendar/list by adjusting a filter I applied in SharePoint. This would also solve the issue of displaying all the content before it filters with Java, since it should not be possible for users to see the entire listcontent (security).

I went to Modify list view and created a filter where judge1 = Mr. J. Jenkins. Then I went to SharePoint Designer and opend the Calendar aspx page. To my expectation I found Mr. J. Jenkins with the following code:

Since I can't display image because i'm new, not very handy discrimination I have to give you a url. Code can't be pasted either is completely messes it up even with codemode on.

Hyperlink CODE IMAGE

Keep in mind I just posted a very tiny part of the code (only the part I want to change). Now I have no idea what kind of code this is above this text (SP wss 3.0 uses for aspx pages), but I would like to change Mr. J. Jenkins into a jScript var/val. Since I already managed to get the current user that is logged in content.

var user = jP.getUserProfile(); var userinfspvalue = user.Department;

There is more code around that one 2 ofcourse, yet to give you a picture. The var userinfspvalue is what I would like to replace the text Mr. J. Jenkins into. This would mean the calendar would be dynamically filtered based upon the current user that is logged on.

Have no idea what is possible, perhaps there is a better solution who knows...

Do you know?

Thank you so much ahead!

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about designer