SharePoint 2010 Calendar View: Hide End time, Remove ToolTip

Add a CEWP and add the below script as HTML Source.

// Created a new column on xRM Task list that concatenates the
// Due Date and Due Time into a single Date/Time field.
// Use the new Date/Time field in the Calendar view configuration as start/end date
// Use jQuery to:
// – change the monthly calendar time range displays (e.g., 3:30 pm – 3:30 pm)
// such that only a single time displays. There is no begin and end date/time
// field in the xRM Task list. Steve will use the Due Date and Due Time to track his activities.
// – Make the same change to tooltips.
// – link to edit form instead of display form. Return automatically to calendar
// the “populateCalendarEventLinkIntercept” technique came from Mike Smith:
// http://techtrainingnotes.blogspot.com/2010/06/sharepoint-2010-color-coded-calendars.html
// this technique handled all calendar view changes (day-week-month; previous/next)
// except the “n more Items” and “collapse” links when more than 3 items are on a month day.
//
// the setTimeout technique was suggested by Marc Anderson.
// it handles the more/collapse scenario
// load our function to the delayed load list
// but do not do this if page is in “Edit” mode

_spBodyOnLoadFunctionNames.push(‘populateCalendarEventLinkIntercept’);

// hook into the existing SharePoint calendar load function
function populateCalendarEventLinkIntercept()
{

if (SP.UI.ApplicationPages.CalendarNotify.$4a) // 20111006 pre-SP1 – Office 365
{
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4a;
SP.UI.ApplicationPages.CalendarNotify.$4a = function ()
{
OldCalendarNotify();
doModifyCal();
}
}
if (SP.UI.ApplicationPages.CalendarNotify.$4b) // SP2010 SP1
{
var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4b;
SP.UI.ApplicationPages.CalendarNotify.$4b = function ()
{
OldCalendarNotify();
doModifyCal();
}
}
// future service pack change may go here!
// if (SP.UI.ApplicationPages.CalendarNotify.???)

}
// }

