using System;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebControls;
namespace KiranK.SharePointSite.EventHandlers
{
public class DownloadManager : SPItemEventReceiver
{
public override void ItemAdding(SPItemEventProperties properties)
{
try
{
this.DisableEventFiring();
//Get Security Level and Select Users/Groups values
string strSecLevel = properties.AfterProperties["Security_x0020_Level"].ToString().Trim();
string strUserOrGroups = properties.AfterProperties["Select_x0020_Users_x0020_or_x002"].ToString().Trim();
//If Specific User is selected, but Users/Groups is blank, we need to display an error message and prevent saving of the Item.
if (strSecLevel == "Specific User" & (strUserOrGroups == "" | strUserOrGroups == string.Empty))
{
properties.ErrorMessage = "The 'Select Users or Groups' field cannot be blank, if you select 'Specific User' as the Security Level for this Document." + "
" + "Please click on the Back button in the browser and select User(s) and/or Group(s).";
properties.Cancel = true;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
this.EnableEventFiring();
}
}
public override void ItemAdded(SPItemEventProperties properties)
{
try
{
//This prevents the Event Receiver from running twice
this.DisableEventFiring();
//Collect the values entered by the user in the newly created Item in the Download Manager List
//Retrieve the properties associated with the newly created Item in the Download Manager List here
SPListItem dwdMgrItem = properties.ListItem;
//Get the Security Level value selected here
string strSecLevel = dwdMgrItem["Security Level"].ToString().Trim();
//Check if Security Level = Specific User
//If True, then we need to call the function that breaks role inhertitance from the Parent List, and implements Item Level permissions
if (strSecLevel == "Specific User")
{
BreakRoleInheritance(properties);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
this.EnableEventFiring();
}
}
public void BreakRoleInheritance(SPItemEventProperties properties)
{
//Get the Users or Groups selected here
//Multiple Users are stored like this -> User or Group selected = 173;#John Doe;#175;#Jane Doe;#172;#John Pongo
//Single User is stored like this -> 173;#John Doe
//Multiple values are separated by semicolons
//string strUserGroupSelected = dwdMgrItem["Select Users or Groups"].ToString().Trim();
//Initialize a SPWeb and SPListItem objects
SPWeb elevatedWeb = null;
SPListItem elevatedListItem = null;
try
{
//Run this code block with Elevated Privileges
//This is because Site Users will NOT have FULL CONTROL in SharePoint
//They will have CONTRIBUTE access in SharePoint and this access level
//does not allow you to break role inheritance.
//However, SPSite and SPWeb objects obtained via the Run With Elevated Privileges method
//will allow these Users to perform this operation.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//This will be a POST request. Call ValidateFormDigest to ensure that this is a valid update and not a cross-site scripting attack
//Refer: http://hristopavlov.wordpress.com/2008/05/21/what-you-need-to-know-about-allowunsafeupdates-part-2/
SPUtility.ValidateFormDigest();
//Get a handle to the SPSite object inside the Elevated code block
using (SPSite elevatedSite = new SPSite(properties.SiteId))
{
//Get a handle to the SPWeb object inside the Elevated code block
using (elevatedWeb = elevatedSite.OpenWeb())
{
//Get the following error if AllowUnsafeUpdates is NOT set to True
//Microsoft.SharePoint.SPException: The security validation for this page is invalid.
elevatedWeb.AllowUnsafeUpdates = true;
//Get a handle to the List Item using the elevated SPWeb object
elevatedListItem = elevatedWeb.GetListItem(properties.ListItem.Url);
//Get all the Users in the Web
//SPUserCollection users = elevatedWeb.AllUsers;
SPUserCollection users = elevatedWeb.SiteUsers;
//Get all the Cross-site Groups for the Site Collection
//SPGroupCollection groups = web.Groups;
SPGroupCollection groups = elevatedWeb.SiteGroups;
//Call BreakRoleInheritance. false indicates that current role assignments in the Parent List will NOT be copied to this Item.
elevatedListItem.BreakRoleInheritance(false);
//Update the List Item
elevatedListItem.Update();
//Call function that will set Item Level Permissions.The user or users will be assigned Contributor permissions to this Item
elevatedListItem = SetItemLevelPermissions(elevatedWeb, elevatedListItem, SPRoleType.Contributor, users, groups);
//Update the Item again
elevatedListItem.Update();
//Set AllowUnsafeUpdates back to false
elevatedWeb.AllowUnsafeUpdates = false;
} //using elevatedWeb
} //using elevateSite
}); //closing for SPSecurity.RunWithElevatedPrivileges
}
catch (Exception ex)
{
throw ex;
}
finally
{
//Dispose SPWeb object
if (elevatedWeb != null)
elevatedWeb.Dispose();
////Dispose SPSite object
//if (elevatedSite != null)
// elevatedSite.Dispose();
}
}
public SPListItem SetItemLevelPermissions(SPWeb setSPWeb, SPListItem setListItem, SPRoleType setRoleType, SPUserCollection users, SPGroupCollection groups)
{
try
{
//Create an ArrayList that will store the User or Group IDs
ArrayList alUserGroup = new ArrayList();
//Get the Users or Groups selected here
//Multiple Users are stored like this -> User or Group selected = 173;#John Doe;#175;#Jane Doe;#172;#John Pongo
//Single User is stored like this -> 173;#John Doe
//Multiple values are separated by semicolons
string strUserGroupSelected = setListItem["Select Users or Groups"].ToString().Trim();
//Split the multiple values and store them in an Array
string[] strArrUserGroup = Regex.Split(strUserGroupSelected, ";#");
//Iterate through the Array and store the User or Group IDs in the ArrayList
foreach (string strUserGroupValue in strArrUserGroup)
{
//Check if the value is a number
//If True, this is a User or Group ID
if (IsWholeNumber(strUserGroupValue))
{
//Add User or Group IDs to the ArrayList
alUserGroup.Add(Int32.Parse(strUserGroupValue));
}
}
//Set the Role Definition to Contribute here...
SPRoleDefinition roleDefinition = setSPWeb.RoleDefinitions.GetByType(setRoleType);
//Iterate through the ArrayList
//Get the User or Group ID
foreach (int intUserGroupID in alUserGroup)
{
//determine if ID is user or group
Boolean isGroup = false;
foreach (SPGroup testGroup in setSPWeb.SiteGroups)
{
if (testGroup.ID == intUserGroupID)
{
isGroup = true;
}
}
if (isGroup == false) //this is a User ID
{
SPUser userToAdd = users.GetByID(intUserGroupID);
SPRoleAssignment userRoleAssignment = new SPRoleAssignment(userToAdd);
userRoleAssignment.RoleDefinitionBindings.Add(roleDefinition);
setListItem.RoleAssignments.Add(userRoleAssignment);
}
else //this is a Group ID
{
SPGroup groupToAdd = groups.GetByID(intUserGroupID);
SPRoleAssignment groupRoleAssignment = new SPRoleAssignment(groupToAdd);
groupRoleAssignment.RoleDefinitionBindings.Add(roleDefinition);
setListItem.RoleAssignments.Add(groupRoleAssignment);
}
}
//Add 'SP Site Administrators' group to the Item Permissions List
SPGroup oSiteAdminGroup = setSPWeb.SiteGroups["SP Site Administrators"];
SPRoleAssignment siteAdminGroupRoleAssignment = new SPRoleAssignment(oSiteAdminGroup);
siteAdminGroupRoleAssignment.RoleDefinitionBindings.Add(roleDefinition);
setListItem.RoleAssignments.Add(siteAdminGroupRoleAssignment);
return setListItem;
}
catch (Exception ex)
{
throw ex;
}
finally
{
//Do nothing
}
}
public override void ItemUpdating(SPItemEventProperties properties)
{
try
{
this.DisableEventFiring();
//Get Security Level and Select Users/Groups values
string strSecLevel = properties.AfterProperties["Security_x0020_Level"].ToString().Trim();
string strUserOrGroups = properties.AfterProperties["Select_x0020_Users_x0020_or_x002"].ToString().Trim();
//If Specific User is selected, but Users/Groups is blank, we need to display an error message and prevent saving of the Item.
if (strSecLevel == "Specific User" & (strUserOrGroups == "" | strUserOrGroups == string.Empty))
{
properties.ErrorMessage = "The 'Select Users or Groups' field cannot be blank, if you select 'Specific User' as the Security Level for this Document." + "
" + "Please click on the Back button in the browser and select User(s) and/or Group(s).";
properties.Cancel = true;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
this.EnableEventFiring();
}
}
public override void ItemUpdated(SPItemEventProperties properties)
{
try
{
this.DisableEventFiring();
string strSecLevel = properties.AfterProperties["Security_x0020_Level"].ToString().Trim();
if (strSecLevel != "Specific User")
{
ResetRoleInheritance(properties);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
this.EnableEventFiring();
}
}
private void ResetRoleInheritance(SPItemEventProperties properties)
{
//Initialize a SPWeb and SPListItem objects
SPWeb elevatedWeb = null;
SPListItem elevatedListItem = null;
try
{
//Run this code block with Elevated Privileges
//This is because Site Users will NOT have FULL CONTROL in SharePoint
//They will have CONTRIBUTE access in SharePoint and this access level
//does not allow you to reset role inheritance.
//However, SPSite and SPWeb objects obtained via the Run With Elevated Privileges method
//will allow these Users to perform this operation.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//This will be a POST request. Call ValidateFormDigest to ensure that this is a valid update and not a cross-site scripting attack
//Refer: http://hristopavlov.wordpress.com/2008/05/21/what-you-need-to-know-about-allowunsafeupdates-part-2/
SPUtility.ValidateFormDigest();
//Get a handle to the SPSite object inside the Elevated code block
using (SPSite elevatedSite = new SPSite(properties.SiteId))
{
//Get a handle to the SPWeb object inside the Elevated code block
using (elevatedWeb = elevatedSite.OpenWeb())
{
//Get the following error if AllowUnsafeUpdates is NOT set to True
//Microsoft.SharePoint.SPException: The security validation for this page is invalid.
elevatedWeb.AllowUnsafeUpdates = true;
//Get a handle to the List Item using the elevated SPWeb object
elevatedListItem = elevatedWeb.GetListItem(properties.ListItem.Url);
//Remove Users and Groups from the People Picker field in this Item
elevatedListItem["Select Users or Groups"] = string.Empty;
//Call ResetRoleInheritance.
//This will remove Item Level Permissions and restore List level Permissions.
//In other words, the Permissions assigned to the List will be inherited by the Item.
elevatedListItem.ResetRoleInheritance();
//Update the List Item
elevatedListItem.Update();
//Set AllowUnsafeUpdates back to false
elevatedWeb.AllowUnsafeUpdates = false;
} //using elevatedWeb
} //using elevateSite
}); //closing for SPSecurity.RunWithElevatedPrivileges
}
catch (Exception ex)
{
throw ex;
}
finally
{
//Dispose SPWeb object
if (elevatedWeb != null)
elevatedWeb.Dispose();
////Dispose SPSite object
//if (elevatedSite != null)
// elevatedSite.Dispose();
}
}
//This method checks if the string that is passed is a valid whole number or not
public bool IsWholeNumber(String strNumber)
{
Regex objNotWholePattern = new Regex("[^0-9]");
return !objNotWholePattern.IsMatch(strNumber);
}
}
}
Thursday, February 11, 2010
SharePoint BreakRoleInheritance() and ResetRoleInheritance() code sample
Friday, February 5, 2010
How To Resolve 'object required' error in Custom Edit Form
Change the value to to 'idAttachmentsRow' (i..e. remove the {generate-id()} part), and the error will not occur.
Your updated code should look like this:
<tr id="idAttachmentsRow"> <td nowrap="true" valign="top" class="ms-formlabel" width="20%"> <SharePoint:FieldLabel ControlMode="Edit" FieldName="Attachments" runat="server"/> </td> <td valign="top" class="ms-formbody" width="80%"> <SharePoint:FormField runat="server" id="AttachmentsField{$Pos}" ControlMode="Edit" FieldName="Attachments" __designer:bind="{ddwrt:DataBind('u',concat('AttachmentsField',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Attachments')}"/> <script></script> </td> </tr>
Credit:
http://support.microsoft.com/kb/953271
Thursday, February 4, 2010
SharePoint Custom List Form with 'Attach File' link working
http://sharepoint07.wordpress.com/2008/02/05/customize-the-newformaspx/
http://social.msdn.microsoft.com/forums/en-US/sharepointcustomization/thread/d3ebb776-f80d-46aa-9cb9-38f90652d001/ (this thread also contains some alternate approaches to resolving this issue)
Listed below are the 2 MS Support articles related to this issue:
http://support.microsoft.com/kb/953271
http://support.microsoft.com/kb/960311
In my case, I had to sort of combine the resolution steps provided in the 2 MS Support articles above. You will see this in my "12 Steps" below.
First and foremost, you need to ensure that you have this configuration in your environment:
1. SP2 (with latest cumulative updates) for SharePoint
2. SP1 for SharePoint Designer (SPD) 2007
3. Install KB960311
I got the steps listed below to work only in the above configuration.
If you have SP2 for SharePoint Designer installed, then you need to remove SPD 2007, re-install it. When you re-install SPD 2007, SP1 will be included in it. You don't have to install SP1 for SPD separately. Then you need to install KB960311. Thanks to my astute Manager, Yoshio Kurtz, for this tip regarding SPD configuration. I would not have been able to resolve this issue without Yoshio's help.
If you have SPD 2007 + SP2, and then try to install KB960311, you will get the following error:
The expected version of the product was not found on the system.
KB960311 does NOT work with SPD that has SP2. It works with SPD that has SP1.
"12 Steps "
1. Created a new List in SharePoint.
2. Ensured that the ‘Attach File’ link works.
3. Ensured that I can view the ‘correct’ Web Part properties window for the default ListFormWebPart in SPD.
4. Added a ‘Person or Group’ column to the List in SharePoint.
5. Ensured that the ‘Attach File’ link works.
6. Created the custom New Form (this gets rendered in a DataFormWebPart) in SPD. I chose to create it outside the WebPartZone.
7. Closed and hid the default ListFormWebPart in SPD. Saved changes. Configured the List to use the custom New Form using the ‘Supporting Files’ tab in SPD.
8. Ensured that the ‘Attach File’ link works.
9. Edited the custom New Form in SharePoint using the ‘&ToolPaneView=2’ URL option, and added a Content Editor Web Part (CEWP).
10. Moved the CEWP to the bottom of the page using SPD. The CEWP was also placed outside the WebPartZone.
a. So the order in which the Web Parts are "situated" in the page are:
i. FIRST, Default ListFormWebPart inside the WebPartZone
ii. SECOND, Custom DataFormWebPart outside the WebPartZone
iii. LAST, CEWP outside the WebPartZone
11. Using SharePoint, added JavaScript code, in the CEWP, to hide/show the People Picker control based on the value selected in a drop down list. Check out my post for the JavaScript code.
12. Tested the Form. Custom Fields work, Hide/Show conditions work, and above all ‘Attach File’ works. I also tested it with multiple files and it worked too.
Wednesday, February 3, 2010
Using JavaScript event handlers in SharePoint List Form Page
Credits:
http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx
http://boris.gomiunik.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/
Here is the JavaScript solution that I came up with. I left the alert statements in the code, for debugging purposes. Insert this code in a Content Editor Web Part and ensure that it is hidden. Also, place the Content Editor Web Part at the very bottom of the page.
IMPORTANT: Insert the JavaScript OR operator (i.e. double pipe) after the identifier == "" portion in the if() statement in the getTagFromIdentifierAndTitle() function below. For some odd reason the OR operator gets removed whenever I publish the post.
<script type="text/javascript">
//This code runs on the onload event of the custom Form
_spBodyOnLoadFunctionNames.push("getSecurityLevelValue");
function hidePeoplePicker() {
//alert("HIDE");
var control = getTagFromIdentifierAndTitle('textarea','UserField_downlevelTextBox','People Picker');
control.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none";
}
function showPeoplePicker() {
//alert("SHOW");
var control = getTagFromIdentifierAndTitle('textarea','UserField_downlevelTextBox','People Picker');
control.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="";}
function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
//alert("tagName = " + tagName);
var len = identifier.length;
//alert("Len = " + len);
var tags = document.getElementsByTagName(tagName);
//alert("tags length = " + tags.length);
for (var i=0; i < tags.length; i++)
{
var tempString = tags[i].id;
//alert("tempString = " + tempString);//NOTE: Insert the OR operator after the identifier == "" portion in the code below
//For some odd reason the OR operator gets removed when I post the blog
if (tags[i].title == title && (identifier == "" tempString.indexOf(identifier) == tempString.length - len))
{
return tags[i];
}
}
return null;
}
function getField(fieldType,fieldTitle) {
var docTags = document.getElementsByTagName(fieldType);
//alert("Length = " + docTags.length);
for (var i=0; i < docTags.length; i++) {
if (docTags[i].title == fieldTitle) {
//alert("Value in getField = " + docTags[i].value);
return docTags[i];
}
}
}
function getSecurityLevelValue() {
//alert("In getSecurityLevelValue");
selectedId = getField('select','Security Level').options[getField('select','Security Level').selectedIndex].value;
//alert("Value in hide =" + selectedId);
if(selectedId != 'Specific User')
{
//alert("NOT Specific User");
hidePeoplePicker();
}
else
{
//alert("Specific User");
showPeoplePicker();
}
}//This code runs on the onchange event of the drop down list field
getField('select','Security Level').onchange = function() {getSecurityLevelValue()};
</script>
Tuesday, February 2, 2010
Hide People Picker control in SharePoint List Forms
I used the following online resources to figure out the JavaScript code to hide the "People Picker" control:
http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx
http://www.cleverworkarounds.com/2008/02/07/more-sharepoint-branding-customisation-using-javascript-part-1/
Here is the JavaScript code. Insert this code in the "Source Editor..." window in a Content Editor Web Part.
IMPORTANT: Insert the JavaScript OR operator () after the identifier == "" portion in the
if() statement in the getTagFromIdentifierAndTitle() function below. For some odd reason the OR operator gets removed whenever I publish the post.
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideFields");
function hideFields() {
var control = getTagFromIdentifierAndTitle("Textarea","UserField_downlevelTextBox","People Picker");
control.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none";
}
function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++)
{
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == "" tempString.indexOf(identifier) == tempString.length - len))
{
return tags[i];
}
}
return null;
}
</script>
NOTE: The "People Picker" control was embedded 12 levels "deep" from the <tr>
Tuesday, January 19, 2010
SharePoint's Swiss Army Knife - Content Editor Web Part
Here are some excellent resources that show the prowess of the CEWP:
http://pathtosharepoint.wordpress.com/2009/02/15/a-content-editor-web-part-for-every-home/
http://mindsharpblogs.com/Todd/articles/793.aspx
http://www.contenteditorwebpart.com/default.aspx
On a recent project, I had to query SharePoint Lists to determine the status (i.e. delayed, slight delay, on time) of various projects and then display red, yellow, green icons in a dashboard type of interface.
A couple of limitations of the project was that I could not use SharePoint Designer (SPD), which in turn meant that I could not use the Data View Web Part (DVWP). The DVWP allows you to query Lists, but it requires SPD to create/edit it. And I could not use any type of code (assembly/DLL, user control) that needed to be deployed on the SharePoint Server. So I chose to use a CEWP instead to create the dashboard.
Here is the JavaScript/jQuery code that I used:
<span id="spnGrid"> </span>
<br>
<table>
<tr>
<td valign=bottom>Key:</td>
<td><IMG src='Procurement%20Pictures/red_key.png' width='21' height='19' border='none'>Significant Delay/No Progress</td>
<td><IMG src='Procurement%20Pictures/yellow_key.png' width='21' height='19' border='none'>Moderate Progress/Some Delay</td>
<td><IMG src='Procurement%20Pictures/green_key.png' width='21' height='19' border='none'>Good Team Traction/Progress</td>
<td><IMG src='Procurement%20Pictures/notapp_key.png' width='21' height='19' border='none'>Not Applicable</td>
</tr>
</table>
<script type="text/javascript" src="JavaScript/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>Tower and Region Status</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Form_x0020_Type' /> \
<FieldRef Name='Tower' /> \
<FieldRef Name='Region' /> \
<FieldRef Name='_Status' /> \
<FieldRef Name='NA_x0020_Status' /> \
<FieldRef Name='EU_x0020_Status' /> \
<FieldRef Name='LA_x0020_Status' /> \
<FieldRef Name='CEEMA_x0020_Status' /> \
<FieldRef Name='AP_x0020_Status' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
$.ajax({
url: "_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: buildStatusChart,
contentType: "text/xml; charset=\"utf-8\""
});
});
function buildStatusChart(xData, status) {
var imgPkgNASrc, imgPkgEUSrc, imgPkgLASrc, imgPkgCEEMASrc, imgPkgAPSrc;
var imgComNASrc, imgComEUSrc, imgComLASrc, imgComCEEMASrc, imgComAPSrc;
var imgIngNASrc, imgIngEUSrc, imgIngLASrc, imgIngCEEMASrc, imgIngAPSrc;
var imgLogNASrc, imgLogEUSrc, imgLogLASrc, imgLogCEEMASrc, imgLogAPSrc;
var imgManNASrc, imgManEUSrc, imgManLASrc, imgManCEEMASrc, imgManAPSrc;
var imgIndNASrc, imgIndEUSrc, imgIndLASrc, imgIndCEEMASrc, imgIndAPSrc;
var imgIfsNASrc, imgIfsEUSrc, imgIfsLASrc, imgIfsCEEMASrc, imgIfsAPSrc;
var imgMktNASrc, imgMktEUSrc, imgMktLASrc, imgMktCEEMASrc, imgMktAPSrc;
var imgNASrc, imgEUSrc, imgLASrc, imgCEEMASrc, imgAPSrc;
var imgSrcArray = new Array();
$(xData.responseXML).find("z\\:row").each(function() {
//Get NA Region Status
if ($(this).attr("ows_Region") == "NA")
{
imgNASrc = getImageSource($(this).attr("ows__Status"));
}
//Get EU Region Status
if ($(this).attr("ows_Region") == "EU")
{
imgEUSrc = getImageSource($(this).attr("ows__Status"));
}
//Get LA Region Status
if ($(this).attr("ows_Region") == "LA")
{
imgLASrc = getImageSource($(this).attr("ows__Status"));
}
//Get CEEMA Region Status
if ($(this).attr("ows_Region") == "CEEMA")
{
imgCEEMASrc = getImageSource($(this).attr("ows__Status"));
}
//Get AP Region Status
if ($(this).attr("ows_Region") == "AP")
{
imgAPSrc = getImageSource($(this).attr("ows__Status"));
}
//Get Packaging Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Packaging")
{
//Get Packaging NA Status
imgPkgNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Packaging EU Status
imgPkgEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Packaging LA Status
imgPkgLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Packaging CEEMA Status
imgPkgCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Packaging AP Status
imgPkgAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Commodities Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Commodities")
{
//Get Commodities NA Status
imgComNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Commodities EU Status
imgComEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Commodities LA Status
imgComLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Commodities CEEMA Status
imgComCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Commodities AP Status
imgComAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Ingredients Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Ingredients")
{
//Get Ingredients NA Status
imgIngNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Ingredients EU Status
imgIngEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Ingredients LA Status
imgIngLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Ingredients CEEMA Status
imgIngCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Ingredients AP Status
imgIngAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Logistics Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Logistics")
{
//Get Logistics NA Status
imgLogNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Logistics EU Status
imgLogEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Logistics LA Status
imgLogLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Logistics CEEMA Status
imgLogCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Logistics AP Status
imgLogAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Manufacturing Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "External Manufacturing")
{
//Get Manufacturing NA Status
imgManNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Manufacturing EU Status
imgManEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Manufacturing LA Status
imgManLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Manufacturing CEEMA Status
imgManCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Manufacturing AP Status
imgManAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Indirect Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Indirect")
{
//Get Indirect NA Status
imgIndNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Indirect EU Status
imgIndEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Indirect LA Status
imgIndLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Indirect CEEMA Status
imgIndCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Indirect AP Status
imgIndAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get IS Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "IS")
{
//Get IS NA Status
imgIfsNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get IS EU Status
imgIfsEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get IS LA Status
imgIfsLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get IS CEEMA Status
imgIfsCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get IS AP Status
imgIfsAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Get Marketing Tower Status for all 5 Regions
if ($(this).attr("ows_Tower") == "Marketing")
{
//Get Marketing NA Status
imgMktNASrc = getImageSource($(this).attr("ows_NA_x0020_Status"));
//Get Marketing EU Status
imgMktEUSrc= getImageSource($(this).attr("ows_EU_x0020_Status"));
//Get Marketing LA Status
imgMktLASrc= getImageSource($(this).attr("ows_LA_x0020_Status"));
//Get Marketing CEEMA Status
imgMktCEEMASrc= getImageSource($(this).attr("ows_CEEMA_x0020_Status"));
//Get Marketing AP Status
imgMktAPSrc= getImageSource($(this).attr("ows_AP_x0020_Status"));
}
//Store Packaging Tower Images
if(typeof(imgPkgNASrc) !== 'undefined' && imgPkgNASrc != null)
{
imgSrcArray["PkgNA"] = imgPkgNASrc;
}
if(typeof(imgPkgEUSrc) !== 'undefined' && imgPkgEUSrc != null)
{
imgSrcArray["PkgEU"] = imgPkgEUSrc;
}
if(typeof(imgPkgLASrc) !== 'undefined' && imgPkgLASrc != null)
{
imgSrcArray["PkgLA"] = imgPkgLASrc;
}
if(typeof(imgPkgCEEMASrc) !== 'undefined' && imgPkgCEEMASrc != null)
{
imgSrcArray["PkgCEEMA"] = imgPkgCEEMASrc;
}
if(typeof(imgPkgAPSrc) !== 'undefined' && imgPkgAPSrc != null)
{
imgSrcArray["PkgAP"] = imgPkgAPSrc;
}
//Store Commodities Tower Images
if(typeof(imgComNASrc) !== 'undefined' && imgComNASrc != null)
{
imgSrcArray["ComNA"] = imgComNASrc;
}
if(typeof(imgComEUSrc) !== 'undefined' && imgComEUSrc != null)
{
imgSrcArray["ComEU"] = imgComEUSrc;
}
if(typeof(imgComLASrc) !== 'undefined' && imgComLASrc != null)
{
imgSrcArray["ComLA"] = imgComLASrc;
}
if(typeof(imgComCEEMASrc) !== 'undefined' && imgComCEEMASrc != null)
{
imgSrcArray["ComCEEMA"] = imgComCEEMASrc;
}
if(typeof(imgComAPSrc) !== 'undefined' && imgComAPSrc != null)
{
imgSrcArray["ComAP"] = imgComAPSrc;
}
//Store Ingredients Tower Images
if(typeof(imgIngNASrc) !== 'undefined' && imgIngNASrc != null)
{
imgSrcArray["IngNA"] = imgIngNASrc;
}
if(typeof(imgIngEUSrc) !== 'undefined' && imgIngEUSrc != null)
{
imgSrcArray["IngEU"] = imgIngEUSrc;
}
if(typeof(imgIngLASrc) !== 'undefined' && imgIngLASrc != null)
{
imgSrcArray["IngLA"] = imgIngLASrc;
}
if(typeof(imgIngCEEMASrc) !== 'undefined' && imgIngCEEMASrc != null)
{
imgSrcArray["IngCEEMA"] = imgIngCEEMASrc;
}
if(typeof(imgIngAPSrc) !== 'undefined' && imgIngAPSrc != null)
{
imgSrcArray["IngAP"] = imgIngAPSrc;
}
//Store Logistics Tower Images
if(typeof(imgLogNASrc) !== 'undefined' && imgLogNASrc != null)
{
imgSrcArray["LogNA"] = imgLogNASrc;
}
if(typeof(imgLogEUSrc) !== 'undefined' && imgLogEUSrc != null)
{
imgSrcArray["LogEU"] = imgLogEUSrc;
}
if(typeof(imgLogLASrc) !== 'undefined' && imgLogLASrc != null)
{
imgSrcArray["LogLA"] = imgLogLASrc;
}
if(typeof(imgLogCEEMASrc) !== 'undefined' && imgLogCEEMASrc != null)
{
imgSrcArray["LogCEEMA"] = imgLogCEEMASrc;
}
if(typeof(imgLogAPSrc) !== 'undefined' && imgLogAPSrc != null)
{
imgSrcArray["LogAP"] = imgLogAPSrc;
}
//Store Manufacturing Tower Images
if(typeof(imgManNASrc) !== 'undefined' && imgManNASrc != null)
{
imgSrcArray["ManNA"] = imgManNASrc;
}
if(typeof(imgManEUSrc) !== 'undefined' && imgManEUSrc != null)
{
imgSrcArray["ManEU"] = imgManEUSrc;
}
if(typeof(imgManLASrc) !== 'undefined' && imgManLASrc != null)
{
imgSrcArray["ManLA"] = imgManLASrc;
}
if(typeof(imgManCEEMASrc) !== 'undefined' && imgManCEEMASrc != null)
{
imgSrcArray["ManCEEMA"] = imgManCEEMASrc;
}
if(typeof(imgManAPSrc) !== 'undefined' && imgManAPSrc != null)
{
imgSrcArray["ManAP"] = imgManAPSrc;
}
//Store Indirect Tower Images
if(typeof(imgIndNASrc) !== 'undefined' && imgIndNASrc != null)
{
imgSrcArray["IndNA"] = imgIndNASrc;
}
if(typeof(imgIndEUSrc) !== 'undefined' && imgIndEUSrc != null)
{
imgSrcArray["IndEU"] = imgIndEUSrc;
}
if(typeof(imgIndLASrc) !== 'undefined' && imgIndLASrc != null)
{
imgSrcArray["IndLA"] = imgIndLASrc;
}
if(typeof(imgIndCEEMASrc) !== 'undefined' && imgIndCEEMASrc != null)
{
imgSrcArray["IndCEEMA"] = imgIndCEEMASrc;
}
if(typeof(imgIndAPSrc) !== 'undefined' && imgIndAPSrc != null)
{
imgSrcArray["IndAP"] = imgIndAPSrc;
}
//Store IS Tower Images
if(typeof(imgIfsNASrc) !== 'undefined' && imgIfsNASrc != null)
{
imgSrcArray["IfsNA"] = imgIfsNASrc;
}
if(typeof(imgIfsEUSrc) !== 'undefined' && imgIfsEUSrc != null)
{
imgSrcArray["IfsEU"] = imgIfsEUSrc;
}
if(typeof(imgIfsLASrc) !== 'undefined' && imgIfsLASrc != null)
{
imgSrcArray["IfsLA"] = imgIfsLASrc;
}
if(typeof(imgIfsCEEMASrc) !== 'undefined' && imgIfsCEEMASrc != null)
{
imgSrcArray["IfsCEEMA"] = imgIfsCEEMASrc;
}
if(typeof(imgIfsAPSrc) !== 'undefined' && imgIfsAPSrc != null)
{
imgSrcArray["IfsAP"] = imgIfsAPSrc;
}
//Store Marketing Tower Images
if(typeof(imgMktNASrc) !== 'undefined' && imgMktNASrc != null)
{
imgSrcArray["MktNA"] = imgMktNASrc;
}
if(typeof(imgMktEUSrc) !== 'undefined' && imgMktEUSrc != null)
{
imgSrcArray["MktEU"] = imgMktEUSrc;
}
if(typeof(imgMktLASrc) !== 'undefined' && imgMktLASrc != null)
{
imgSrcArray["MktLA"] = imgMktLASrc;
}
if(typeof(imgMktCEEMASrc) !== 'undefined' && imgMktCEEMASrc != null)
{
imgSrcArray["MktCEEMA"] = imgMktCEEMASrc;
}
if(typeof(imgMktAPSrc) !== 'undefined' && imgMktAPSrc != null)
{
imgSrcArray["MktAP"] = imgMktAPSrc;
}
//Store NA Region Image
if(typeof(imgNASrc) !== 'undefined' && imgNASrc != null)
{
imgSrcArray["NA"] = imgNASrc;
}
//Store EU Region Image
if(typeof(imgEUSrc) !== 'undefined' && imgEUSrc != null)
{
imgSrcArray["EU"] = imgEUSrc;
}
//Store LA Region Image
if(typeof(imgLASrc) !== 'undefined' && imgLASrc != null)
{
imgSrcArray["LA"] = imgLASrc;
}
//Store CEEMA Region Image
if(typeof(imgCEEMASrc) !== 'undefined' && imgCEEMASrc != null)
{
imgSrcArray["CEEMA"] = imgCEEMASrc;
}
//Store AP Region Image
if(typeof(imgAPSrc) !== 'undefined' && imgAPSrc != null)
{
imgSrcArray["AP"] = imgAPSrc;
}
});
var spnElement= document.getElementById("spnGrid");
//Construct table HTML here
var tableHtml = "";
tableHtml = "<TABLE border='1' cellspacing='0' cellpadding='1'";
tableHtml += "<TBODY>";
//Construct Top row here
tableHtml += "<TR>"
tableHtml += "<TD> </TD>";
tableHtml += "<TD valign=top><A HREF='Tower%20and%20Region%20Status/Forms/Region%20Status.aspx'>Region Status</A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Logistics.aspx'>Logistics</A><br><A HREF='Procurement%20Forms/Forms/Logistics.aspx'><IMG src='Procurement%20Pictures/cargocontainers_thumb.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Ingredients.aspx'>Ingredients</A><br><A HREF='Procurement%20Forms/Forms/Ingredients.aspx'><IMG src='Procurement%20Pictures/ingredient_thumb.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Commodities.aspx'>Commodities</A><br><A HREF='Procurement%20Forms/Forms/Commodities.aspx'><IMG src='Procurement%20Pictures/corn_thumb.jpg' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Packaging.aspx'>Packaging</A><br><A HREF='Procurement%20Forms/Forms/Packaging.aspx'><IMG src='Procurement%20Pictures/cardboardboxes_thumb.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Manufacturing.aspx'>Manufacturing</A><br><A HREF='Procurement%20Forms/Forms/Manufacturing.aspx'><IMG src='Procurement%20Pictures/dairyfactory_thumb.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Marketing.aspx'>Marketing</A><br><A HREF='Procurement%20Forms/Forms/Marketing.aspx'><IMG src='Procurement%20Pictures/bullhorn_thumb.jpg' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/Indirect.aspx'>Indirect</A><br><A HREF='Procurement%20Forms/Forms/Indirect.aspx'><IMG src='Procurement%20Pictures/paperclips_thumb.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/IS.aspx'>IS</A> <br><A HREF='Procurement%20Forms/Forms/IS.aspx'><IMG src='Procurement%20Pictures/is.png' width='77' height='58' border='none'></A></TD>";
tableHtml += "</TR>";
//Construct NA row here
tableHtml += "<TR>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/NA.aspx'>NA</A><br><A HREF='Procurement%20Forms/Forms/NA.aspx'><IMG src='Procurement%20Pictures/na.gif' width='77' height='40' border='none'></A></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["NA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LogNA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IngNA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ComNA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["PkgNA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ManNA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["MktNA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IndNA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IfsNA"]+ "' width='27' height='27'></TD>";
tableHtml += "</TR>";
//Construct EU row here
tableHtml += "<TR>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/EU.aspx'>EU</A><br><A HREF='Procurement%20Forms/Forms/EU.aspx'><IMG src='Procurement%20Pictures/europe_western77x40.gif' width='77' height='40' border='none'></A></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["EU"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LogEU"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IngEU"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ComEU"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["PkgEU"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ManEU"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["MktEU"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IndEU"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IfsEU"]+ "' width='27' height='27'></TD>";
tableHtml += "</TR>";
//Construct LA row here
tableHtml += "<TR>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/LA.aspx'>LA</A><br><A HREF='Procurement%20Forms/Forms/LA.aspx'><IMG src='Procurement%20Pictures/LA.gif' width='77' height='40' border='none'></A></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LogLA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IngLA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ComLA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["PkgLA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ManLA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["MktLA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IndLA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IfsLA"]+ "' width='27' height='27'></TD>";
tableHtml += "</TR>";
//Construct CEEMA row here
tableHtml += "<TR>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/CEEMA.aspx'>CEEMA</A><br><A HREF='Procurement%20Forms/Forms/CEEMA.aspx'><IMG src='Procurement%20Pictures/CEEMA77x40.gif' width='77' height='40' border='none'></A></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["CEEMA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LogCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IngCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ComCEEMA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["PkgCEEMA"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ManCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["MktCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IndCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IfsCEEMA"]+ "' width='27' height='27'></TD>";
tableHtml += "</TR>";
//Construct AP row here
tableHtml += "<TR>";
tableHtml += "<TD align=center><A HREF='Procurement%20Forms/Forms/AP.aspx'>AP</A><br><A HREF='Procurement%20Forms/Forms/AP.aspx'><IMG src='Procurement%20Pictures/asia-pac77x40.gif' width='77' height='40' border='none'></A></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["AP"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["LogAP"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IngAP"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ComAP"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["PkgAP"] + "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["ManAP"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["MktAP"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IndAP"]+ "' width='27' height='27'></TD>";
tableHtml += "<TD align=center><IMG src='" + imgSrcArray["IfsAP"]+ "' width='27' height='27'></TD>";
tableHtml += "</TR>";
//Construct closing table tags
tableHtml += "</TBODY>";
tableHtml += "</TABLE>";
//Assign the tableHTML code to the span tag INNER HTML property to display it
spnElement.innerHTML = tableHtml ;
}
function getImageSource(statusValue)
{
var imgSrc;
if (statusValue == "Red")
{
imgSrc= "Procurement%20Pictures/red.png";
}
else if
(statusValue == "Yellow")
{
imgSrc= "Procurement%20Pictures/yellow.png";
}
else if
(statusValue == "Green")
{
imgSrc= "Procurement%20Pictures/green.png";
}
else
{
imgSrc= "Procurement%20Pictures/notapp.png";
}
return imgSrc;
}
</script>
Thanks to Jan Tielens and Amit Kumar for their excellent blog posts on how to query SharePoint Lists using jQuery and JavaScript.
http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx (using jQuery)
http://amitkumarmca04.blogspot.com/2008/07/how-access-sharepoint-moss-list-data.html (using JavaScript)
I strongly encourage you to check out the awesome CEWP and you will be impressed!!! Trust me :-)
Monday, September 7, 2009
Passed MS 70-630 Certification exam
Here are some resources that I used to prepare for this exam:
Books
http://www.amazon.com/MCTS-Microsoft-Office-SharePoint-Configuration/dp/0470226633
http://www.microsoft.com/mspress/books/9537.aspx
Virtual labs
http://technet.microsoft.com/en-us/virtuallabs/bb499670.aspx
http://msdn.microsoft.com/en-us/cc707678.aspx
Topics covered in the exam
http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-630#tab2
I found the "MCTS: Microsoft Office SharePoint Server 2007 Configuration Study Guide: Exam 70-630" particularly useful. It covers all the exam topics and provides "to-the-point" info. This is a "must have" book for preparing for this exam. Also, I would definitely recommend completing the BDC, Excel Services, and Enterprise Search Virtual Labs. In addition to the above resources, hands-on experience with MOSS 2007 is a necessity to pass this exam.
Search This Blog
Blog Archive
About Me
- Kiran
- My name is Kiran Kakanur. I work for PointBridge(http://www.pointbridge.com).