Tuesday 11 October 2011

Color Coded Calendar 2007 with fully covered color area




Before start this post I am thanking to the blog planetwilson because I found the color coded calendar article from there this is a modified version from there.
Step 1.  Create a calendar list in your sharepoint server
Step 2.  Create a column name Category  type--> choice    
  
 3.  Create a calculated column
Add caption
     Step 4:  Change the View settings


Step 5:  Add an Content Editor Webpart under the Calendar Control

Step 6:  Paste the following code

<script> 
 var SEPARATOR = "|||"; 
 var nodes, category; 
 nodes = document.getElementsByTagName("a"); 
 function getObjInnerText (obj) 
 {
   return (obj.innerText) ? obj.innerText : (obj.textContent) ? obj.textContent : ""; 
 }  
 for(var i = 0; i < nodes.length; i++) 
 { 
   if(getObjInnerText(nodes[i]).indexOf(SEPARATOR) != -1) 
   { 
     UpdateCalendarEntryText(nodes[i]); 
     var foundNode = nodes[i]; 
     var trap = 0; 
     while(foundNode.nodeName.toLowerCase() != "td") 
     { 
       foundNode = foundNode.parentNode; 
       trap++; 
       if(trap > 10) 
       { 
         break; // don't want to end up in a loop 
       } 
     } 
     var colourinfo = GetCalendarColourInfo(category); 
     if(colourinfo.bg != "") 
     { 
          var temp= foundNode.parentNode; 
          temp=temp.parentNode;
          temp=temp.parentNode;    

          temp.parentNode.style.background = colourinfo.bg; 
          foundNode.style.background = colourinfo.bg; 
     } 
     // try and update the text colour if we can TD/A/NOBR/B/#text 
     if(colourinfo.fg != "") 
     { 
       try 
       { 
         // there should only be one anchor tag 
         childNodes = foundNode.all; 
         for(var j = 0; j < childNodes.length; j++) 
         { 
           if(childNodes[j].nodeName.toLowerCase() == "a") 
           { 
             // found anchor tag 
             childNodes[j].style.color = colourinfo.fg; 
             // set the NOBR tag as well to set the time if it is shown, but set it on the B tag for month view 
             if(childNodes[j].children[0].nodeName.toLowerCase() == "nobr") 
             {  // month view has an extra b tag surrounding the text 
               childNodes[j].children[0].style.color = colourinfo.fg; 
               if(childNodes[j].children[0].children[0].nodeName.toLowerCase() == "b") 
               { 
                 childNodes[j].children[0].children[0].style.color = colourinfo.fg; 
               } 
             } 
             break; 
           } 
         } 
       } 
       catch(e) {} 
     } 
   } 
 } 
 function ColourInfo(bg, fg) 
 { 
   this.bg = bg; 
   this.fg = fg; 
 } 
 function UpdateCalendarEntryText(anchorNode) 
 { 
   var children = anchorNode.childNodes; 
   for(var i = 0; i < children.length; i++) 
   { 
     if(children[i].nodeType == 3 && children[i].nodeValue.indexOf(SEPARATOR) != -1) 
     { 
       var parts = children[i].nodeValue.split(SEPARATOR); 
       category = parts[0]; 
       children[i].nodeValue = parts[1];     
     } 
     else 
       UpdateCalendarEntryText(children[i]); 
   } 
 } 
 function GetCalendarColourInfo(desc) 
 { 
   var colour = new ColourInfo("", ""); 
   var trimmed = desc.replace(/^\s+|\s+$/g, '') ; 
   switch(trimmed.toLowerCase()) 
   { 
      case "appointment": 
           colour.bg = "#ffd266"; 
           colour.fg = ""; 
           break; 
           case "birthday": 
           colour.bg = "#ae99dc"; 
           colour.fg = ""; 
           break; 
           case "business": 
           colour.bg = "#8aabe0"; 
           colour.fg = ""; 
           break; 
           case "important": 
           colour.bg = "#e77379"; 
           colour.fg = ""; 
           break; 
           case "vacation": 
           colour.bg = "#fffa91"; 
           colour.fg = ""; 
           break; 
     default: 
     { 
       colour.bg = ""; 
       colour.fg = ""; 
     } 
   } 
   return colour; 
 } 
 </script> 