function doModifyCal() {
// get text “Previous Month” or “…Week” or “…Day”
var dateUnit = $(“#AsynchronousViewDefault_CalendarView a[title^=’Previous’]”).filter(“:first”).attr(“title”);
// remove “Previous ” from text, leaving only “Month”, “Week” or “Day”
dateUnit=dateUnit.substring(dateUnit.indexOf(” “)+1);
// if there is a more/collapse control (which happens when there are more than three items on month date)
// set its click event to execute this doModifyCal function.
// include a pause to allow for latent data population from separate asynchronous thread
if ($(“a.ms-cal-nav”).eq(0).length) {
$(“div.ms-acal-ctrlitem”).eq(0).click(function() {
window.setTimeout(doModifyCal, 0);
});
}
// if there is at least one non-reformatted time display, clean it up
// A dash in the title signifies that this has not yet been reformatted
// well – not really. I’ll refine this later. The dash would have to be
// within the first 7 characters: hh:mm – hh:mm
var str=””;
var y=$(‘div.ms-acal-rootdiv:eq(1) div[title~=”-“]’).filter(“:first”);
if(y.length) {
var urlString = urlencode(location.href);
var CalData = $(‘div.ms-acal-rootdiv’).eq(1);
$(‘div[title]’, CalData).each(function() {
str=$(this).attr(“title”);
str=str.slice(str.search(“-“)+2); // remove begin time from all link tool tips
$(this).attr(“title”,str);
});
if(dateUnit==”Month”) {
//check for and remove begin time from single-item-per-day times
$(“div.ms-acal-time”).each(function() {
str=$(this).text();
str=str.slice(str.search(“-“)+2);
$(this).text(str);
});
}

// additionally, replace the onclick action of each task item’s link such that a modal Edit form
// will pop up instead of modal Display form. This involves creating a new function that
// calls SP.UI.ModalDialog methods made available to SP2010 through the EcmaScript Client Object Model
// ref – http://msdn.microsoft.com/en-us/library/ff410259.aspx
//
// do not include “more/collapse” link
//
// For clarification purposes we are going to:
//
// change this:
// task title
//
// to this:
// task title
//
var Links = $(“a:not(.ms-cal-nav)”, CalData);
Links.each(function() {
str=$(this).attr(“href”);
str=str.replace(“DispForm”,”EditForm”);
$(this).attr(“href”,”javascript:void();”).attr(“onclick”,”modalEdit(‘” + str + “‘);return(false);”);
});
}
}

function callBackRefresh(dialogResult, returnValue) {
var calDetail2 = $(“#AsynchronousViewDefault_CalendarView > div.ms-acal-rootdiv > table”)
.filter(“:first”)
.attr(“summary”);
}

// We are here because someone clicked on a task item link in one of the
// calendar views.
//
//
function modalEdit(page) {
var options = {
url: page,
title: ‘Edit Task’,
allowMaximize: false,
showClose: true,
dialogReturnValueCallback: callBackRefresh,
autoSize: true
};
SP.UI.ModalDialog.showModalDialog(options);
}
function urlencode(link) {
link = encodeURI(link);
link = link.replace(‘+’, ‘%2B’);
link = link.replace(‘%20’, ‘+’);
link = link.replace(‘*’, ‘%2A’);
link = link.replace(‘/’, ‘%2F’);
link = link.replace(‘@’, ‘%40’);
return link;
}

Source: http://office.microsoft.com/en-us/sharepoint-server-help/create-a-calendar-view-for-an-existing-list-HA103954476.aspx

Advertisements

InfoPath Error ID: 5566 Error accessing a datasource

No errors were logged in Event Logs. We have identified the root cause of the problem to be connectivity with SharePoint User Profile web service as we are using it to populate the properties of logged-in user at form-load.

On the other hand, this seems to be an issue only in a specific environment. So, we wanted to check the settings on the environment.

Resolution Steps:

1) Made sure all the data connection files have the environment specific List GUIDs, URLs and so on

2) Made sure all the settings related to InfoPath Forms Services under Central Admin are proper: Enable web service proxy, Enable cross-data connections, Disable Anonymous access

3) Made sure all the relevant user profiles are properly imported under SSP

4) Made sure that the authentication Loopbackcheck registry entry is disabled on the WFE server

5) Made sure the alternate access mappings or managed paths are not breaking the web service calls in the interim

None worked. Finally, we have added a host file entry on the WFE server (we have only one WFE in our case) to point to its own IP, did a IIS reset  and it worked.

I have actually found this resolution on one of the blogs:

If the WFE servers are load-balanced, we need to add a host file entry on WFE pointing to its own IP on each of WFE. This is to deal with a known issue with InfoPath browser forms; all browser form calls to SharePoint web services will be made to the current machine that invoked the form.

MOSS 2007 – DB Maintenance Plan Specification

Hi All,

Last week, I am being asked to work on a DB Maintenance Plan for the SharePoint environment as the database has crossed over 100 GB and we had experienced few serious issues in the last month.

In this regard, I have created a DB Maintenance Plan based on the white paper: “DB Maintenance – SharePoint Products & Technologies”. Please find attached documents for your reference.

DB Maintenance Plan

DB Maintenance Plan – SharePoint Products & Technologies

This is what I could come up with. Now, I am working on the DB Maintenance Specification – Steps for the SQL DBA Team. Will keep you posted once done.

Thanks

Pradeep Narsimhula MCT, CAPM, ITIL (Foundation)

How to design anonymous access application page?

Source: http://www.sharepointkings.com/2009/07/designing-anonymous-application-page-in.html

If you have a site running in windows authentication or in forms authentication.

If you need to design an application page that can be accessed by the anonymous users as well.

We will inherit the application page by LayoutPageBase class, right? Yes, so first thing to note is instead of inheriting from this class, we are required to inherit from class named UnsecuredLayoutsPageBase.

In addition to this, you also need to override one more method which is

protected override bool AllowAnonymousAccess
{
get
{
return true;
}
}