Step 5:  Exit the edit mode   Happy Coding

Configure outgoing e-mail settings (Office SharePoint Server)


Use this procedure to configure the default outgoing e-mail settings for all Web applications. You can override the default outgoing e-mail settings for specific Web applications by using the procedure that is described in Configure outgoing e-mail settings for a specific Web application (Office SharePoint Server).

Install and configure the SMTP service

Before you can enable outgoing e-mail, you must install the Internet Information Services (IIS) Simple Mail Transfer Protocol (SMTP) service. After determining which SMTP server to use, the SMTP server must be configured to allow anonymous access and to allow e-mail messages to be relayed. Additionally, the SMTP server must have Internet access if you want the ability to send messages to external e-mail addresses, or it must be able to relay authenticated e-mail to a server that has Internet access. The SMTP server that you use can be a server in the farm, or another server.

Install the SMTP service

The SMTP service is a component of IIS.

Install the SMTP service

  1. In Control Panel, click Add or Remove Programs.
  2. In Add or Remove Programs, click Add/Remove Windows Components.
  3. In the Windows Components Wizard, in the Components box, click Application Server, and then click the Details button.
  4. In the Application Server dialog box, in the Subcomponents of Application Server box, click Internet Information Services (IIS), and then click the Details button.
  5. In the Internet Information Services (IIS) dialog box, select the SMTP Service check box.
  6. Click OK to return to the Application Server dialog box.
  7. Click OK to return to the main page of the Windows Components Wizard.
  8. Click Next.
  9. When Windows has finished installing the SMTP service, on the Completing the Windows Components Wizard page, click Finish.

Configure the SMTP service

After installing the SMTP service, configure the service to accept relayed e-mail from servers in your farm.
You can decide to accept relayed e-mail from all servers except those you specifically exclude. Alternatively, you can block e-mail from all servers except those you specifically include. You can include servers individually, or in groups by subnet or domain.
By enabling both anonymous access and e-mail relaying, you increase the possibility that the SMTP server will be used to relay unsolicited commercial e-mail (spam). It is important to limit this possibility by carefully configuring your mail servers to help protect against spam. One way that you can do this is by limiting relaying to a specific list of servers or domain, and preventing relaying from all other servers.
Important Important:
Membership in the Administrators group on the local computer is required to complete this procedure.

Configure the SMTP service

  1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In IIS Manager, expand the server name that contains the SMTP server that you want to configure.
  3. Right-click the SMTP virtual server that you want to configure, and then click Properties.
  4. On the Access tab, under Access control, click Authentication.
  5. In the Authentication dialog box, under Select acceptable authentication methods for this resource, verify that Anonymous access is selected.
  6. Click OK.
  7. On the Access tab, under Relay restrictions, click Relay.
  8. To enable relaying from any server, under Select which computer may relay through this virtual server, select All except the list below.
  9. To accept relaying from one or more specific servers, follow these steps:
    1. Under Select which computer may relay through this virtual server, select Only the list below.
    2. Click Add, and then add servers one at a time by IP address, or in groups by using a subnet or domain.
    3. Click OK to close the Computer dialog box.
  10. Click OK to close the Relay Restrictions dialog box.
  11. Click OK to close the Properties dialog box.

Configure outgoing e-mail settings

Important Important:
Membership in the Farm Administrators group of the Central Administration site is required to complete this procedure.

Configure outgoing e-mail settings

  1. On the top navigation bar of the SharePoint Central Administration Web site, click Operations.
  2. On the Operations page, in the Topology and Services section, click Outgoing e-mail settings.
  3. On the Outgoing E-Mail Settings page, in the Mail Settings section, type the SMTP server name for outgoing e-mail (for example, mail.example.com) in the Outbound SMTP serverbox.
  4. In the From address box, type the e-mail friendly address as you want it to appear to e-mail recipients.
  5. In the Reply-to address box, type the e-mail address to which you want e-mail recipients to reply.
  6. In the Character set menu, select the character set that is appropriate for your language.
  7. Click OK.
    For information about how to perform this procedure using the Stsadm command-line tool, see Email: Stsadm operation (Office SharePoint Server).