From fe3664c37767c76c522a715fd0e81ffe9571b346 Mon Sep 17 00:00:00 2001 From: Josh McCarty Date: Fri, 27 Dec 2013 16:42:17 -0700 Subject: [PATCH] Creating release for 2013.01 --- jquery.SPServices-0.7.2.min.js | 19 - ...s-0.7.2.js => jquery.SPServices-2013.01.js | 790 +++++++++++------- jquery.SPServices-2013.01.min.js | 21 + license.txt | 2 +- 4 files changed, 520 insertions(+), 312 deletions(-) delete mode 100644 jquery.SPServices-0.7.2.min.js rename jquery.SPServices-0.7.2.js => jquery.SPServices-2013.01.js (86%) create mode 100644 jquery.SPServices-2013.01.min.js diff --git a/jquery.SPServices-0.7.2.min.js b/jquery.SPServices-0.7.2.min.js deleted file mode 100644 index a77091a..0000000 --- a/jquery.SPServices-0.7.2.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * SPServices - Work with SharePoint's Web Services using jQuery - * Version 0.7.2 -> Note to Marc: Also change var VERSION below. - * @requires jQuery v1.4.2 or greater - jQuery 1.7+ recommended - * - * Copyright (c) 2009-2012 Sympraxis Consulting LLC - * Examples and docs at: - * http://spservices.codeplex.com - * Licensed under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - */ -/** - * @description Work with SharePoint's Web Services using jQuery - * @type jQuery - * @name SPServices - * @category Plugins/SPServices - * @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com - */ -(function(V){var B="0.7.2";var k="/";var ae="Column not found on page";var G="http://schemas.microsoft.com/sharepoint";var r="Alerts";var q="Authentication";var x="Copy";var af="Forms";var s="Lists";var aa="Meetings";var e="People";var b="Permissions";var A="PublishedLinksService";var N="Search";var L="SharePointDiagnostics";var E="SiteData";var m="Sites";var ah="SocialDataService";var ad="SpellCheck";var ap="TaxonomyClientService";var ab="usergroup";var Y="UserProfileService";var au="Versions";var o="Views";var T="WebPartPages";var w="Webs";var d="Workflow";var f="";var y="";var ao=0;var ag="";var Z=[];Z.GetAlerts=[r,false];Z.DeleteAlerts=[r,true];Z.Mode=[q,false];Z.Login=[q,false];Z.CopyIntoItems=[x,true];Z.CopyIntoItemsLocal=[x,true];Z.GetItem=[x,false];Z.GetForm=[af,false];Z.GetFormCollection=[af,false];Z.AddAttachment=[s,true];Z.AddDiscussionBoardItem=[s,true];Z.AddList=[s,true];Z.AddListFromFeature=[s,true];Z.ApplyContentTypeToList=[s,true];Z.CheckInFile=[s,true];Z.CheckOutFile=[s,true];Z.CreateContentType=[s,true];Z.DeleteAttachment=[s,true];Z.DeleteContentType=[s,true];Z.DeleteContentTypeXmlDocument=[s,true];Z.DeleteList=[s,true];Z.GetAttachmentCollection=[s,false];Z.GetList=[s,false];Z.GetListAndView=[s,false];Z.GetListCollection=[s,false];Z.GetListContentType=[s,false];Z.GetListContentTypes=[s,false];Z.GetListItemChanges=[s,false];Z.GetListItemChangesSinceToken=[s,false];Z.GetListItems=[s,false];Z.GetVersionCollection=[s,false];Z.UndoCheckOut=[s,true];Z.UpdateContentType=[s,true];Z.UpdateContentTypesXmlDocument=[s,true];Z.UpdateContentTypeXmlDocument=[s,true];Z.UpdateList=[s,true];Z.UpdateListItems=[s,true];Z.AddMeeting=[aa,true];Z.CreateWorkspace=[aa,true];Z.RemoveMeeting=[aa,true];Z.SetWorkSpaceTitle=[aa,true];Z.ResolvePrincipals=[e,false];Z.SearchPrincipals=[e,false];Z.AddPermission=[b,true];Z.AddPermissionCollection=[b,true];Z.GetPermissionCollection=[b,true];Z.RemovePermission=[b,true];Z.RemovePermissionCollection=[b,true];Z.UpdatePermission=[b,true];Z.GetLinks=[A,true];Z.GetPortalSearchInfo=[N,false];Z.GetQuerySuggestions=[N,false];Z.GetSearchMetadata=[N,false];Z.Query=[N,false];Z.QueryEx=[N,false];Z.Registration=[N,false];Z.Status=[N,false];Z.SendClientScriptErrorReport=[L,true];Z.GetAttachments=[E,false];Z.EnumerateFolder=[E,false];Z.SiteDataGetList=[E,false];Z.SiteDataGetListCollection=[E,false];Z.SiteDataGetSite=[E,false];Z.SiteDataGetSiteUrl=[E,false];Z.SiteDataGetWeb=[E,false];Z.CreateWeb=[m,true];Z.DeleteWeb=[m,false];Z.GetSite=[m,false];Z.GetSiteTemplates=[m,false];Z.AddComment=[ah,true];Z.AddTag=[ah,true];Z.AddTagByKeyword=[ah,true];Z.CountCommentsOfUser=[ah,false];Z.CountCommentsOfUserOnUrl=[ah,false];Z.CountCommentsOnUrl=[ah,false];Z.CountRatingsOnUrl=[ah,false];Z.CountTagsOfUser=[ah,false];Z.DeleteComment=[ah,true];Z.DeleteRating=[ah,true];Z.DeleteTag=[ah,true];Z.DeleteTagByKeyword=[ah,true];Z.DeleteTags=[ah,true];Z.GetAllTagTerms=[ah,false];Z.GetAllTagTermsForUrlFolder=[ah,false];Z.GetAllTagUrls=[ah,false];Z.GetAllTagUrlsByKeyword=[ah,false];Z.GetCommentsOfUser=[ah,false];Z.GetCommentsOfUserOnUrl=[ah,false];Z.GetCommentsOnUrl=[ah,false];Z.GetRatingAverageOnUrl=[ah,false];Z.GetRatingOfUserOnUrl=[ah,false];Z.GetRatingOnUrl=[ah,false];Z.GetRatingsOfUser=[ah,false];Z.GetRatingsOnUrl=[ah,false];Z.GetSocialDataForFullReplication=[ah,false];Z.GetTags=[ah,true];Z.GetTagsOfUser=[ah,true];Z.GetTagTerms=[ah,true];Z.GetTagTermsOfUser=[ah,true];Z.GetTagTermsOnUrl=[ah,true];Z.GetTagUrlsOfUser=[ah,true];Z.GetTagUrlsOfUserByKeyword=[ah,true];Z.GetTagUrls=[ah,true];Z.GetTagUrlsByKeyword=[ah,true];Z.SetRating=[ah,true];Z.UpdateComment=[ah,true];Z.SpellCheck=[ad,false];Z.AddTerms=[ap,true];Z.GetChildTermsInTerm=[ap,false];Z.GetChildTermsInTermSet=[ap,false];Z.GetKeywordTermsByGuids=[ap,false];Z.GetTermsByLabel=[ap,false];Z.GetTermSets=[ap,false];Z.AddGroup=[ab,true];Z.AddGroupToRole=[ab,true];Z.AddRole=[ab,true];Z.AddRoleDef=[ab,true];Z.AddUserCollectionToGroup=[ab,true];Z.AddUserCollectionToRole=[ab,true];Z.AddUserToGroup=[ab,true];Z.AddUserToRole=[ab,true];Z.GetAllUserCollectionFromWeb=[ab,false];Z.GetGroupCollection=[ab,false];Z.GetGroupCollectionFromRole=[ab,false];Z.GetGroupCollectionFromSite=[ab,false];Z.GetGroupCollectionFromUser=[ab,false];Z.GetGroupCollectionFromWeb=[ab,false];Z.GetGroupInfo=[ab,false];Z.GetRoleCollection=[ab,false];Z.GetRoleCollectionFromGroup=[ab,false];Z.GetRoleCollectionFromUser=[ab,false];Z.GetRoleCollectionFromWeb=[ab,false];Z.GetRoleInfo=[ab,false];Z.GetRolesAndPermissionsForCurrentUser=[ab,false];Z.GetRolesAndPermissionsForSite=[ab,false];Z.GetUserCollection=[ab,false];Z.GetUserCollectionFromGroup=[ab,false];Z.GetUserCollectionFromRole=[ab,false];Z.GetUserCollectionFromSite=[ab,false];Z.GetUserCollectionFromWeb=[ab,false];Z.GetUserInfo=[ab,false];Z.GetUserLoginFromEmail=[ab,false];Z.RemoveGroup=[ab,true];Z.RemoveGroupFromRole=[ab,true];Z.RemoveRole=[ab,true];Z.RemoveUserCollectionFromGroup=[ab,true];Z.RemoveUserCollectionFromRole=[ab,true];Z.RemoveUserCollectionFromSite=[ab,true];Z.RemoveUserFromGroup=[ab,true];Z.RemoveUserFromRole=[ab,true];Z.RemoveUserFromSite=[ab,true];Z.RemoveUserFromWeb=[ab,true];Z.UpdateGroupInfo=[ab,true];Z.UpdateRoleDefInfo=[ab,true];Z.UpdateRoleInfo=[ab,true];Z.UpdateUserInfo=[ab,true];Z.AddColleague=[Y,true];Z.AddLink=[Y,true];Z.AddMembership=[Y,true];Z.AddPinnedLink=[Y,true];Z.CreateMemberGroup=[Y,true];Z.CreateUserProfileByAccountName=[Y,true];Z.GetCommonColleagues=[Y,false];Z.GetCommonManager=[Y,false];Z.GetCommonMemberships=[Y,false];Z.GetInCommon=[Y,false];Z.GetPropertyChoiceList=[Y,false];Z.GetUserColleagues=[Y,false];Z.GetUserLinks=[Y,false];Z.GetUserMemberships=[Y,false];Z.GetUserPinnedLinks=[Y,false];Z.GetUserProfileByGuid=[Y,false];Z.GetUserProfileByIndex=[Y,false];Z.GetUserProfileByName=[Y,false];Z.GetUserProfileCount=[Y,false];Z.GetUserProfileSchema=[Y,false];Z.ModifyUserPropertyByAccountName=[Y,true];Z.RemoveAllColleagues=[Y,true];Z.RemoveAllLinks=[Y,true];Z.RemoveAllMemberships=[Y,true];Z.RemoveAllPinnedLinks=[Y,true];Z.RemoveColleague=[Y,true];Z.RemoveLink=[Y,true];Z.RemoveMembership=[Y,true];Z.RemovePinnedLink=[Y,true];Z.UpdateColleaguePrivacy=[Y,true];Z.UpdateLink=[Y,true];Z.UpdateMembershipPrivacy=[Y,true];Z.UpdatePinnedLink=[Y,true];Z.DeleteAllVersions=[au,true];Z.DeleteVersion=[au,true];Z.GetVersions=[au,false];Z.RestoreVersion=[au,true];Z.AddView=[o,true];Z.DeleteView=[o,true];Z.GetView=[o,false];Z.GetViewHtml=[o,false];Z.GetViewCollection=[o,false];Z.UpdateView=[o,true];Z.UpdateViewHtml=[o,true];Z.AddWebPart=[T,true];Z.AddWebPartToZone=[T,true];Z.GetWebPart2=[T,false];Z.GetWebPartPage=[T,false];Z.GetWebPartProperties=[T,false];Z.GetWebPartProperties2=[T,false];Z.CreateContentType=[w,true];Z.GetColumns=[w,false];Z.GetContentType=[w,false];Z.GetContentTypes=[w,false];Z.GetCustomizedPageStatus=[w,false];Z.GetListTemplates=[w,false];Z.GetObjectIdFromUrl=[w,false];Z.GetWeb=[w,false];Z.GetWebCollection=[w,false];Z.GetAllSubWebCollection=[w,false];Z.UpdateColumns=[w,true];Z.UpdateContentType=[w,true];Z.WebUrlFromPageUrl=[w,false];Z.AlterToDo=[d,true];Z.GetTemplatesForItem=[d,false];Z.GetToDosForItem=[d,false];Z.GetWorkflowDataForItem=[d,false];Z.GetWorkflowTaskData=[d,false];Z.StartWorkflow=[d,true];var S={};S.header="";S.footer="";S.payload="";var ac;V.fn.SPServices=function(t){var av=V.extend({},V.fn.SPServices.defaults,t);S.opheader="<"+av.operation+" ";switch(Z[av.operation][0]){case r:S.opheader+="xmlns='"+G+"/soap/2002/1/alerts/' >";ac=G+"/soap/2002/1/alerts/";break;case aa:S.opheader+="xmlns='"+G+"/soap/meetings/' >";ac=G+"/soap/meetings/";break;case b:S.opheader+="xmlns='"+G+"/soap/directory/' >";ac=G+"/soap/directory/";break;case A:S.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/' >";ac="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/";break;case N:S.opheader+="xmlns='urn:Microsoft.Search' >";ac="urn:Microsoft.Search/";break;case L:S.opheader+="xmlns='"+G+"/diagnostics/' >";ac="http://schemas.microsoft.com/sharepoint/diagnostics/";break;case ah:S.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService' >";ac="http://microsoft.com/webservices/SharePointPortalServer/SocialDataService/";break;case ad:S.opheader+="xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/'";ac="http://schemas.microsoft.com/sharepoint/publishing/spelling/SpellCheck";break;case ap:S.opheader+="xmlns='"+G+"/taxonomy/soap/' >";ac=G+"/taxonomy/soap/";break;case ab:S.opheader+="xmlns='"+G+"/soap/directory/' >";ac=G+"/soap/directory/";break;case Y:S.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' >";ac="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/";break;case T:S.opheader+="xmlns='http://microsoft.com/sharepoint/webpartpages' >";ac="http://microsoft.com/sharepoint/webpartpages/";break;case d:S.opheader+="xmlns='"+G+"/soap/workflow/' >";ac=G+"/soap/workflow/";break;default:S.opheader+="xmlns='"+G+"/soap/'>";ac=G+"/soap/";break}ac+=av.operation;S.opfooter="";var ax="_vti_bin/"+Z[av.operation][0]+".asmx";if(av.webURL.charAt(av.webURL.length-1)===k){ax=av.webURL+ax}else{if(av.webURL.length>0){ax=av.webURL+k+ax}else{ax=V().SPServices.SPGetCurrentSite()+k+ax}}S.payload="";switch(av.operation){case"GetAlerts":break;case"DeleteAlerts":S.payload+="";for(ao=0;ao";break;case"Mode":break;case"Login":j(av,["username","password"]);break;case"CopyIntoItems":j(av,["SourceUrl"]);S.payload+="";for(ao=0;ao";j(av,["Fields","Stream","Results"]);break;case"CopyIntoItemsLocal":j(av,["SourceUrl"]);S.payload+="";for(ao=0;ao";break;case"GetItem":j(av,["Url","Fields","Stream"]);break;case"GetForm":j(av,["listName","formUrl"]);break;case"GetFormCollection":j(av,["listName"]);break;case"AddAttachment":j(av,["listName","listItemID","fileName","attachment"]);break;case"AddDiscussionBoardItem":j(av,["listName","message"]);break;case"AddList":j(av,["listName","description","templateID"]);break;case"AddListFromFeature":j(av,["listName","description","featureID","templateID"]);break;case"ApplyContentTypeToList":j(av,["webUrl","contentTypeId","listName"]);break;case"CheckInFile":j(av,["pageUrl","comment","CheckinType"]);break;case"CheckOutFile":j(av,["pageUrl","checkoutToLocal","lastmodified"]);break;case"CreateContentType":j(av,["listName","displayName","parentType","fields","contentTypeProperties","addToView"]);break;case"DeleteAttachment":j(av,["listName","listItemID","url"]);break;case"DeleteContentType":j(av,["listName","contentTypeId"]);break;case"DeleteContentTypeXmlDocument":j(av,["listName","contentTypeId","documentUri"]);break;case"DeleteList":j(av,["listName"]);break;case"GetAttachmentCollection":j(av,["listName",["listItemID","ID"]]);break;case"GetList":j(av,["listName"]);break;case"GetListAndView":j(av,["listName","viewName"]);break;case"GetListCollection":break;case"GetListContentType":j(av,["listName","contentTypeId"]);break;case"GetListContentTypes":j(av,["listName"]);break;case"GetListItems":j(av,["listName","viewName",["query","CAMLQuery"],["viewFields","CAMLViewFields"],["rowLimit","CAMLRowLimit"],["queryOptions","CAMLQueryOptions"]]);break;case"GetListItemChanges":j(av,["listName","viewFields","since","contains"]);break;case"GetListItemChangesSinceToken":j(av,["listName","viewName","query","viewFields","rowLimit","queryOptions","changeToken","contains"]);break;case"GetVersionCollection":j(av,["strlistID","strlistItemID","strFieldName"]);break;case"UndoCheckOut":j(av,["pageUrl"]);break;case"UpdateContentType":j(av,["listName","contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields","addToView"]);break;case"UpdateContentTypesXmlDocument":j(av,["listName","newDocument"]);break;case"UpdateContentTypeXmlDocument":j(av,["listName","contentTypeId","newDocument"]);break;case"UpdateList":j(av,["listName","listProperties","newFields","updateFields","deleteFields","listVersion"]);break;case"UpdateListItems":j(av,["listName"]);if(av.updates!==undefined&&av.updates.length>0){j(av,["updates"])}else{S.payload+="";for(ao=0;ao"+D(av.valuepairs[ao][1])+""}if(av.batchCmd!=="New"){S.payload+=""+av.ID+""}S.payload+=""}break;case"AddMeeting":j(av,["organizerEmail","uid","sequence","utcDateStamp","title","location","utcDateStart","utcDateEnd","nonGregorian"]);break;case"CreateWorkspace":j(av,["title","templateName","lcid","timeZoneInformation"]);break;case"RemoveMeeting":j(av,["recurrenceId","uid","sequence","utcDateStamp","cancelMeeting"]);break;case"SetWorkspaceTitle":j(av,["title"]);break;case"ResolvePrincipals":j(av,["principalKeys","principalType","addToUserInfoList"]);break;case"SearchPrincipals":j(av,["searchText","maxResults","principalType"]);break;case"AddPermission":j(av,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"AddPermissionCollection":j(av,["objectName","objectType","permissionsInfoXml"]);break;case"GetPermissionCollection":j(av,["objectName","objectType"]);break;case"RemovePermission":j(av,["objectName","objectType","permissionIdentifier","permissionType"]);break;case"RemovePermissionCollection":j(av,["objectName","objectType","memberIdsXml"]);break;case"UpdatePermission":j(av,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"GetLinks":break;case"GetPortalSearchInfo":S.opheader="<"+av.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ac="http://microsoft.com/webservices/OfficeServer/QueryService/"+av.operation;break;case"GetQuerySuggestions":S.opheader="<"+av.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ac="http://microsoft.com/webservices/OfficeServer/QueryService/"+av.operation;S.payload+=K("queryXml",a(av.queryXml));break;case"GetSearchMetadata":S.opheader="<"+av.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ac="http://microsoft.com/webservices/OfficeServer/QueryService/"+av.operation;break;case"Query":S.payload+=K("queryXml",a(av.queryXml));break;case"QueryEx":S.opheader="<"+av.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ac="http://microsoft.com/webservices/OfficeServer/QueryService/"+av.operation;S.payload+=K("queryXml",a(av.queryXml));break;case"Registration":S.payload+=K("registrationXml",a(av.registrationXml));break;case"Status":break;case"SendClientScriptErrorReport":j(av,["message","file","line","client","stack","team","originalFile"]);break;case"EnumerateFolder":j(av,["strFolderUrl"]);break;case"GetAttachments":j(av,["strListName","strItemId"]);break;case"SiteDataGetList":j(av,["strListName"]);S=aj(S,av.operation);break;case"SiteDataGetListCollection":S=aj(S,av.operation);break;case"SiteDataGetSite":S=aj(S,av.operation);break;case"SiteDataGetSiteUrl":j(av,["Url"]);S=aj(S,av.operation);break;case"SiteDataGetWeb":S=aj(S,av.operation);break;case"CreateWeb":j(av,["urlType","titleType","descriptionType","templateNameType","languageType","languageSpecifiedType","localeType","localeSpecifiedType","collationLocaleType","collationLocaleSpecifiedType","uniquePermissionsType","uniquePermissionsSpecifiedType","anonymousType","anonymousSpecifiedType","presenceType","presenceSpecifiedType"]);break;case"DeleteWeb":j(av,["url"]);break;case"GetSite":j(av,["SiteUrl"]);break;case"GetSiteTemplates":j(av,["LCID","TemplateList"]);break;case"AddComment":j(av,["url","comment","isHighPriority","title"]);break;case"AddTag":j(av,["url","termID","title","isPrivate"]);break;case"AddTagByKeyword":j(av,["url","keyword","title","isPrivate"]);break;case"CountCommentsOfUser":j(av,["userAccountName"]);break;case"CountCommentsOfUserOnUrl":j(av,["userAccountName","url"]);break;case"CountCommentsOnUrl":j(av,["url"]);break;case"CountRatingsOnUrl":j(av,["url"]);break;case"CountTagsOfUser":j(av,["userAccountName"]);break;case"DeleteComment":j(av,["url","lastModifiedTime"]);break;case"DeleteRating":j(av,["url"]);break;case"DeleteTag":j(av,["url","termID"]);break;case"DeleteTagByKeyword":j(av,["url","keyword"]);break;case"DeleteTags":j(av,["url"]);break;case"GetAllTagTerms":j(av,["maximumItemsToReturn"]);break;case"GetAllTagTermsForUrlFolder":j(av,["urlFolder","maximumItemsToReturn"]);break;case"GetAllTagUrls":j(av,["termID"]);break;case"GetAllTagUrlsByKeyword":j(av,["keyword"]);break;case"GetCommentsOfUser":j(av,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetCommentsOfUserOnUrl":j(av,["userAccountName","url"]);break;case"GetCommentsOnUrl":j(av,["url","maximumItemsToReturn","startIndex"]);if(av.excludeItemsTime!==undefined&&av.excludeItemsTime.length>0){S.payload+=K("excludeItemsTime",av.excludeItemsTime)}break;case"GetRatingAverageOnUrl":j(av,["url"]);break;case"GetRatingOfUserOnUrl":j(av,["userAccountName","url"]);break;case"GetRatingOnUrl":j(av,["url"]);break;case"GetRatingsOfUser":j(av,["userAccountName"]);break;case"GetRatingsOnUrl":j(av,["url"]);break;case"GetSocialDataForFullReplication":j(av,["userAccountName"]);break;case"GetTags":j(av,["url"]);break;case"GetTagsOfUser":j(av,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetTagTerms":j(av,["maximumItemsToReturn"]);break;case"GetTagTermsOfUser":j(av,["userAccountName","maximumItemsToReturn"]);break;case"GetTagTermsOnUrl":j(av,["url","maximumItemsToReturn"]);break;case"GetTagUrls":j(av,["termID"]);break;case"GetTagUrlsByKeyword":j(av,["keyword"]);break;case"GetTagUrlsOfUser":j(av,["termID","userAccountName"]);break;case"GetTagUrlsOfUserByKeyword":j(av,["keyword","userAccountName"]);break;case"SetRating":j(av,["url","rating","title","analysisDataEntry"]);break;case"UpdateComment":j(av,["url","lastModifiedTime","comment","isHighPriority"]);break;case"SpellCheck":j(av,["chunksToSpell","declaredLanguage","useLad"]);break;case"AddTerms":j(av,["sharedServiceId","termSetId","lcid","newTerms"]);break;case"GetChildTermsInTerm":j(av,["sspId","lcid","termId","termSetId"]);break;case"GetChildTermsInTermSet":j(av,["sspId","lcid","termSetId"]);break;case"GetKeywordTermsByGuids":j(av,["termIds","lcid"]);break;case"GetTermsByLabel":j(av,["label","lcid","matchOption","resultCollectionSize","termIds","addIfNotFound"]);break;case"GetTermSets":j(av,["sharedServiceId","termSetId","lcid","clientTimeStamps","clientVersions"]);break;case"AddGroup":j(av,["groupName","ownerIdentifier","ownerType","defaultUserLoginName","description"]);break;case"AddGroupToRole":j(av,["groupName","roleName"]);break;case"AddRole":j(av,["roleName","description","permissionMask"]);break;case"AddRoleDef":j(av,["roleName","description","permissionMask"]);break;case"AddUserCollectionToGroup":j(av,["groupName","usersInfoXml"]);break;case"AddUserCollectionToRole":j(av,["roleName","usersInfoXml"]);break;case"AddUserToGroup":j(av,["groupName","userName","userLoginName","userEmail","userNotes"]);break;case"AddUserToRole":j(av,["roleName","userName","userLoginName","userEmail","userNotes"]);break;case"GetAllUserCollectionFromWeb":break;case"GetGroupCollection":j(av,["groupNamesXml"]);break;case"GetGroupCollectionFromRole":j(av,["roleName"]);break;case"GetGroupCollectionFromSite":break;case"GetGroupCollectionFromUser":j(av,["userLoginName"]);break;case"GetGroupCollectionFromWeb":break;case"GetGroupInfo":j(av,["groupName"]);break;case"GetRoleCollection":j(av,["roleNamesXml"]);break;case"GetRoleCollectionFromGroup":j(av,["groupName"]);break;case"GetRoleCollectionFromUser":j(av,["userLoginName"]);break;case"GetRoleCollectionFromWeb":break;case"GetRoleInfo":j(av,["roleName"]);break;case"GetRolesAndPermissionsForCurrentUser":break;case"GetRolesAndPermissionsForSite":break;case"GetUserCollection":j(av,["userLoginNamesXml"]);break;case"GetUserCollectionFromGroup":j(av,["groupName"]);break;case"GetUserCollectionFromRole":j(av,["roleName"]);break;case"GetUserCollectionFromSite":break;case"GetUserCollectionFromWeb":break;case"GetUserInfo":j(av,["userLoginName"]);break;case"GetUserLoginFromEmail":j(av,["emailXml"]);break;case"RemoveGroup":j(av,["groupName"]);break;case"RemoveGroupFromRole":j(av,["roleName","groupName"]);break;case"RemoveRole":j(av,["roleName"]);break;case"RemoveUserCollectionFromGroup":j(av,["groupName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromRole":j(av,["roleName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromSite":j(av,["userLoginNamesXml"]);break;case"RemoveUserFromGroup":j(av,["groupName","userLoginName"]);break;case"RemoveUserFromRole":j(av,["roleName","userLoginName"]);break;case"RemoveUserFromSite":j(av,["userLoginName"]);break;case"RemoveUserFromWeb":j(av,["userLoginName"]);break;case"UpdateGroupInfo":j(av,["oldGroupName","groupName","ownerIdentifier","ownerType","description"]);break;case"UpdateRoleDefInfo":j(av,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateRoleInfo":j(av,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateUserInfo":j(av,["userLoginName","userName","userEmail","userNotes"]);break;case"AddColleague":j(av,["accountName","colleagueAccountName","group","privacy","isInWorkGroup"]);break;case"AddLink":j(av,["accountName","name","url","group","privacy"]);break;case"AddMembership":j(av,["accountName","membershipInfo","group","privacy"]);break;case"AddPinnedLink":j(av,["accountName","name","url"]);break;case"CreateMemberGroup":j(av,["membershipInfo"]);break;case"CreateUserProfileByAccountName":j(av,["accountName"]);break;case"GetCommonColleagues":j(av,["accountName"]);break;case"GetCommonManager":j(av,["accountName"]);break;case"GetCommonMemberships":j(av,["accountName"]);break;case"GetInCommon":j(av,["accountName"]);break;case"GetPropertyChoiceList":j(av,["propertyName"]);break;case"GetUserColleagues":j(av,["accountName"]);break;case"GetUserLinks":j(av,["accountName"]);break;case"GetUserMemberships":j(av,["accountName"]);break;case"GetUserPinnedLinks":j(av,["accountName"]);break;case"GetUserProfileByGuid":j(av,["guid"]);break;case"GetUserProfileByIndex":j(av,["index"]);break;case"GetUserProfileByName":if(av.accountName!==undefined&&av.accountName.length>0){j(av,[["AccountName","accountName"]])}else{j(av,["AccountName"])}break;case"GetUserProfileCount":break;case"GetUserProfileSchema":break;case"ModifyUserPropertyByAccountName":j(av,["accountName","newData"]);break;case"RemoveAllColleagues":j(av,["accountName"]);break;case"RemoveAllLinks":j(av,["accountName"]);break;case"RemoveAllMemberships":j(av,["accountName"]);break;case"RemoveAllPinnedLinks":j(av,["accountName"]);break;case"RemoveColleague":j(av,["accountName","colleagueAccountName"]);break;case"RemoveLink":j(av,["accountName","id"]);break;case"RemoveMembership":j(av,["accountName","sourceInternal","sourceReference"]);break;case"RemovePinnedLink":j(av,["accountName","id"]);break;case"UpdateColleaguePrivacy":j(av,["accountName","colleagueAccountName","newPrivacy"]);break;case"UpdateLink":j(av,["accountName","data"]);break;case"UpdateMembershipPrivacy":j(av,["accountName","sourceInternal","sourceReference","newPrivacy"]);break;case"UpdatePinnedLink ":j(av,["accountName","data"]);break;case"DeleteAllVersions":j(av,["fileName"]);break;case"DeleteVersion":j(av,["fileName","fileVersion"]);break;case"GetVersions":j(av,["fileName"]);break;case"RestoreVersion":j(av,["fileName","fileVersion"]);break;case"AddView":j(av,["listName","viewName","viewFields","query","rowLimit","rowLimit","type","makeViewDefault"]);break;case"DeleteView":j(av,["listName","viewName"]);break;case"GetView":j(av,["listName","viewName"]);break;case"GetViewCollection":j(av,["listName"]);break;case"GetViewHtml":j(av,["listName","viewName"]);break;case"UpdateView":j(av,["listName","viewName","viewProperties","query","viewFields","aggregations","formats","rowLimit"]);break;case"UpdateViewHtml":j(av,["listName","viewName","viewProperties","toolbar","viewHeader","viewBody","viewFooter","viewEmpty","rowLimitExceeded","query","viewFields","aggregations","formats","rowLimit"]);break;case"AddWebPart":j(av,["pageUrl","webPartXml","storage"]);break;case"AddWebPartToZone":j(av,["pageUrl","webPartXml","storage","zoneId","zoneIndex"]);break;case"GetWebPart2":j(av,["pageUrl","storageKey","storage","behavior"]);break;case"GetWebPartPage":j(av,["documentName","behavior"]);break;case"GetWebPartProperties":j(av,["pageUrl","storage"]);break;case"GetWebPartProperties2":j(av,["pageUrl","storage","behavior"]);break;case"Webs.CreateContentType":j(av,["displayName","parentType","newFields","contentTypeProperties"]);break;case"GetColumns":j(av,["webUrl"]);break;case"GetContentType":j(av,["contentTypeId"]);break;case"GetContentTypes":break;case"GetCustomizedPageStatus":j(av,["fileUrl"]);break;case"GetListTemplates":break;case"GetObjectIdFromUrl":j(av,["objectUrl"]);break;case"GetWeb":j(av,[["webUrl","webURL"]]);break;case"GetWebCollection":break;case"GetAllSubWebCollection":break;case"UpdateColumns":j(av,["newFields","updateFields","deleteFields"]);break;case"Webs.UpdateContentType":j(av,["contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields"]);break;case"WebUrlFromPageUrl":j(av,[["pageUrl","pageURL"]]);break;case"AlterToDo":j(av,["item","todoId","todoListId","taskData"]);break;case"GetTemplatesForItem":j(av,["item"]);break;case"GetToDosForItem":j(av,["item"]);break;case"GetWorkflowDataForItem":j(av,["item"]);break;case"GetWorkflowTaskData":j(av,["item","listId","taskId"]);break;case"StartWorkflow":j(av,["item","templateId","workflowParameters"]);break;default:break}var ay=S.header+S.opheader+S.payload+S.opfooter+S.footer;var aw;var i=null;if(av.cacheXML){aw=V("body").data(ay)}if(aw===undefined){V.ajax({url:ax,async:av.async,beforeSend:function(az){if(Z[av.operation][1]){az.setRequestHeader("SOAPAction",ac)}},type:"POST",data:ay,dataType:"xml",contentType:"text/xml;charset='utf-8'",complete:function(aA,az){if(av.cacheXML){V("body").data(ay,aA)}aw=aA;i=az;av.completefunc(aw,i)}})}else{av.completefunc(aw,i)}};V.fn.SPServices.defaults={cacheXML:false,operation:"",webURL:"",makeViewDefault:false,CAMLViewName:"",CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:"",batchCmd:"Update",valuepairs:[],DestinationUrls:[],behavior:"Version3",storage:"Shared",objectType:"List",cancelMeeting:true,nonGregorian:false,fClaim:false,recurrenceId:0,sequence:0,maximumItemsToReturn:0,startIndex:0,isHighPriority:false,isPrivate:false,rating:1,maxResults:10,principalType:"User",async:true,completefunc:null};V.fn.SPServices.SPGetCurrentSite=function(){if(f.length>0){return f}var i=S.header+""+((location.href.indexOf("?")>0)?location.href.substr(0,location.href.indexOf("?")):location.href)+""+S.footer;V.ajax({async:false,url:"/_vti_bin/Webs.asmx",type:"POST",data:i,dataType:"xml",contentType:'text/xml;charset="utf-8"',complete:function(av,t){f=V(av.responseXML).find("WebUrlFromPageUrlResult").text()}});return f};V.fn.SPServices.SPCascadeDropdowns=function(av){var ay=V.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListParentColumn:"",relationshipListChildColumn:"",relationshipListSortColumn:"",parentColumn:"",childColumn:"",listName:V().SPServices.SPListNameFromUrl(),CAMLQuery:"",promptText:"",noneText:"(None)",simpleChild:false,selectSingleOption:false,matchOnId:false,completefunc:null,debug:false},av);var ax=false;var aA="SPServices.SPCascadeDropdowns";var aw=new ai(ay.parentColumn);if(aw.Obj.html()===null&&ay.debug){R(aA,"parentColumn: "+ay.parentColumn,ae);return}var i=new ai(ay.childColumn);if(i.Obj.html()===null&&ay.debug){R(aA,"childColumn: "+ay.childColumn,ae);return}if(ay.simpleChild===true&&i.Type==="C"){V().SPServices.SPComplexToSimpleDropdown({columnName:ay.childColumn});i=new ai(ay.childColumn)}V().SPServices({operation:"GetList",async:false,cacheXML:true,listName:ay.listName,completefunc:function(aC,aB){V(aC.responseXML).find("Fields").each(function(){V(this).find("Field[DisplayName='"+ay.childColumn+"']").each(function(){childColumnRequired=(V(this).attr("Required")==="TRUE")?true:false;childColumnStatic=V(this).attr("StaticName");return false})})}});var az={opt:ay,childSelect:i,childColumnStatic:childColumnStatic,childColumnRequired:childColumnRequired};var t=aw.Obj.data("SPCascadeDropdownsChildColumns");if(t===undefined){aw.Obj.data("SPCascadeDropdownsChildColumns",[az])}else{t.push(az);aw.Obj.data("SPCascadeDropdownsChildColumns",t);ax=true}if(!ax){switch(aw.Type){case"S":aw.Obj.bind("change",function(){am(ay.parentColumn,aw)});break;case"C":V("input[id='"+aw.Obj.attr("optHid")+"']").bind("propertychange",function(){am(ay.parentColumn,aw)});break;case"M":aw.Obj.bind("dblclick",function(){am(ay.parentColumn,aw)});parentSelections=aw.Obj.closest("span").find("select[id$='SelectResult']");parentSelections.bind("dblclick",function(){am(ay.parentColumn,aw)});aw.Obj.closest("span").find("button").each(function(){V(this).bind("click",function(){am(ay.parentColumn,aw)})});break;default:break}}am(ay.parentColumn,aw)};function am(aD,ax){var aE="";var aw;var az=null;var i;var aA;var aC;var ay;var aB;var av;var t=ax.Obj.data("SPCascadeDropdownsChildColumns");V(t).each(function(){var aJ=this.opt;var aH=this.childSelect;var aM=this.childColumnStatic;var aI=this.childColumnRequired;aw=W(ax,aJ.matchOnId);var aG=aw.join(";#");if(ax.Obj.data("SPCascadeDropdown_Selected_"+aM)===aG){return}ax.Obj.data("SPCascadeDropdown_Selected_"+aM,aG);az=W(aH,true);if(aH.Type==="M"){aA=aH.Obj.closest("span").find("input[name$='MultiLookupPicker$data']");i=window[aH.Obj.closest("tr").find("button[id$='AddButton']").attr("id").replace(/AddButton/,"MultiLookupPicker_m")];currentSelection=aH.Obj.closest("span").find("select[ID$='SelectResult']")}var aL=(aJ.relationshipListSortColumn.length>0)?aJ.relationshipListSortColumn:aJ.relationshipListChildColumn;var aF="";if(aJ.CAMLQuery.length>0){aF+=""}if(aw.length===0){aF+=""}else{if(aw.length===1){aF+="":"'/>")+D(aw[0])+""}else{var aK=(aw.length>2)?true:false;for(ao=0;ao<(aw.length-1);ao++){aF+=""}for(ao=0;ao":"'/>")+D(aw[ao])+"";if(ao>0&&(ao<(aw.length-1))&&aK){aF+=""}}aF+=""}}if(aJ.CAMLQuery.length>0){aF+=aJ.CAMLQuery+""}aF+="";aF+="";V().SPServices({operation:"GetListItems",async:false,webURL:aJ.relationshipWebURL,listName:aJ.relationshipList,CAMLQuery:aF,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:"FALSE",completefunc:function(aO,aN){V(aO.responseXML).find("errorstring").each(function(){var aQ="SPServices.SPCascadeDropdowns";var aP=V(this).text();if(aJ.debug&&aP==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){R(aQ,"relationshipListParentColumn: "+aJ.relationshipListParentColumn+" or relationshipListChildColumn: "+aJ.relationshipListChildColumn,"Not found in relationshipList "+aJ.relationshipList)}else{if(aJ.debug&&aP==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){R(aQ,"relationshipList: "+aJ.relationshipList,"List not found")}}return});switch(aH.Type){case"S":V(aH.Obj).find("option").remove();if(!aI&&(aJ.promptText.length>0)){aH.Obj.append("")}else{if(!aI){aH.Obj.append("")}}break;case"C":aE=aI?"":aJ.noneText+"|0";aH.Obj.attr("value","");break;case"M":V(aH.Obj).find("option").remove();aC="";break;default:break}ay=parseFloat(V(aO.responseXML).SPFilterNode("rs:data").attr("ItemCount"));V(aO.responseXML).SPFilterNode("z:row").each(function(){var aR,aQ;var aP=V(this).attr("ows_"+aJ.relationshipListChildColumn);if(aP!==undefined&&aP.indexOf(";#")>0){var aT=aP.split(";#");aR=aT[0];aQ=aT[1]}else{aR=V(this).attr("ows_ID");aQ=aP}if(isNaN(aR)){aR=V(this).attr("ows_ID")}aB=aR;av=aQ;switch(aH.Type){case"S":var aS=(V(this).attr("ows_ID")===az[0])?" selected='selected'":"";aH.Obj.append(""+aQ+"");break;case"C":if(aR===az[0]){aH.Obj.attr("value",aQ)}aE=aE+((aE.length>0)?"|":"")+aQ+"|"+aR;break;case"M":aH.Obj.append("");aC+=aR+"|t"+aQ+"|t |t |t";break;default:break}});switch(aH.Type){case"S":aH.Obj.trigger("change");if(ay===1&&aJ.selectSingleOption===true){V(aH.Obj).find("option[value!='0']:first").attr("selected","selected")}break;case"C":aH.Obj.attr("choices",aE);if(ay===1&&aJ.selectSingleOption===true){V(aH.Obj).attr("value",av);V("input[id='"+aH.Obj.attr("optHid")+"']").val(aB)}if(aH.Obj.val()===""){V("input[id='"+aH.Obj.attr("optHid")+"']").val("")}break;case"M":i.data="";aA.attr("value",aC);V(currentSelection).find("option").each(function(){var aQ=V(this);var aP=V(this).html();V(this).attr("selected","selected");V(aH.Obj).find("option").filter(function(){return V(this).text()==aP.replace(/&/,"&")}).each(function(){if(V(this).html()===aP){aQ.removeAttr("selected")}})});GipRemoveSelectedItems(i);V(aH.Obj).find("option").each(function(){var aP=V(this);V(currentSelection).find("option").each(function(){if(V(this).html()===aP.html()){aP.remove()}})});GipAddSelectedItems(i);i.data=GipGetGroupData(aC);aH.Obj.trigger("dblclick");break;default:break}}});if(aJ.completefunc!==null){aJ.completefunc()}})}V.fn.SPServices.SPComplexToSimpleDropdown=function(aC){var i=V.extend({},{columnName:"",completefunc:null,debug:false},aC);var av=new ai(i.columnName);if(av.Obj.html()===null&&i.debug){R("SPServices.SPComplexToSimpleDropdown","columnName: "+i.columnName,ae);return}if(av.Type!=="C"){return}var aA=V(av.Obj).attr("choices").split("|");var aw=V(av.Obj).attr("optHid");var aB=V("input[id='"+aw+"']");var t=V("input[id='"+aw+"']").val();var ax=n("SPComplexToSimpleDropdown",i.columnName);var az="";V(av.Obj).closest("td").prepend(az);V(av.Obj).closest("span").find("img").remove();V(av.Obj).closest("span").find("input").hide();V("#"+ax).change(function(){var aD=V(this).val();aB.val(aD);V(av.Obj).val(V(this).find("option[value='"+(aD!=="0"?aD:"")+"']").html())});V("#"+ax).trigger("change");if(i.completefunc!==null){i.completefunc()}};V.fn.SPServices.SPDisplayRelatedInfo=function(t){var aw=V.extend({},{columnName:"",relatedWebURL:"",relatedList:"",relatedListColumn:"",relatedColumns:[],displayFormat:"table",headerCSSClass:"ms-vh2",rowCSSClass:"ms-vb",CAMLQuery:"",numChars:0,matchType:"Eq",matchOnId:false,completefunc:null,debug:false},t);var i;var av=[];var az;var ay="SPServices.SPDisplayRelatedInfo";var ax=new ai(aw.columnName);if(ax.Obj.html()===null&&aw.debug){R(ay,"columnName: "+aw.columnName,ae);return}i=n("SPDisplayRelatedInfo",aw.columnName);V().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:aw.relatedWebURL,listName:aw.relatedList,completefunc:function(aB,aA){V(aB.responseXML).find("faultcode").each(function(){if(aw.debug){R(ay,"relatedList: "+aw.relatedList,"List not found");return}});az=V(aB.responseXML).find("List");for(ao=0;ao Field[Name='"+aw.relatedColumns[ao]+"']")}}});switch(ax.Type){case"S":ax.Obj.bind("change",function(){P(aw,i,az,av)});break;case"C":V("input[id='"+ax.Obj.attr("optHid")+"']").bind("propertychange",function(){P(aw,i,az,av)});break;case"M":if(aw.debug){R(ay,"columnName: "+aw.columnName,"Multi-select columns not supported by this function")}break;default:break}P(aw,i,az,av)};function P(t,ay,aA,av){var aB=null;var ax="SPServices.SPDisplayRelatedInfo";var aw=new ai(t.columnName);aB=W(aw,t.matchOnId);if(aw.Type==="C"&&t.numChars>0&&aB[0].length");var i="";if(t.CAMLQuery.length>0){i+=""}i+="":"'/>")+D(aB[0])+"";if(t.CAMLQuery.length>0){i+=t.CAMLQuery+""}i+="";var az=" ";for(ao=0;ao"}V().SPServices({operation:"GetListItems",async:false,webURL:t.relatedWebURL,listName:t.relatedList,CAMLQuery:i,CAMLViewFields:""+az+"",CAMLRowLimit:0,completefunc:function(aE,aD){V(aE.responseXML).find("errorstring").each(function(){var aF=V(this).text();if(t.debug&&aF==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){R(ax,"relatedListColumn: "+t.relatedListColumn,"Column not found in relatedList "+t.relatedList)}else{if(t.debug&&aF==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){R(ax,"relatedList: "+t.relatedList,"List not found")}}return});var aC;switch(t.displayFormat){case"table":aC="";aC+="";for(ao=0;ao"+av[ao].attr("DisplayName")+""}aC+="";V(aE.responseXML).SPFilterNode("z:row").each(function(){aC+="";for(ao=0;ao"+F(aA,av[ao],V(this).attr("ows_"+t.relatedColumns[ao]),t)+""}aC+=""});aC+="
";break;case"list":aC="";V(aE.responseXML).SPFilterNode("z:row").each(function(){for(ao=0;ao"+av[ao].attr("DisplayName")+"";aC+="";aC+=""}});aC+="
"+F(aA,av[ao],V(this).attr("ows_"+t.relatedColumns[ao]),t)+"
";break;default:break}V("#"+ay).html(aC)}});if(t.completefunc!==null){t.completefunc()}}V.fn.SPServices.SPFilterDropdown=function(aE){var av=V.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListColumn:"",relationshipListSortColumn:"",columnName:"",listName:V().SPServices.SPListNameFromUrl(),promptText:"",noneText:"(None)",CAMLQuery:"",CAMLQueryOptions:"FALSE",completefunc:null,debug:false},aE);var aD="";var aC=null;var t;var ax;var aB;var aA;var az="SPServices.SPFilterDropdown";var ay=new ai(av.columnName);if(ay.Obj.html()===null&&av.debug){R(az,"columnName: "+av.columnName,ae);return}aC=W(ay,true);var aw=(av.relationshipListSortColumn.length>0)?av.relationshipListSortColumn:av.relationshipListColumn;var i="";if(av.CAMLQuery.length>0){i+=av.CAMLQuery}i+="";V().SPServices({operation:"GetList",async:false,cacheXML:true,listName:av.listName,completefunc:function(aG,aF){V(aG.responseXML).find("Fields").each(function(){V(this).find("Field[DisplayName='"+av.columnName+"']").each(function(){aA=(V(this).attr("Required")==="TRUE")?true:false;return false})})}});V().SPServices({operation:"GetListItems",async:false,webURL:av.relationshipWebURL,listName:av.relationshipList,CAMLQuery:i,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:av.CAMLQueryOptions,completefunc:function(aG,aF){V(aG.responseXML).find("errorstring").each(function(){var aH=V(this).text();if(av.debug&&aH==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){R(az,"relationshipListColumn: "+av.relationshipListColumn,"Not found in relationshipList "+av.relationshipList)}else{if(av.debug&&aH==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){R(az,"relationshipList: "+av.relationshipList,"List not found")}}return});switch(ay.Type){case"S":V(ay.Obj).find("option").remove();if(!aA&&(av.promptText.length>0)){ay.Obj.append("")}else{if(!aA){ay.Obj.append("")}}break;case"C":aD=aA?"":av.noneText+"|0";ay.Obj.attr("value","");break;case"M":V(ay.Obj).find("option").remove();aB="";break;default:break}V(aG.responseXML).SPFilterNode("z:row").each(function(){var aJ,aI;var aH=V(this).attr("ows_"+av.relationshipListColumn);if(aH!==undefined&&aH.indexOf(";#")>0){var aL=aH.split(";#");aJ=aL[0];aI=aL[1]}else{aJ=V(this).attr("ows_ID");aI=aH}if(isNaN(aJ)){aJ=V(this).attr("ows_ID")}switch(ay.Type){case"S":var aK=(V(this).attr("ows_ID")===aC[0])?" selected='selected'":"";ay.Obj.append(""+aI+"");break;case"C":if(aJ===aC[0]){ay.Obj.attr("value",aI)}aD=aD+((aD.length>0)?"|":"")+aI+"|"+aJ;break;case"M":ay.Obj.append("");aB+=aJ+"|t"+aI+"|t |t |t";break;default:break}});switch(ay.Type){case"S":ay.Obj.trigger("change");break;case"C":ay.Obj.attr("choices",aD);ay.Obj.trigger("propertychange");break;case"M":ax=ay.Obj.closest("span").find("input[name$='MultiLookupPicker$data']");t=window[ay.Obj.closest("tr").find("button[id$='AddButton']").attr("id").replace(/AddButton/,"MultiLookupPicker_m")];currentSelection=ay.Obj.closest("span").find("select[ID$='SelectResult']");t.data="";ax.attr("value",aB);V(currentSelection).find("option").each(function(){var aH=V(this);V(this).attr("selected","selected");V(ay.Obj).find("option").each(function(){if(V(this).html()===aH.html()){aH.removeAttr("selected")}})});GipRemoveSelectedItems(t);V(ay.Obj).find("option").each(function(){var aH=V(this);V(currentSelection).find("option").each(function(){if(V(this).html()===aH.html()){aH.remove()}})});GipAddSelectedItems(t);t.data=GipGetGroupData(aB);ay.Obj.trigger("dblclick");break;default:break}}});if(av.completefunc!==null){av.completefunc()}};V.fn.SPServices.SPDebugXMLHttpResult=function(av){var ax=V.extend({},{node:null,indent:0},av);var aw;var az=3;var ay=4;var t="";t+="";if(ax.node.nodeName==="DisplayPattern"){t+=""}else{if(!ax.node.hasChildNodes()){t+="";if(ax.node.attributes){t+=""}}else{if(ax.node.hasChildNodes()&&ax.node.firstChild.nodeType===ay){t+=""}else{if(ax.node.hasChildNodes()&&ax.node.firstChild.nodeType===az){t+=""}else{t+="";if(ax.node.attributes){t+=""}t+=""}}}}t+="
"+ax.node.nodeName+"
"+ax.node.nodeName+""+((ax.node.nodeValue!==null)?C(ax.node.nodeValue):" ")+"
"+ak(ax.node,ax)+"
"+ax.node.nodeName+"
"+ax.node.nodeName+""+C(ax.node.firstChild.nodeValue)+"
"+ax.node.nodeName+"
"+ak(ax.node,ax)+"
";for(aw=0;aw
";return t};V.fn.SPServices.SPGetCurrentUser=function(aw){var ay=V.extend({},{fieldName:"Name",fieldNames:{},debug:false},aw);if(ay.fieldName==="ID"&&_spUserId!=undefined){return _spUserId}var t="";var ax={};var az=ay.fieldNames.length>0?ay.fieldNames.length:1;var av;V.ajax({async:false,url:V().SPServices.SPGetCurrentSite()+"/_layouts/userdisp.aspx?Force=True&"+new Date().getTime(),complete:function(aB,aA){av=aB}});for(ao=0;ao1){i=RegExp('FieldInternalName="'+ay.fieldNames[ao]+'"',"gi")}else{i=RegExp('FieldInternalName="'+ay.fieldName+'"',"gi")}V(av.responseText).find("table.ms-formtable td[id^='SPField']").each(function(){if(i.test(V(this).html())){switch(V(this).attr("id")){case"SPFieldText":t=V(this).text();break;case"SPFieldNote":t=V(this).find("div").html();break;case"SPFieldURL":t=V(this).find("img").attr("src");break;default:t=V(this).text();break}return false}})}if(ay.fieldNames[ao]!=="ID"){t=(t!==undefined)?t.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g,""):null}if(az>1){ax[ay.fieldNames[ao]]=t}}return(az>1)?ax:t};V.fn.SPServices.SPLookupAddNew=function(aw){var ax=V.extend({},{lookupColumn:"",promptText:"Add new {0}",newWindow:false,ContentTypeID:"",completefunc:null,debug:false},aw);var aA="SPServices.SPLookupAddNew";var av=new ai(ax.lookupColumn);if(av.Obj.html()===null&&ax.debug){R(aA,"lookupColumn: "+ax.lookupColumn,ae);return}var az="";var t="";var ay="";V().SPServices({operation:"GetList",async:false,cacheXML:true,listName:V().SPServices.SPListNameFromUrl(),completefunc:function(aC,aB){V(aC.responseXML).find("Field[DisplayName='"+ax.lookupColumn+"']").each(function(){ay=V(this).attr("StaticName");V().SPServices({operation:"GetList",async:false,cacheXML:true,listName:V(this).attr("List"),completefunc:function(aE,aD){V(aE.responseXML).find("List").each(function(){t=V(this).attr("WebFullUrl");t=t!==k?t+k:t})}});az=v(V(this).attr("List"),"NewForm");return false})}});if(t.length===0&&ax.debug){R(aA,"lookupColumn: "+ax.lookupColumn,"This column does not appear to be a lookup column");return}if(az.length>0){var i=t+az;i+=ax.newWindow?((ax.ContentTypeID.length>0)?"?ContentTypeID="+ax.ContentTypeID:"")+"' target='_blank'":"?"+((ax.ContentTypeID.length>0)?"ContentTypeID="+ax.ContentTypeID+"&":"")+"Source="+ar(location.href)+"'";newLink="
"+av+"";if(aw.CAMLQuery.length>0){i+=aw.CAMLQuery+""}i+="";V().SPServices({operation:"GetListItems",async:false,webURL:aw.webURL,listName:aw.listName,CAMLQuery:i,CAMLViewFields:"",CAMLRowLimit:1,CAMLQueryOptions:"",completefunc:function(az,ay){V(az.responseXML).SPFilterNode("z:row").each(function(){ax=V(this).attr("ows_ID")})}});return ax};V.fn.SPServices.SPRequireUnique=function(aB){var i=V.extend({},{columnStaticName:"Title",duplicateAction:0,ignoreCase:false,initMsg:"This value must be unique.",initMsgCSSClass:"ms-vb",errMsg:"This value is not unique.",errMsgCSSClass:"ms-formvalidation",showDupes:false,completefunc:null},aB);var av=V().SPServices.SPGetQueryString();var az=av.ID;var ay=V().SPServices.SPListNameFromUrl();var t="{1}
";var ax=t.replace(/\{0\}/g,i.initMsgCSSClass).replace(/\{1\}/g,i.initMsg);var aw=V().SPServices.SPGetDisplayFromStatic({listName:ay,columnStaticName:i.columnStaticName});var aA=V("input[Title='"+aw+"']");V(aA).parent().append(ax);V(aA).blur(function(){var aE=[];var aF=V(this).attr("value");if(aF.length===0){return false}V().SPServices({operation:"GetListItems",async:false,listName:ay,CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(aI,aG){var aH=i.ignoreCase?aF.toUpperCase():aF;V(aI.responseXML).SPFilterNode("z:row").each(function(){var aJ=i.ignoreCase?V(this).attr("ows_"+i.columnStaticName).toUpperCase():V(this).attr("ows_"+i.columnStaticName);if((aH===aJ)&&(V(this).attr("ows_ID")!==az)){aE.push([V(this).attr("ows_ID"),V(this).attr("ows_"+i.columnStaticName)])}})}});var aD=i.initMsg;V("span#SPRequireUnique"+i.columnStaticName).html(aD).attr("class",i.initMsgCSSClass);V("input[value='OK']:disabled, input[value='Save']:disabled").removeAttr("disabled");if(aE.length>0){aD=i.errMsg;V("span#SPRequireUnique"+i.columnStaticName).html(aD).attr("class",i.errMsgCSSClass);if(i.duplicateAction===1){V("input[Title='"+i.columnDisplayName+"']").focus();V("input[value='OK'], input[value='Save']").attr("disabled","disabled")}if(i.showDupes){var aC=" "+aE.length+" duplicate item"+(aE.length>1?"s":"")+": ";for(ao=0;ao"+aE[ao][1]+"
"}V("span#SPRequireUnique"+i.columnStaticName).append(aC)}}});if(i.completefunc!==null){i.completefunc()}};V.fn.SPServices.SPGetDisplayFromStatic=function(t){var av=V.extend({},{webURL:"",listName:"",columnStaticName:"",columnStaticNames:{}},t);var i="";var aw={};var ax=av.columnStaticNames.length>0?av.columnStaticNames.length:1;V().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:av.webURL,listName:av.listName,completefunc:function(az,ay){if(ax>1){for(ao=0;ao1)?aw:i};V.fn.SPServices.SPGetStaticFromDisplay=function(i){var av=V.extend({},{webURL:"",listName:"",columnDisplayName:"",columnDisplayNames:{}},i);var t="";var aw={};var ax=av.columnDisplayNames.length>0?av.columnDisplayNames.length:1;V().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:av.webURL,listName:av.listName,completefunc:function(az,ay){if(ax>1){for(ao=0;ao1)?aw:t};V.fn.SPServices.SPRedirectWithID=function(aB){var i=V.extend({},{redirectUrl:"",qsParamName:"ID"},aB);var az=V().SPServices.SPListNameFromUrl();var t=V().SPServices.SPGetQueryString();var aw=t.ID;var ax=t.List;var aA=t.RootFolder;var ay=t.ContentTypeId;if(typeof t.ID==="undefined"){aw=V().SPServices.SPGetLastItemId({listName:az});V("form[name='aspnetForm']").each(function(){var aD=(location.href.indexOf("?")>0)?location.href.substring(0,location.href.indexOf("?")):location.href;var aE=(typeof t.Source==="string")?"Source="+t.Source.replace(/\//g,"%2f").replace(/:/g,"%3a"):"";var aC=[];if(typeof ax!=="undefined"){aC.push("List="+ax)}if(typeof aA!=="undefined"){aC.push("RootFolder="+aA)}if(typeof ay!=="undefined"){aC.push("ContentTypeId="+ay)}var aF=aD+((aC.length>0)?("?"+aC.join("&")+"&"):"?")+"Source="+aD+"?ID="+aw+((aE.length>0)?("%26RealSource="+t.Source):"")+((typeof t.RedirectURL==="string")?("%26RedirectURL="+t.RedirectURL):"");V(this).attr("action",aF)})}else{while(t.ID===aw){aw=V().SPServices.SPGetLastItemId({listName:az})}var av=(typeof t.RedirectURL==="string")?t.RedirectURL:i.redirectUrl;location.href=av+"?"+i.qsParamName+"="+aw+((typeof t.RealSource==="string")?("&Source="+t.RealSource):"")}};V.fn.SPServices.SPSetMultiSelectSizes=function(aD){var i=V.extend({},{multiSelectColumn:"",minWidth:0,maxWidth:0,debug:false},aD);var az="SPServices.SPSetMultiSelectSizes";var ax=new ai(i.multiSelectColumn);if(ax.Obj.html()===null&&i.debug){R(az,"multiSelectColumn: "+i.multiSelectColumn,ae);return}if(ax.Type!=="M"&&i.debug){R(az,"multiSelectColumn: "+i.multiSelectColumn,"Column is not multi-select.");return}var ay=ax.Obj;var aB=ay.closest("span").find("select[ID$='SelectResult']");var aA=n("SPSetMultiSelectSizes",i.multiSelectColumn);ay.clone().appendTo(ay.closest("span")).css({width:"auto",height:0,visibility:"hidden"}).attr({id:aA,length:0});var aw=V("#"+aA);ay.find("option").each(function(){aw.append("")});aB.find("option").each(function(){aw.append("")});var t=V("#"+aA).width()+5;var aC=t;if(i.minWidth>0||i.maxWidth>0){if(ti.maxWidth){aC=i.maxWidth}}var av=t;ay.css("width",av+"px").parent().css("width",aC+"px");aB.css("width",av+"px").parent().css("width",aC+"px");V("#"+aA).remove()};V.fn.SPServices.SPScriptAudit=function(av){var aw=V.extend({},{webURL:"",listName:"",outputId:"",auditForms:true,auditViews:true,auditPages:true,auditPagesListName:"Pages",showHiddenLists:false,showNoScript:false,showSrc:true},av);var t=[["New","NewForm.aspx",false],["Display","DispForm.aspx",false],["Edit","EditForm.aspx",false]];var ax;V("#"+aw.outputId).append(""+(aw.showSrc?"":"")+"
ListPage ClassPage TypePageScript References
");V("#SPScriptAudit th").attr("class","ms-vh2-nofilter");if(aw.auditForms||aw.auditViews){V().SPServices({operation:"GetListCollection",webURL:aw.webURL,async:false,completefunc:function(aA,az){V(aA.responseXML).find("List").each(function(){ax=V(this);if((aw.listName.length===0)||(ax.attr("Title")===aw.listName)){if((aw.showHiddenLists&&ax.attr("Hidden")==="False")||!aw.showHiddenLists){if(aw.auditForms){V().SPServices({operation:"GetListContentTypes",webURL:aw.webURL,listName:ax.attr("ID"),async:false,completefunc:function(aC,aB){V(aC.responseXML).find("ContentType").each(function(){if(V(this).attr("ID").substring(0,6)!=="0x0120"){var aE=V(this).find("FormUrls");for(ao=0;ao0)?aw.webURL:V().SPServices.SPGetCurrentSite())+k+V(this).text());t[ao][2]=true});if(!t[ao][2]){var aD=ax.attr("DefaultViewUrl");p(aw,ax,"Form",t[ao][0],aD.substring(0,aD.lastIndexOf(k)+1)+t[ao][1])}}for(ao=0;aoFolder",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(aA,az){V(aA.responseXML).SPFilterNode("z:row").each(function(){var aC=V(this).attr("ows_FileRef").split(";#")[1];var aB=(typeof V(this).attr("ows_Title")!=="undefined")?V(this).attr("ows_Title"):"";if(aC.indexOf(".aspx")>0){p(aw,ax,"Page",aB,k+aC)}})}})}}V("#SPScriptAudit tr[class='ms-alternating']:even").removeAttr("class")};function p(t,av,aC,ay,aw){var az=0;var aB=0;var ax={};ax.type=[];ax.src=[];ax.script=[];var aA=RegExp("","gi");V.ajax({type:"GET",url:aw,dataType:"text",async:false,success:function(aH){while(scriptMatch=aA.exec(aH)){var aD=Q(scriptMatch,"language");var aI=Q(scriptMatch,"type");var aF=Q(scriptMatch,"src");if(aF!==null&&aF.length>0&&!U(aF)){ax.type.push((aD!==null&&aD.length>0)?aD:aI);ax.src.push(aF);aB++}}if((!t.showNoScript&&(ax.type.length>0))||t.showNoScript){var aG=aw.substring(0,aw.lastIndexOf(k)+1);var aE=""+av.attr("Title")+((av.attr("Hidden")==="True")?"(Hidden)":"")+""+aC+""+ay+""+J(aw)+"";if(t.showSrc){var i;aE+="";for(az=0;az";aE+=""}aE+="
"+ax.type[az]+""+J(ax.src[az])+"
"}V("#SPScriptAudit").append(aE)}}})}function Q(av,t){var i=RegExp(t+"=(\"([^\"]*)\")|('([^']*)')","gi");if(matches=i.exec(av)){return matches[2]}return null}function U(aw){var av;var t=["WebResource.axd","_layouts"];for(av=0;av-1){return true}}return false}V.fn.SPServices.SPArrangeChoices=function(aC){var t=V.extend({},{listName:"",columnName:"",perRow:99,randomize:false},aC);var ay=false;var az=[];var aw;V().SPServices({operation:"GetList",async:false,cacheXML:true,listName:(t.listName.length>0)?t.listName:V().SPServices.SPListNameFromUrl(),completefunc:function(aE,aD){V(aE.responseXML).find("Fields").each(function(){V(this).find("Field[DisplayName='"+t.columnName+"']").each(function(){ay=(V(this).attr("FillInChoice")==="TRUE")?true:false;return false})})}});var av=al(t.columnName);var ax=V(av).find("tr").length;var aA=0;var i;var aB;V(av).find("tr").each(function(){aA++;if(ay&&aA===(ax-1)){i=V(this).find("td").html()}else{if(ay&&aA===ax){aB=V(this).find("td").html()}else{az.push(V(this).html())}}});aw="";if(t.randomize){az.sort(an)}for(ao=0;ao"}}aw+="";if(ay){aw+=""+i+aB+""}V(av).find("tr").remove();V(av).find("table").append(aw)};V.fn.SPServices.SPAutocomplete=function(av){var aw=V.extend({},{WebURL:"",sourceList:"",sourceColumn:"",columnName:"",CAMLQuery:"",CAMLQueryOptions:"",CAMLRowLimit:0,filterType:"BeginsWith",numChars:0,ignoreCase:false,highlightClass:"",uniqueVals:false,maxHeight:99999,slideDownSpeed:"fast",processingIndicator:"_layouts/images/REFRESH.GIF",debug:false},av);var ay;var t=V("input[Title='"+aw.columnName+"']");V("input[Title='"+aw.columnName+"']").css("position","");var az=t.attr("ID");var ax=t.css("color");var aA=t.css("width");if(t.html()===null&&aw.debug){R("SPServices.SPAutocomplete","columnName: "+aw.columnName,"Column is not an input control or is not found on page");return}t.closest("span").find("br").remove();t.wrap("
");var i=n("SPAutocomplete",aw.columnName);t.after("
");V("#"+i).css("width",aA);V(t).keyup(function(){var aJ=V(this).val();V("#"+i).hide();if(aJ.length";if(aw.CAMLQuery.length>0){aB+=""}aB+="<"+aw.filterType+">"+aJ+"";if(aw.CAMLQuery.length>0){aB+=aw.CAMLQuery+""}aB+="";V().SPServices({operation:"GetListItems",async:false,webURL:aw.WebURL,listName:aw.sourceList,CAMLQuery:aB,CAMLQueryOptions:aw.CAMLQueryOptions,CAMLViewFields:"",CAMLRowLimit:aw.CAMLRowLimit,completefunc:function(aN,aL){var aM=aw.ignoreCase?aJ.toUpperCase():aJ;V(aN.responseXML).SPFilterNode("z:row").each(function(){var aP=V(this).attr("ows_"+aw.sourceColumn);var aQ=aw.ignoreCase?V(this).attr("ows_"+aw.sourceColumn).toUpperCase():V(this).attr("ows_"+aw.sourceColumn);if(aw.filterType==="Contains"){var aO=aQ.indexOf(aM);if((aO>=0)&&(!aw.uniqueVals||(V.inArray(aP,aI)===-1))){aI.push(V(this).attr("ows_"+aw.sourceColumn))}}else{if(aM===aQ.substr(0,aM.length)&&(!aw.uniqueVals||(V.inArray(aP,aI)===-1))){aI.push(V(this).attr("ows_"+aw.sourceColumn))}}})}});var aE="";for(ao=0;ao0){var aD=RegExp(aJ,aw.ignoreCase?"gi":"g");var aG=aI[ao].match(aD);var aF=0;for(ay=0;ay"+aG[ay]+"";aI[ao]=aI[ao].substr(0,aH)+aK+aI[ao].substr(aC);aF=aH+aK.length}}aE+="
  • "+aI[ao]+"
  • "}V("#"+i).html(aE);V("#"+i+" li").click(function(){V("#"+i).fadeOut(aw.slideUpSpeed);V("#"+az).val(V(this).text())}).mouseover(function(){var aL={cursor:"hand",color:"#ffffff",background:"#3399ff"};V(this).css(aL)}).mouseout(function(){var aL={cursor:"inherit",color:ax,background:"transparent"};V(this).css(aL)});if(aI.length>0){V("#"+i).slideDown(aw.slideDownSpeed)}t.css("background-image","")})};V.fn.SPServices.SPGetQueryString=function(){var ax;var ay={};var t=location.search.substring(1,location.search.length);var av=t.split("&");var aw=/^([^=]+)=(.*)/i;for(ax=0;ax2){ay[matches[1]]=unescape(matches[2]).replace(/\+/g," ")}}}return ay};V.fn.SPServices.SPListNameFromUrl=function(i){var t=V.extend({},{listName:""},i);if(t.listName.length>0){y=t.listName;return y}else{if(y.length>0){return y}}var aw=location.href;var av=aw.substring(0,aw.indexOf(".aspx"));var ax=decodeURIComponent(av.substring(0,av.lastIndexOf(k)+1)).toUpperCase();V().SPServices({operation:"GetListCollection",async:false,completefunc:function(az,ay){V(az.responseXML).find("List").each(function(){var aA=V(this).attr("DefaultViewUrl");var aB=aA.substring(0,aA.lastIndexOf(k)+1).toUpperCase();if(ax.indexOf(aB)>0){y=V(this).attr("ID");return false}})}});return y};V.fn.SPServices.SPUpdateMultipleListItems=function(aw){var ay=V.extend({},{webURL:"",listName:"",CAMLQuery:"",batchCmd:"Update",valuepairs:[],completefunc:null,debug:false},aw);var ax;var aA=[];var az=[];V().SPServices({operation:"GetListItems",async:false,webURL:ay.webURL,listName:ay.listName,CAMLQuery:ay.CAMLQuery,CAMLQueryOptions:"",completefunc:function(aB,i){V(aB.responseXML).SPFilterNode("z:row").each(function(){aA.push(V(this).attr("ows_ID"));var aC=V(this).attr("ows_FileRef");aC="/"+aC.substring(aC.indexOf(";#")+2);az.push(aC)})}});var t;var av="";for(ax=0;ax";for(t=0;t"+D(ay.valuepairs[t][1])+""}av+=""+aA[ax]+"";if(az[ax].length>0){av+=""+az[ax]+""}av+=""}av+="";V().SPServices({operation:"UpdateListItems",async:false,webURL:ay.webURL,listName:ay.listName,updates:av,completefunc:function(aB,i){if(ay.completefunc!==null){ay.completefunc(aB,i)}}})};V.fn.SPFilterNode=function(i){return this.find("*").filter(function(){return this.nodeName===i})};V.fn.SPXmlToJson=function(t){var aw=V.extend({},{mapping:{},includeAllAttrs:false,removeOws:true},t);var i;var av=[];this.each(function(){var aB={};var aA;var aD=this.attributes;V.each(aw.mapping,function(){aB[this.mappedName]=""});for(attrNum=0;attrNum0){t.html(aw.valueToSet)}if(aw.checkNames){i.click()}var ay=V.trim(t.text());var ax=[];t.children("span").each(function(){var aB=V(this).find("div[data]").attr("data");var aA={};if(aB!=undefined){var aC=V.parseXML(aB);$xml=V(aC);$xml.find("DictionaryEntry").each(function(){var aD=V(this).find("Key").text();var aE=V(this).find("Value").text();aA[aD]=aE});ax.push(aA)}else{V().SPServices({operation:"GetUserInfo",async:false,cacheXML:true,userLoginName:V(this).attr("title"),completefunc:function(aE,aD){V(aE.responseXML).find("User").each(function(){V.each(this.attributes,function(aG,aI){var aF=aI.name;var aH=aI.value;aA[aF]=aH});ax.push(aA)})}})}});return{row:az,contents:t,currentValue:ay,checkNames:i,dictionaryEntries:ax}};V.fn.SPServices.Version=function(){return B};function F(aF,aB,aG,aw){if(typeof aG==="undefined"){return""}var aC;var aD="";var aA;var ay;var aE=[];var ax=aw.relatedWebURL.length>0?aw.relatedWebURL:V().SPServices.SPGetCurrentSite();switch(aB.attr("Type")){case"Text":aD=aG;break;case"URL":switch(aB.attr("Format")){case"Hyperlink":aD="
    "+aG.substring(aG.search(",")+1)+"";break;case"Image":aD=""+aG.substring(aG.search(",")+1)+"";break;default:aD=aG;break}break;case"User":case"UserMulti":var t=aG.split(";#");for(aC=0;aC"+t[aC+1]+"")}aD=aE.join(", ");break;case"Calculated":var az=aG.split(";#");aD=az[1];break;case"Number":ay=aB.attr("Decimals");aD=ay===undefined?parseFloat(aG).toString():parseFloat(aG).toFixed(ay).toString();break;case"Currency":ay=aB.attr("Decimals");aD=ay===undefined?parseFloat(aG).toFixed(2).toString():parseFloat(aG).toFixed(ay).toString();break;case"Lookup":switch(aB.attr("Name")){case"FileRef":aA=aF.attr("BaseType")==="1"?aF.attr("RootFolder")+k+"Forms/DispForm.aspx":aF.attr("RootFolder")+k+"DispForm.aspx";aD=""+aG.substring(aG.search(";#")+2)+"";break;case"FileDirRef":aA=k+aG.substring(aG.search(";#")+2);aD=""+aG.substring(aG.search(";#")+2)+"";break;default:aA=v(aB.attr("List"),"DisplayForm");aD=""+aG.substring(aG.search(";#")+2)+"";break}break;case"LookupMulti":aA=v(aB.attr("List"),"DisplayForm");aD="";if(aG.length>0){var av=aG.split(";#");for(aC=0;aC"+av[(aC*2)+1]+"")}}aD=aE.join(", ");break;case"File":J=aG.substring(aG.search(";#")+2);aD=""+J+"";break;case"Counter":aD=aG;break;case"DateTime":aD=aG;break;default:aD=aG;break}return aD}function ak(ax,aw){var av;var t="";for(av=0;av"}t+="
    "+av+""+ax.attributes.item(av).nodeName+""+C(ax.attributes.item(av).nodeValue)+"
    ";return t}function ai(i){if((this.Obj=V("select[Title='"+i+"']")).length===1){this.Type="S"}else{if((this.Obj=V("input[Title='"+i+"']")).length===1){this.Type="C"}else{if((this.Obj=V("select[ID$='SelectCandidate'][Title^='"+i+" ']")).length===1){this.Type="M"}else{if((this.Obj=V("select[ID$='SelectCandidate'][Title$=': "+i+"']")).length===1){this.Type="M"}else{if((this.Obj=V("select[ID$='SelectCandidate'][Title$='\""+i+"\".']")).length===1){this.Type="M"}else{if((this.Obj=V("select[ID$='SelectCandidate'][Title$=' "+i+"']")).length===1){this.Type="M"}else{this.Type=null}}}}}}}function W(aw,t){var i=[];switch(aw.Type){case"S":if(t){i.push(aw.Obj.find("option:selected").val()||[])}else{i.push(aw.Obj.find("option:selected").text()||[])}break;case"C":if(t){i.push(V("input[id='"+aw.Obj.attr("optHid")+"']").val()||[])}else{i.push(aw.Obj.attr("value")||[])}break;case"M":var av=aw.Obj.closest("span").find("select[ID$='SelectResult']");V(av).find("option").each(function(){i.push(V(this).html())});break;default:break}return i}function R(t,aw,av){var i="Error in function
    "+t+"
    Parameter
    "+aw+"
    Message
    "+av+"

    Click to continue
    ";g(i)}function g(ay){var av="position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;";V("#aspnetForm").parent().append("
    "+ay);var i=V("#SPServices_msgBox").height();var ax=V("#SPServices_msgBox").width();var aw=(V(window).width()/2)-(ax/2)+"px";var t=(V(window).height()/2)-(i/2)-100+"px";V("#SPServices_msgBox").css({border:"5px #C02000 solid",left:aw,top:t}).show().fadeTo("slow",0.75).click(function(){V(this).fadeOut("3000",function(){V(this).remove()})})}function n(i,t){return i+"_"+V().SPServices.SPGetStaticFromDisplay({listName:V().SPServices.SPListNameFromUrl(),columnDisplayName:t})}function v(i,aw){var av,t;V().SPServices({operation:"GetFormCollection",async:false,listName:i,completefunc:function(ay,ax){t=V(ay.responseXML).find("Form[Type='"+aw+"']").attr("Url")}});return t}function j(aw,t){var av;for(av=0;av"+i+""}function an(){return(Math.round(Math.random())-0.5)}function C(i){return((i.indexOf("http")===0)||(i.indexOf(k)===0))?""+i+"":i}function J(i){return i.substring(i.lastIndexOf(k)+1,i.length)}function a(i){return i.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}function D(i){if(typeof i==="string"){return i.replace(/&(?![a-zA-Z]{1,8};)/g,"&")}else{return i}}function ar(i){return i.replace(/&/g,"%26")}})(jQuery); diff --git a/jquery.SPServices-0.7.2.js b/jquery.SPServices-2013.01.js similarity index 86% rename from jquery.SPServices-0.7.2.js rename to jquery.SPServices-2013.01.js index 9b6aa35..bb40ffb 100644 --- a/jquery.SPServices-0.7.2.js +++ b/jquery.SPServices-2013.01.js @@ -1,26 +1,30 @@ /* * SPServices - Work with SharePoint's Web Services using jQuery - * Version 0.7.2 -> Note to Marc: Also change var VERSION below. - * @requires jQuery v1.4.2 or greater - jQuery 1.7+ recommended + * Version 2013.01 + * @requires jQuery v1.5 or greater - jQuery 1.7+ recommended * - * Copyright (c) 2009-2012 Sympraxis Consulting LLC + * Copyright (c) 2009-2013 Sympraxis Consulting LLC * Examples and docs at: * http://spservices.codeplex.com * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php */ -/** +/* * @description Work with SharePoint's Web Services using jQuery * @type jQuery * @name SPServices * @category Plugins/SPServices * @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com */ +/* jshint undef: true */ +/* global _spUserId, _spPageContextInfo, GipAddSelectedItems, GipRemoveSelectedItems, GipGetGroupData */ (function ($) { + "use strict"; + // Version info - var VERSION = "0.7.2"; + var VERSION = "2013.01"; // TODO: Update version // String constants // General @@ -28,6 +32,9 @@ var TXTColumnNotFound = "Column not found on page"; var SCHEMASharePoint = "http://schemas.microsoft.com/sharepoint"; + // Caching + var promisesCache = {}; + // Web Service names var ALERTS = "Alerts"; var AUTHENTICATION = "Authentication"; @@ -39,6 +46,7 @@ var PERMISSIONS = "Permissions"; var PUBLISHEDLINKSSERVICE = "PublishedLinksService"; var SEARCH = "Search"; + var SPSEARCH = "SPSearch"; var SHAREPOINTDIAGNOSTICS = "SharePointDiagnostics"; var SITEDATA = "SiteData"; var SITES = "Sites"; @@ -54,16 +62,16 @@ var WORKFLOW = "Workflow"; // Global variables - var thisSite = ""; // The current site - var thisList = ""; // The current list when in a list context - var i = 0; // Generic loop counter - var t = ""; // Temporary string variable + var SPServicesContext = new SPServicesContext(); // Variable to hold the current context as we figure it out + var i = 0; // Generic loop counter + var encodeOptionList = ["listName", "description"]; // Used to encode options which may contain special characters + // Array to store Web Service information // WSops.OpName = [WebService, needs_SOAPAction]; // OpName The name of the Web Service operation -> These names are unique // WebService The name of the WebService this operation belongs to - // needs_SOAPAction Boolean indicating whether the operatio needs to have the SOAPAction passed in the setRequestHeaderfunction. + // needs_SOAPAction Boolean indicating whether the operation needs to have the SOAPAction passed in the setRequestHeaderfunction. // true if the operation does a write, else false var WSops = []; @@ -135,6 +143,11 @@ WSops.Registration = [SEARCH, false]; WSops.Status = [SEARCH, false]; + WSops.SPQuery = [SPSEARCH, false]; + WSops.SPQueryEx = [SPSEARCH, false]; + WSops.SPRegistration = [SPSEARCH, false]; + WSops.SPStatus = [SPSEARCH, false]; + WSops.SendClientScriptErrorReport = [SHAREPOINTDIAGNOSTICS,true]; WSops.GetAttachments = [SITEDATA, false]; @@ -331,6 +344,13 @@ // If there are no options passed in, use the defaults. Extend replaces each default with the passed option. var opt = $.extend({}, $.fn.SPServices.defaults, options); + + // Encode options which may contain special character, esp. ampersand + for(var i=0; i < encodeOptionList.length; i++) { + if(typeof opt[encodeOptionList[i]] === "string") { + opt[encodeOptionList[i]] = encodeXml(opt[encodeOptionList[i]]); + } + } // Put together operation header and SOAPAction for the SOAP call based on which Web Service we're calling SOAPEnvelope.opheader = "<" + opt.operation + " "; @@ -364,7 +384,7 @@ SOAPAction = "http://microsoft.com/webservices/SharePointPortalServer/SocialDataService/"; break; case SPELLCHECK: - SOAPEnvelope.opheader += "xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/'"; + SOAPEnvelope.opheader += "xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/' >"; SOAPAction = "http://schemas.microsoft.com/sharepoint/publishing/spelling/SpellCheck"; break; case TAXONOMYSERVICE: @@ -542,7 +562,7 @@ break; case "UpdateListItems": addToPayload(opt, ["listName"]); - if(opt.updates !== undefined && opt.updates.length > 0) { + if(typeof opt.updates !== "undefined" && opt.updates.length > 0) { addToPayload(opt, ["updates"]); } else { SOAPEnvelope.payload += ""; @@ -610,26 +630,36 @@ case "GetQuerySuggestions": SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; - SOAPEnvelope.payload += wrapNode("queryXml", escapeHTML(opt.queryXml)); + SOAPEnvelope.payload += wrapNode("queryXml", encodeXml(opt.queryXml)); break; case "GetSearchMetadata": SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; break; case "Query": - SOAPEnvelope.payload += wrapNode("queryXml", escapeHTML(opt.queryXml)); + SOAPEnvelope.payload += wrapNode("queryXml", encodeXml(opt.queryXml)); break; case "QueryEx": SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; - SOAPEnvelope.payload += wrapNode("queryXml", escapeHTML(opt.queryXml)); + SOAPEnvelope.payload += wrapNode("queryXml", encodeXml(opt.queryXml)); break; case "Registration": - SOAPEnvelope.payload += wrapNode("registrationXml", escapeHTML(opt.registrationXml)); + SOAPEnvelope.payload += wrapNode("registrationXml", encodeXml(opt.registrationXml)); break; case "Status": break; + // SPSEARCH OPERATIONS + case "SPQuery": + SOAPEnvelope.payload += wrapNode("queryXml", encodeXml(opt.queryXml)); + break; + case "SPQueryEx": + SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; + SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; + SOAPEnvelope.payload += wrapNode("queryXml", encodeXml(opt.queryXml)); + break; + // SHAREPOINTDIAGNOSTICS OPERATIONS case "SendClientScriptErrorReport": addToPayload(opt, ["message", "file", "line", "client", "stack", "team", "originalFile"]); @@ -667,9 +697,9 @@ // SITES OPERATIONS case "CreateWeb": - addToPayload(opt, ["urlType", "titleType", "descriptionType", "templateNameType", "languageType", "languageSpecifiedType", - "localeType", "localeSpecifiedType", "collationLocaleType", "collationLocaleSpecifiedType", "uniquePermissionsType", - "uniquePermissionsSpecifiedType", "anonymousType", "anonymousSpecifiedType", "presenceType", "presenceSpecifiedType"]); + addToPayload(opt, ["url", "title", "description", "templateName", "language", "languageSpecified", + "locale", "localeSpecified", "collationLocale", "collationLocaleSpecified", "uniquePermissions", + "uniquePermissionsSpecified", "anonymous", "anonymousSpecified", "presence", "presenceSpecified"]); break; case "DeleteWeb": addToPayload(opt, ["url"]); @@ -741,7 +771,7 @@ break; case "GetCommentsOnUrl": addToPayload(opt, ["url", "maximumItemsToReturn", "startIndex"]); - if(opt.excludeItemsTime !== undefined && opt.excludeItemsTime.length > 0) { + if(typeof opt.excludeItemsTime !== "undefined" && opt.excludeItemsTime.length > 0) { SOAPEnvelope.payload += wrapNode("excludeItemsTime", opt.excludeItemsTime); } break; @@ -999,7 +1029,7 @@ break; case "GetUserProfileByName": // Note that this operation is inconsistent with the others, using AccountName rather than accountName - if(opt.accountName !== undefined && opt.accountName.length > 0) { + if(typeof opt.accountName !== "undefined" && opt.accountName.length > 0) { addToPayload(opt, [["AccountName", "accountName"]]); } else { addToPayload(opt, ["AccountName"]); @@ -1169,46 +1199,58 @@ } // Glue together the pieces of the SOAP message - var msg = SOAPEnvelope.header + - SOAPEnvelope.opheader + - SOAPEnvelope.payload + - SOAPEnvelope.opfooter + - SOAPEnvelope.footer; - - var cachedXML; - var status = null; + var msg = SOAPEnvelope.header + SOAPEnvelope.opheader + SOAPEnvelope.payload + SOAPEnvelope.opfooter + SOAPEnvelope.footer; + // Check to see if we've already cached the results + var cachedPromise; if(opt.cacheXML) { - cachedXML = $("body").data(msg); + cachedPromise = promisesCache[msg]; } + + // If we don't have a completefunc, then we won't attempt to call it + var thisHasCompletefunc = $.isFunction(opt.completefunc); + + if(typeof cachedPromise === "undefined") { - if(cachedXML === undefined) { - // Make the Ajax call - $.ajax({ - url: ajaxURL, // The relative URL for the AJAX call - async: opt.async, // By default, the AJAX calls are asynchronous. You can specify false to require a synchronous call. - beforeSend: function (xhr) { // Before sending the msg, need to send the request header + // Finally, make the Ajax call + promisesCache[msg] = $.ajax({ + // The relative URL for the AJAX call + url: ajaxURL, + // By default, the AJAX calls are asynchronous. You can specify false to require a synchronous call. + async: thisHasCompletefunc ? false : opt.async, + // Before sending the msg, need to send the request header + beforeSend: function (xhr) { // If we need to pass the SOAPAction, do so if(WSops[opt.operation][1]) { xhr.setRequestHeader("SOAPAction", SOAPAction); } }, - type: "POST", // This is a POST - data: msg, // Here is the SOAP request we've built above - dataType: "xml", // We're getting XML; tell jQuery so that it doesn't need to do a best guess - contentType: "text/xml;charset='utf-8'", // and this is its content type + // Always a POST + type: "POST", + // Here is the SOAP request we've built above + data: msg, + // We're getting XML; tell jQuery so that it doesn't need to do a best guess + dataType: "xml", + // and this is its content type + contentType: "text/xml;charset='utf-8'", complete: function(xData, Status) { - if(opt.cacheXML) { - $("body").data(msg, xData); // Cache the results + // When the call is complete, call the completefunc if there is one + if(thisHasCompletefunc) { + opt.completefunc(xData, Status); } - cachedXML = xData; - status = Status; - opt.completefunc(cachedXML, status); // When the call is complete, do this } }); + + // Return the promise + return promisesCache[msg]; } else { - opt.completefunc(cachedXML, status); // Call the completefunc + // Call the completefunc if there is one + if(thisHasCompletefunc) { + opt.completefunc(cachedPromise, null); + } + // Return the cached promise + return cachedPromise; } }; // End $.fn.SPServices @@ -1218,7 +1260,7 @@ // we allow for all in a standardized way. $.fn.SPServices.defaults = { - cacheXML: false, // If true, we'll cache the XML results with jQuery's .data() function + cacheXML: false, // If true, we'll cache the XML results for the call operation: "", // The Web Service operation webURL: "", // URL of the target Web makeViewDefault: false, // true to make the view the default view for the list @@ -1261,19 +1303,14 @@ // The function is also available as a public function. $.fn.SPServices.SPGetCurrentSite = function() { - // Do we already know the current site? - if(thisSite.length > 0) { - return thisSite; + // We've already determined the current site... + if(SPServicesContext.thisSite.length > 0) { + return SPServicesContext.thisSite; } - // SharePoint 2010 provides the current context, so if available, let's use it -// thisSite = (typeof SP !== "undefined") ? SP.ClientContext.get_current().get_url() : undefined; -// if(thisSite !== undefined) return thisSite = location.protocol + "//" + location.hostname + thisSite; - + // If we still don't know the current site, we call WebUrlFromPageUrlResult. var msg = SOAPEnvelope.header + - "" + - ((location.href.indexOf("?") > 0) ? location.href.substr(0, location.href.indexOf("?")) : location.href) + - "" + + "" + location.protocol + "//" + location.host + location.pathname + "" + SOAPEnvelope.footer; $.ajax({ async: false, // Need this to be synchronous so we're assured of a valid value @@ -1282,11 +1319,13 @@ data: msg, dataType: "xml", contentType: "text/xml;charset=\"utf-8\"", - complete: function (xData, Status) { - thisSite = $(xData.responseXML).find("WebUrlFromPageUrlResult").text(); + complete: function (xData) { + SPServicesContext.thisSite = $(xData.responseXML).find("WebUrlFromPageUrlResult").text(); } }); - return thisSite; // Return the URL + + return SPServicesContext.thisSite; // Return the URL + }; // End $.fn.SPServices.SPGetCurrentSite // Function to set up cascading dropdowns on a SharePoint form @@ -1304,6 +1343,7 @@ childColumn: "", // The display name of the child column in the form listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. CAMLQuery: "", // [Optional] For power users, this CAML fragment will be Anded with the default query on the relationshipList + CAMLQueryOptions: "FALSE", // [Optional] For power users, ability to specify Query Options promptText: "", // [DEPRECATED] Text to use as prompt. If included, {0} will be replaced with the value of childColumn. IOrignal value "Choose {0}..." noneText: "(None)", // [Optional] Text to use for the (None) selection. Provided for non-English language support. simpleChild: false, // [Optional] If set to true and childColumn is a complex dropdown, convert it to a simple dropdown @@ -1333,6 +1373,8 @@ // Set the childSelect to reference the new simple dropdown childSelect = new DropdownCtl(opt.childColumn); } + + var childColumnRequired, childColumnStatic; // Get information about the childColumn from the current list $().SPServices({ @@ -1340,7 +1382,7 @@ async: false, cacheXML: true, listName: opt.listName, - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).find("Fields").each(function() { $(this).find("Field[DisplayName='" + opt.childColumn + "']").each(function() { // Determine whether childColumn is Required @@ -1358,7 +1400,7 @@ var childColumns = parentSelect.Obj.data("SPCascadeDropdownsChildColumns"); // If this is the first child for this parent, then create the data object to hold the settings - if(childColumns === undefined) { + if(typeof childColumns === "undefined") { parentSelect.Obj.data("SPCascadeDropdownsChildColumns", [childColumn]); // If we already have a data object for this parent, then add the setting for this child to it } else { @@ -1390,8 +1432,7 @@ cascadeDropdown(opt.parentColumn, parentSelect); }); // Handle the dblclick on the selected values - parentSelections = parentSelect.Obj.closest("span").find("select[id$='SelectResult']"); - parentSelections.bind("dblclick", function() { + parentSelect.Obj.closest("span").find("select[id$='SelectResult']").bind("dblclick", function() { cascadeDropdown(opt.parentColumn, parentSelect); }); // Handle a button click @@ -1414,8 +1455,9 @@ var choices = ""; var parentSelectSelected; var childSelectSelected = null; - var master; + var MultiLookupElements; var MultiLookupPickerdata; + var master; var newMultiLookupPickerdata; var numChildOptions; var firstChildOptionId; @@ -1430,6 +1472,7 @@ var childSelect = this.childSelect; var childColumnStatic = this.childColumnStatic; var childColumnRequired = this.childColumnRequired; + var currentSelection; // Get the parent column selection(s) parentSelectSelected = getDropdownSelected(parentSelect, opt.matchOnId); @@ -1449,8 +1492,10 @@ // Find the important bits of the multi-select if(childSelect.Type === "M") { - MultiLookupPickerdata = childSelect.Obj.closest("span").find("input[name$='MultiLookupPicker$data']"); - master = window[childSelect.Obj.closest("tr").find("button[id$='AddButton']").attr("id").replace(/AddButton/,'MultiLookupPicker_m')]; + + MultiLookupElements = new MultiLookupPicker(childSelect.Obj); + MultiLookupPickerdata = MultiLookupElements.MultiLookupPickerdata; + master = MultiLookupElements.master; currentSelection = childSelect.Obj.closest("span").find("select[ID$='SelectResult']"); } @@ -1509,8 +1554,8 @@ // Override the default view rowlimit and get all appropriate rows CAMLRowLimit: 0, // Even though setting IncludeMandatoryColumns to FALSE doesn't work as the docs describe, it fixes a bug in GetListItems with mandatory multi-selects - CAMLQueryOptions: "FALSE", - completefunc: function(xData, Status) { + CAMLQueryOptions: opt.CAMLQueryOptions, + completefunc: function(xData) { // Handle errors $(xData.responseXML).find("errorstring").each(function() { @@ -1561,46 +1606,44 @@ // Add an option for each child item $(xData.responseXML).SPFilterNode("z:row").each(function() { - var thisOptionId, thisOptionValue; + var thisOption = {}; // If relationshipListChildColumn is a Lookup column, then the ID should be for the Lookup value, // else the ID of the relationshipList item var thisValue = $(this).attr("ows_" + opt.relationshipListChildColumn); - if(thisValue !== undefined && thisValue.indexOf(";#") > 0) { - var splitValue = thisValue.split(";#"); - thisOptionId = splitValue[0]; - thisOptionValue = splitValue[1]; + if(typeof thisValue !== "undefined" && thisValue.indexOf(";#") > 0) { + thisOption = new SplitIndex(thisValue); } else { - thisOptionId = $(this).attr("ows_ID"); - thisOptionValue = thisValue; + thisOption.id = $(this).attr("ows_ID"); + thisOption.value = thisValue; } // If the relationshipListChildColumn is a calculated column, then the value isn't preceded by the ID, - // but by the datatype. In this case, thisOptionId should be the ID of the relationshipList item. + // but by the datatype. In this case, thisOption.id should be the ID of the relationshipList item. // e.g., float;#12345.67 - if(isNaN(thisOptionId)) { - thisOptionId = $(this).attr("ows_ID"); + if(isNaN(thisOption.id)) { + thisOption.id = $(this).attr("ows_ID"); } // Save the id and value for the first child option in case we need to select it (selectSingleOption option is true) - firstChildOptionId = thisOptionId; - firstChildOptionValue = thisOptionValue; + firstChildOptionId = thisOption.id; + firstChildOptionValue = thisOption.value; switch(childSelect.Type) { case "S": var selected = ($(this).attr("ows_ID") === childSelectSelected[0]) ? " selected='selected'" : ""; - childSelect.Obj.append("" + thisOptionValue + ""); + childSelect.Obj.append("" + thisOption.value + ""); break; case "C": - if(thisOptionId === childSelectSelected[0]) { - childSelect.Obj.attr("value", thisOptionValue); + if(thisOption.id === childSelectSelected[0]) { + childSelect.Obj.attr("value", thisOption.value); } - choices = choices + ((choices.length > 0) ? "|" : "") + thisOptionValue + "|" + thisOptionId; + choices = choices + ((choices.length > 0) ? "|" : "") + thisOption.value + "|" + thisOption.id; break; case "M": - childSelect.Obj.append(""); - newMultiLookupPickerdata += thisOptionId + "|t" + thisOptionValue + "|t |t |t"; + childSelect.Obj.append(""); + newMultiLookupPickerdata += thisOption.id + "|t" + thisOption.value + "|t |t |t"; break; default: break; @@ -1641,7 +1684,7 @@ var thisValue = $(this).html(); $(this).attr("selected", "selected"); $(childSelect.Obj).find("option").filter(function() { - return $(this).text() == thisValue.replace(/&/, "&"); + return $(this).text() === thisValue.replace(/&/, "&"); }).each(function() { if($(this).html() === thisValue) { thisSelected.removeAttr("selected"); @@ -1677,7 +1720,7 @@ if(opt.completefunc !== null) { opt.completefunc(); } - }); // $(childColumns).each(function() + }); // childColumns each } // End cascadeDropdown @@ -1782,7 +1825,7 @@ cacheXML: true, webURL: opt.relatedWebURL, listName: opt.relatedList, - completefunc: function(xData, Status) { + completefunc: function(xData) { // If debug is on, notify about an error $(xData.responseXML).find("faultcode").each(function() { if(opt.debug) {errBox(thisFunction, "relatedList: " + opt.relatedList, "List not found"); return; } @@ -1790,8 +1833,9 @@ // Get info about the related list relatedListXML = $(xData.responseXML).find("List"); // Save the information about each column requested + relatedColumnsXML[opt.relatedListColumn] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedColumn + "']"); for (i=0; i < opt.relatedColumns.length; i++) { - relatedColumnsXML[i] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedColumns[i] + "']"); + relatedColumnsXML[opt.relatedColumns[i]] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedColumns[i] + "']"); } } }); @@ -1855,9 +1899,17 @@ camlQuery += ""; } - camlQuery += "" : "'/>") + - escapeColumnValue(columnSelectSelected[0]) + ""; + // Need to handle Lookup columns differently than static columns + var relatedListColumnType = relatedColumnsXML[opt.relatedListColumn].attr("Type"); + if(relatedListColumnType === "Lookup") { + camlQuery += "" : "'/>") + + escapeColumnValue(columnSelectSelected[0]) + ""; + } else { + camlQuery += "" : opt.relatedListColumn + "'/>") + + escapeColumnValue(columnSelectSelected[0]) + ""; + }; if(opt.CAMLQuery.length > 0) { camlQuery += opt.CAMLQuery + ""; @@ -1879,7 +1931,7 @@ CAMLViewFields: "" + viewFields + "", // Override the default view rowlimit and get all appropriate rows CAMLRowLimit: 0, - completefunc: function(xData, Status) { + completefunc: function(xData) { // Handle errors $(xData.responseXML).find("errorstring").each(function() { @@ -1904,15 +1956,15 @@ outString = ""; outString += ""; for (i=0; i < opt.relatedColumns.length; i++) { - if(typeof relatedColumnsXML[i] === 'undefined' && opt.debug) {errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); return; } - outString += ""; + if(typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) {errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); return; } + outString += ""; } outString += ""; // Add an option for each child item $(xData.responseXML).SPFilterNode("z:row").each(function() { outString += ""; for (i=0; i < opt.relatedColumns.length; i++) { - outString += ""; + outString += ""; } outString += ""; }); @@ -1923,10 +1975,10 @@ outString = "
    " + relatedColumnsXML[i].attr("DisplayName") + "" + relatedColumnsXML[opt.relatedColumns[i]].attr("DisplayName") + "
    " + showColumn(relatedListXML, relatedColumnsXML[i], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "" + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "
    "; $(xData.responseXML).SPFilterNode("z:row").each(function() { for (i=0; i < opt.relatedColumns.length; i++) { - if(typeof relatedColumnsXML[i] === 'undefined' && opt.debug) {errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); return; } + if(typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) {errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); return; } outString += ""; - outString += ""; - outString += ""; + outString += ""; + outString += ""; outString += ""; } }); @@ -1948,25 +2000,27 @@ // Function to filter a lookup based dropdown $.fn.SPServices.SPFilterDropdown = function(options) { var opt = $.extend({}, { - relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationshipList - relationshipList: "", // The name of the list which contains the lookup values - relationshipListColumn: "", // The internal name of the column in the relationship list - relationshipListSortColumn: "", // [Optional] If specified, sort the options in the dropdown by this column, - // otherwise the options are sorted by relationshipListColumn - columnName: "", // The display name of the column in the form + relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationshipList + relationshipList: "", // The name of the list which contains the lookup values + relationshipListColumn: "", // The internal name of the column in the relationship list + relationshipListSortColumn: "", // [Optional] If specified, sort the options in the dropdown by this column, + // otherwise the options are sorted by relationshipListColumn + relationshipListSortAscending: true, // [Optional] By default, the sort is ascending. If false, descending + columnName: "", // The display name of the column in the form listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. - promptText: "", // [DEPRECATED] Text to use as prompt. If included, {0} will be replaced with the value of columnName. IOrignal value "Choose {0}..." - noneText: "(None)", // [Optional] Text to use for the (None) selection. Provided for non-English language support. - CAMLQuery: "", // This CAML fragment will be applied to the relationshipList + promptText: "", // [DEPRECATED] Text to use as prompt. If included, {0} will be replaced with the value of columnName. IOrignal value "Choose {0}..." + noneText: "(None)", // [Optional] Text to use for the (None) selection. Provided for non-English language support. + CAMLQuery: "", // This CAML fragment will be applied to the relationshipList CAMLQueryOptions: "FALSE", // Need this to mirror SharePoint's behavior, but it can be overridden - completefunc: null, // Function to call on completion of rendering the change. - debug: false // If true, show error messages; if false, run silent + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages; if false, run silent }, options); var choices = ""; var columnSelectSelected = null; + var MultiLookupElements; + var MultiLookupPickerdata; var master; - var MultiLookupPickerdata; var newMultiLookupPickerdata; var columnColumnRequired; var thisFunction = "SPServices.SPFilterDropdown"; @@ -1980,7 +2034,8 @@ // Get the relationshipList items which match the current selection var sortColumn = (opt.relationshipListSortColumn.length > 0) ? opt.relationshipListSortColumn : opt.relationshipListColumn; - var camlQuery = ""; + var sortOrder = (opt.relationshipListSortAscending === true) ? "" : "Ascending='FALSE'"; + var camlQuery = ""; if(opt.CAMLQuery.length > 0) { camlQuery += opt.CAMLQuery; } @@ -1992,7 +2047,7 @@ async: false, cacheXML: true, listName: opt.listName, - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).find("Fields").each(function() { $(this).find("Field[DisplayName='" + opt.columnName + "']").each(function() { // Determine whether columnName is Required @@ -2018,7 +2073,7 @@ CAMLRowLimit: 0, // Even though setting IncludeMandatoryColumns to FALSE doesn't work as the docs describe, it fixes a bug in GetListItems with mandatory multi-selects CAMLQueryOptions: opt.CAMLQueryOptions, - completefunc: function(xData, Status) { + completefunc: function(xData) { // Handle errors $(xData.responseXML).find("errorstring").each(function() { @@ -2064,42 +2119,40 @@ // Add an option for each item $(xData.responseXML).SPFilterNode("z:row").each(function() { - var thisOptionId, thisOptionValue; + var thisOption = {}; // If relationshipListColumn is a Lookup column, then the ID should be for the Lookup value, // else the ID of the relationshipList item var thisValue = $(this).attr("ows_" + opt.relationshipListColumn); - if(thisValue !== undefined && thisValue.indexOf(";#") > 0) { - var splitValue = thisValue.split(";#"); - thisOptionId = splitValue[0]; - thisOptionValue = splitValue[1]; + if(typeof thisValue !== "undefined" && thisValue.indexOf(";#") > 0) { + thisOption = new SplitIndex(thisValue); } else { - thisOptionId = $(this).attr("ows_ID"); - thisOptionValue = thisValue; + thisOption.id = $(this).attr("ows_ID"); + thisOption.value = thisValue; } // If the relationshipListColumn is a calculated column, then the value isn't preceded by the ID, - // but by the datatype. In this case, thisOptionId should be the ID of the relationshipList item. + // but by the datatype. In this case, thisOption.id should be the ID of the relationshipList item. // e.g., float;#12345.67 - if(isNaN(thisOptionId)) { - thisOptionId = $(this).attr("ows_ID"); + if(isNaN(thisOption.id)) { + thisOption.id = $(this).attr("ows_ID"); } switch(columnSelect.Type) { case "S": var selected = ($(this).attr("ows_ID") === columnSelectSelected[0]) ? " selected='selected'" : ""; - columnSelect.Obj.append("" + thisOptionValue + ""); + columnSelect.Obj.append("" + thisOption.value + ""); break; case "C": - if(thisOptionId === columnSelectSelected[0]) { - columnSelect.Obj.attr("value", thisOptionValue); + if(thisOption.id === columnSelectSelected[0]) { + columnSelect.Obj.attr("value", thisOption.value); } - choices = choices + ((choices.length > 0) ? "|" : "") + thisOptionValue + "|" + thisOptionId; + choices = choices + ((choices.length > 0) ? "|" : "") + thisOption.value + "|" + thisOption.id; break; case "M": - columnSelect.Obj.append(""); - newMultiLookupPickerdata += thisOptionId + "|t" + thisOptionValue + "|t |t |t"; + columnSelect.Obj.append(""); + newMultiLookupPickerdata += thisOption.id + "|t" + thisOption.value + "|t |t |t"; break; default: break; @@ -2116,12 +2169,14 @@ break; case "M": // Find the important bits of the multi-select - MultiLookupPickerdata = columnSelect.Obj.closest("span").find("input[name$='MultiLookupPicker$data']"); - master = window[columnSelect.Obj.closest("tr").find("button[id$='AddButton']").attr("id").replace(/AddButton/,'MultiLookupPicker_m')]; - currentSelection = columnSelect.Obj.closest("span").find("select[ID$='SelectResult']"); + MultiLookupElements = new MultiLookupPicker(columnSelect.Obj); + MultiLookupPickerdata = MultiLookupElements.MultiLookupPickerdata; + master = MultiLookupElements.master; + + var currentSelection = columnSelect.Obj.closest("span").find("select[ID$='SelectResult']"); + // Clear the master master.data = ""; - MultiLookupPickerdata.attr("value", newMultiLookupPickerdata); // Clear any prior selections that are no longer valid $(currentSelection).find("option").each(function() { @@ -2187,7 +2242,7 @@ outString += ""; if (opt.node.attributes) { - outString += ""; + outString += ""; } // A CDATA_SECTION node } else if (opt.node.hasChildNodes() && opt.node.firstChild.nodeType === NODE_CDATA_SECTION) { @@ -2201,7 +2256,7 @@ } else { outString += ""; if (opt.node.attributes) { - outString += ""; + outString += ""; } // Since the node has child nodes, recurse outString += ""; - // If randomize is true, randomly sort the options - if(opt.randomize) { - columnOptions.sort(randOrd); - } + // Add all of the options to the out string + out = ""; + for(i=0; i < columnOptions.length; i++) { + out += columnOptions[i]; + // If we've already got perRow columnOptions in the row, close off the row + if((i+1) % opt.perRow === 0) { + out += ""; + } + } + out += ""; - // Add all of the options to the out string - for(i=0; i < columnOptions.length; i++) { - out += columnOptions[i]; - // If we've already got perRow columnOptions in the row, close off the row - if((i+1) % opt.perRow === 0) { - out += ""; + // If we are allowing a fill-in choice, add that option in a separate row at the bottom + if(columnFillInChoice) { + out += ""; } - } - out += ""; - // If we are allowing a fill-in choice, add that option in a separate row at the bottom - if(columnFillInChoice) { - out += ""; - } + // Remove the existing rows... + $(thisFormField).find("tr").remove(); + // ...and append the out string + $(thisFormField).find("table").append(out); - // Remove the existing rows... - $(thisFormField).find("tr").remove(); - // ...and append the out string - $(thisFormField).find("table").append(out); + }); }; // End $.fn.SPServices.SPArrangeChoices @@ -3133,7 +3197,7 @@ CAMLQueryOptions: opt.CAMLQueryOptions, CAMLViewFields: "", CAMLRowLimit: opt.CAMLRowLimit, - completefunc: function(xData, Status) { + completefunc: function(xData) { // Handle upper/lower case if ignoreCase = true var testValue = opt.ignoreCase ? columnValue.toUpperCase() : columnValue; // See which values match and add the ones that do to matchArray @@ -3218,17 +3282,16 @@ // Get the Query String parameters and their values and return in an array $.fn.SPServices.SPGetQueryString = function () { - var i; var queryStringVals = {}; - + var matches; var qs = location.search.substring(1, location.search.length); var args = qs.split("&"); var rxQS = /^([^=]+)=(.*)/i; - for (i=0; i < args.length; i++) { + for(var i=0; i < args.length; i++) { matches = rxQS.exec(args[i]); - if (rxQS.test(location.href)) { - if (matches !== null && matches.length > 2) { + if(rxQS.test(location.href)) { + if(matches !== null && matches.length > 2) { queryStringVals[matches[1]] = unescape(matches[2]).replace(/\+/g,' '); } } @@ -3245,13 +3308,13 @@ listName: "" // [Optional] Pass in the name or GUID of a list if you are not in its context. e.g., on a Web Part pages in the Pages library }, options); - // Has the name or GUID been passed in? + // Has the list name or GUID been passed in? if(opt.listName.length > 0) { - thisList = opt.listName; - return thisList; + SPServicesContext.thisList = opt.listName; + return SPServicesContext.thisList; // Do we already know the current list? - } else if(thisList.length > 0) { - return thisList; + } else if(SPServicesContext.thisList.length > 0) { + return SPServicesContext.thisList; } // Parse out the list's root URL from the current location or the passed url @@ -3263,20 +3326,21 @@ $().SPServices({ operation: "GetListCollection", async: false, - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).find("List").each(function() { var defaultViewUrl = $(this).attr("DefaultViewUrl"); var listCollList = defaultViewUrl.substring(0, defaultViewUrl.lastIndexOf(SLASH) + 1).toUpperCase(); if(listPath.indexOf(listCollList) > 0) { - thisList = $(this).attr("ID"); + SPServicesContext.thisList = $(this).attr("ID"); return false; } }); } }); - // Return the GUID (ID) - return thisList; + // Return the list GUID (ID) + return SPServicesContext.thisList; + }; // End $.fn.SPServices.SPListNameFromUrl // SPUpdateMultipleListItems allows you to update multiple items in a list based upon some common characteristic or metadata criteria. @@ -3289,6 +3353,7 @@ batchCmd: "Update", // The operation to perform. By default, Update. valuepairs: [], // Valuepairs for the update in the form [[fieldname1, fieldvalue1], [fieldname2, fieldvalue2]...] completefunc: null, // Function to call on completion of rendering the change. + folder: "", // If specified, we will look only at items in that folder debug: false // If true, show error messages;if false, run silent }, options); @@ -3303,8 +3368,10 @@ webURL: opt.webURL, listName: opt.listName, CAMLQuery: opt.CAMLQuery, - CAMLQueryOptions: "", - completefunc: function(xData, Status) { + CAMLQueryOptions: "" + + ((opt.folder.length > 0) ? "" + opt.folder + "" : "") + + "", + completefunc: function(xData) { $(xData.responseXML).SPFilterNode("z:row").each(function() { itemsToUpdate.push($(this).attr("ows_ID")); var fileRef = $(this).attr("ows_FileRef"); @@ -3336,16 +3403,40 @@ webURL: opt.webURL, listName: opt.listName, updates: batch, - completefunc: function(xData, Status) { + completefunc: function(xData) { // If present, call completefunc when all else is done if(opt.completefunc !== null) { - opt.completefunc(xData, Status); + opt.completefunc(xData); } } }); }; // End $.fn.SPServices.SPUpdateMultipleListItems + + // Convert a JavaScript date to the ISO 8601 format required by SharePoint to update list items + $.fn.SPServices.SPConvertDateToISO = function (options) { + + var opt = $.extend({}, { + dateToConvert: new Date(), // The JavaScript date we'd like to convert. If no date is passed, the function returns the current date/time + dateOffset: "-05:00" // The time zone offset requested. Default is EST + }, options); + + //Generate ISO 8601 date/time formatted string + var s = ""; + var d = opt.dateToConvert; + s += d.getFullYear() + "-"; + s += pad(d.getMonth() + 1) + "-"; + s += pad(d.getDate()); + s += "T" + pad(d.getHours()) + ":"; + s += pad(d.getMinutes()) + ":"; + s += pad(d.getSeconds()) + "Z" + opt.dateOffset; + //Return the ISO8601 date string + return s; + + }; // End $.fn.SPServices.SPConvertDateToISO + + // This method for finding specific nodes in the returned XML was developed by Steve Workman. See his blog post // http://www.steveworkman.com/html5-2/javascript/2011/improving-javascript-xml-node-finding-performance-by-2000/ // for performance details. @@ -3366,12 +3457,11 @@ removeOws: true // Specifically for GetListItems, if true, the leading ows_ will be stripped off the field name }, options); - var colNum; + var attrNum; var jsonObject = []; this.each(function() { var row = {}; - var colValue; var rowAttrs = this.attributes; // Bring back all mapped columns, even those with no value @@ -3383,8 +3473,8 @@ for(attrNum = 0; attrNum < rowAttrs.length; attrNum++) { var thisAttrName = rowAttrs[attrNum].name; var thisMapping = opt.mapping[thisAttrName]; - var thisObjectName = thisMapping !== undefined ? thisMapping.mappedName : opt.removeOws ? thisAttrName.split("ows_")[1] : thisAttrName; - var thisObjectType = thisMapping !== undefined ? thisMapping.objectType : undefined; + var thisObjectName = typeof thisMapping !== "undefined" ? thisMapping.mappedName : opt.removeOws ? thisAttrName.split("ows_")[1] : thisAttrName; + var thisObjectType = typeof thisMapping !== "undefined" ? thisMapping.objectType : undefined; if(opt.includeAllAttrs || thisMapping !== undefined) { row[thisObjectName] = attrToJson(rowAttrs[attrNum].value, thisObjectType); } @@ -3402,9 +3492,11 @@ function attrToJson(v, objectType) { + var colValue; + switch (objectType) { case "DateTime": - case "datetime": // For calculated columns, stored as datetime;#value + case "datetime": // For calculated columns, stored as datetime;#value // Dates have dashes instead of slashes: ows_Created="2009-08-25 14:24:48" colValue = dateToJsonObject(v); break; @@ -3467,13 +3559,13 @@ if (s.length === 0) { return null; } else { - var thisUser = s.split(";#"); - var thisUserExpanded = thisUser[1].split(",#"); - if(thisUserExpanded.length == 1) { - return {userId: thisUser[0], userName: thisUser[1]}; + var thisUser = new SplitIndex(s); + var thisUserExpanded = thisUser.value.split(",#"); + if(thisUserExpanded.length === 1) { + return {userId: thisUser.Id, userName: thisUser.value}; } else { return { - userId: thisUser[0], + userId: thisUser.Id, userName: thisUserExpanded[0].replace( /(,,)/g, ","), loginName: thisUserExpanded[1].replace( /(,,)/g, ","), email: thisUserExpanded[2].replace( /(,,)/g, ","), @@ -3500,8 +3592,8 @@ if(s.length === 0) { return null; } else { - var thisLookup = s.split(";#"); - return {lookupId: thisLookup[0], lookupValue: thisLookup[1]}; + var thisLookup = new SplitIndex(s); + return {lookupId: thisLookup.id, lookupValue: thisLookup.value}; } } function lookupMultiToJsonObject(s) { @@ -3547,7 +3639,8 @@ // contents - The element which contains the current value // currentValue - The current value if it is set // checkNames - The Check Names image (in case you'd like to click it at some point) - $.fn.SPFindPeoplePicker = function(options) { + + $.fn.SPServices.SPFindPeoplePicker = function(options) { var opt = $.extend({}, { peoplePickerDisplayName: "", // The displayName of the People Picker on the form @@ -3586,9 +3679,9 @@ var dictionaryEntry = {}; // Entity data is only available in IE - if(thisData != undefined) { + if(typeof thisData !== "undefined") { var arrayOfDictionaryEntry = $.parseXML(thisData); - $xml = $(arrayOfDictionaryEntry); + var $xml = $(arrayOfDictionaryEntry); $xml.find("DictionaryEntry").each(function() { var key = $(this).find("Key").text(); @@ -3603,7 +3696,7 @@ async: false, cacheXML: true, userLoginName: $(this).attr("title"), - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).find("User").each(function() { @@ -3620,7 +3713,50 @@ }); return {row: thisRow, contents: thisContents, currentValue: thisCurrentValue, checkNames: thisCheckNames, dictionaryEntries: dictionaryEntries}; - }; + + }; // End $.fn.SPServices.SPFindPeoplePicker + + // Mistakenly released previously outside the SPServices namespace. This takes care of offering both. + $.fn.SPFindPeoplePicker = function(options) { + return $().SPServices.SPFindPeoplePicker(options); + }; // End $.fn.SPFindPeoplePicker + + + + // Find a People Picker in the page + // Returns references to: + // row - The TR which contains the People Picker (useful if you'd like to hide it at some point) + // contents - The element which contains the current value + // currentValue - The current value if it is set + // checkNames - The Check Names image (in case you'd like to click it at some point) + $.fn.SPServices.SPFindMMSPicker = function(options) { + + var opt = $.extend({}, { + MMSDisplayName: "" // The displayName of the MMS Picker on the form + }, options); + + var thisTerms = []; + + // Find the div for the column which contains the entered data values + var thisDiv = $("div[title='" + opt.MMSDisplayName + "']"); + var thisHiddenInput = thisDiv.closest("td").find("input[type='hidden']"); + var thisTermArray = thisHiddenInput.val().split(";"); + + for(var i=0; i < thisTermArray.length; i++) { + var thisOne = thisTermArray[i].split("|"); + thisTerms.push({ + value: thisOne[0], + guid: thisOne[1] + }); + + } + + return { + terms: thisTerms + }; + + }; // End $.fn.SPServices.SPFindMMSPicker + // Return the current version of SPServices as a string $.fn.SPServices.Version = function () { @@ -3630,9 +3766,27 @@ }; // End $.fn.SPServices.Version - ////// PRIVATE FUNCTIONS //////// + // Get the current context (as much as we can) on startup + // See: http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html + function SPServicesContext() { + + // SharePoint 2010 gives us a context variable + if(typeof _spPageContextInfo !== "undefined") { + this.thisSite = _spPageContextInfo.webServerRelativeUrl; + this.thisList = _spPageContextInfo.pageListId; + this.thisUserId = _spPageContextInfo.userId; + // In SharePoint 2007, we know the site and UserId + } else { + this.thisSite = (typeof L_Menu_BaseUrl !== "undefined") ? L_Menu_BaseUrl : ""; + this.thisList = ""; + this.thisUserId = (typeof _spUserId !== "undefined") ? _spUserId : undefined; + } + + } // End of function SPServicesContext + + // Display a column (field) formatted correctly based on its definition in the list. // NOTE: Currently not dealing with locale differences. // columnXML The XML node for the column from a GetList operation @@ -3640,7 +3794,7 @@ // opt The current set of options function showColumn(listXML, columnXML, columnValue, opt) { - if(typeof columnValue === 'undefined') { + if(typeof columnValue === "undefined") { return ""; } @@ -3689,13 +3843,13 @@ break; case "Number": numDecimals = columnXML.attr("Decimals"); - outString = numDecimals === undefined ? + outString = typeof numDecimals === "undefined" ? parseFloat(columnValue).toString() : parseFloat(columnValue).toFixed(numDecimals).toString(); break; case "Currency": numDecimals = columnXML.attr("Decimals"); - outString = numDecimals === undefined ? + outString = typeof numDecimals === "undefined" ? parseFloat(columnValue).toFixed(2).toString() : parseFloat(columnValue).toFixed(numDecimals).toString(); break; @@ -3757,10 +3911,11 @@ return outString; } // End of function showColumn + // Show a single attribute of a node, enclosed in a table // node The XML node // opt The current set of options - function showAttrs(node, opt) { + function showAttrs(node) { var i; var out = "
    " + relatedColumnsXML[i].attr("DisplayName") + "" + showColumn(relatedListXML, relatedColumnsXML[i], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "" + relatedColumnsXML[opt.relatedColumns[i]].attr("DisplayName") + "" + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "
    " + opt.node.nodeName + "" + ((opt.node.nodeValue !== null) ? checkLink(opt.node.nodeValue) : " ") + "
    " + showAttrs(opt.node, opt) + "
    " + showAttrs(opt.node) + "
    " + opt.node.nodeName + "
    " + showAttrs(opt.node, opt) + "
    " + showAttrs(opt.node) + "
    "; @@ -2222,20 +2277,22 @@ $.fn.SPServices.SPGetCurrentUser = function(options) { var opt = $.extend({}, { - fieldName: "Name", // Specifies which field to return from the userdisp.aspx page - fieldNames: {}, // Specifies which fields to return from the userdisp.aspx page - added in v0.7.2 to allow multiple columns - debug: false // If true, show error messages; if false, run silent + webURL: "", // URL of the target Site Collection. If not specified, the current Web is used. + fieldName: "Name", // Specifies which field to return from the userdisp.aspx page + fieldNames: {}, // Specifies which fields to return from the userdisp.aspx page - added in v0.7.2 to allow multiple columns + debug: false // If true, show error messages; if false, run silent }, options); // The current user's ID is reliably available in an existing JavaScript variable - if(opt.fieldName === "ID" && _spUserId != undefined) { - return _spUserId; + if(opt.fieldName === "ID" && typeof SPServicesContext.thisUserId !== "undefined") { + return SPServicesContext.thisUserId; } var thisField = ""; var theseFields = {}; var fieldCount = opt.fieldNames.length > 0 ? opt.fieldNames.length : 1; var thisUserDisp; + var thisWeb = opt.webURL.length > 0 ? opt.webURL : $().SPServices.SPGetCurrentSite(); // Get the UserDisp.aspx page using AJAX $.ajax({ @@ -2243,8 +2300,8 @@ async: false, // Force parameter forces redirection to a page that displays the information as stored in the UserInfo table rather than My Site. // Adding the extra Query String parameter with the current date/time forces the server to view this as a new request. - url: $().SPServices.SPGetCurrentSite() + "/_layouts/userdisp.aspx?Force=True&" + new Date().getTime(), - complete: function (xData, Status) { + url: thisWeb + "/_layouts/userdisp.aspx?Force=True&" + new Date().getTime(), + complete: function (xData) { thisUserDisp = xData; } }); @@ -2253,7 +2310,7 @@ // The current user's ID is reliably available in an existing JavaScript variable if(opt.fieldNames[i] === "ID") { - thisField = _spUserId; + thisField = SPServicesContext.thisUserId; } else { var thisTextValue; if(fieldCount > 1) { @@ -2285,7 +2342,7 @@ }); } if(opt.fieldNames[i] !== "ID") { - thisField = (thisField !== undefined) ? thisField.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '') : null; + thisField = (typeof thisField !== "undefined") ? thisField.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '') : null; } if(fieldCount > 1) { theseFields[opt.fieldNames[i]] = thisField; @@ -2327,7 +2384,7 @@ async: false, cacheXML: true, listName: $().SPServices.SPListNameFromUrl(), - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("Field[DisplayName='" + opt.lookupColumn + "']").each(function() { lookupColumnStaticName = $(this).attr("StaticName"); // Use GetList for the Lookup column's list to determine the list's URL @@ -2336,7 +2393,7 @@ async: false, cacheXML: true, listName: $(this).attr("List"), - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("List").each(function() { lookupListUrl = $(this).attr("WebFullUrl"); // Need to handle when list is in the root site @@ -2363,7 +2420,7 @@ newHref += opt.newWindow ? ((opt.ContentTypeID.length > 0) ? "?ContentTypeID=" + opt.ContentTypeID : "") + "' target='_blank'" : "?" + ((opt.ContentTypeID.length > 0) ? "ContentTypeID=" + opt.ContentTypeID + "&" : "") + "Source=" + escapeUrl(location.href) + "'"; - newLink = "
    " + "" + "", CAMLRowLimit: 1, CAMLQueryOptions: "", - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).SPFilterNode("z:row").each(function() { lastId = $(this).attr("ows_ID"); }); @@ -2449,7 +2506,7 @@ // Get the current item's ID from the Query String var queryStringVals = $().SPServices.SPGetQueryString(); var thisID = queryStringVals.ID; - var thisList = $().SPServices.SPListNameFromUrl(); + SPServicesContext.thisList = $().SPServices.SPListNameFromUrl(); // Set the messages based on the options provided var msg = "{1}
    "; @@ -2457,7 +2514,7 @@ // We need the DisplayName var columnDisplayName = $().SPServices.SPGetDisplayFromStatic({ - listName: thisList, + listName: SPServicesContext.thisList, columnStaticName: opt.columnStaticName }); var columnObj = $("input[Title='" + columnDisplayName + "']"); @@ -2473,14 +2530,14 @@ $().SPServices({ operation: "GetListItems", async: false, - listName: thisList, + listName: SPServicesContext.thisList, // Make sure we get all the items, ignoring any filters on the default view. CAMLQuery: "", // Filter based on columnStaticName's value CAMLViewFields: "", // Override the default view rowlimit and get all appropriate rows CAMLRowLimit: 0, - completefunc: function(xData, Status) { + completefunc: function(xData) { var testValue = opt.ignoreCase ? columnValue.toUpperCase() : columnValue; $(xData.responseXML).SPFilterNode("z:row").each(function() { var thisValue = opt.ignoreCase ? $(this).attr("ows_" + opt.columnStaticName).toUpperCase() : $(this).attr("ows_" + opt.columnStaticName); @@ -2538,7 +2595,7 @@ cacheXML: true, webURL: opt.webURL, listName: opt.listName, - completefunc: function(xData, Status) { + completefunc: function(xData) { if(nameCount > 1) { for(i=0; i < nameCount; i++) { displayNames[opt.columnStaticNames[i]] = $(xData.responseXML).find("Field[StaticName='" + opt.columnStaticNames[i] + "']").attr("DisplayName"); @@ -2573,7 +2630,7 @@ cacheXML: true, webURL: opt.webURL, listName: opt.listName, - completefunc: function(xData, Status) { + completefunc: function(xData) { if(nameCount > 1) { for(i=0; i < nameCount; i++) { staticNames[opt.columnDisplayNames[i]] = $(xData.responseXML).find("Field[DisplayName='" + opt.columnDisplayNames[i] + "']").attr("StaticName"); @@ -2598,7 +2655,7 @@ // parameter name than ID. Specify that name here, if needed. }, options); - var thisList = $().SPServices.SPListNameFromUrl(); + SPServicesContext.thisList = $().SPServices.SPListNameFromUrl(); var queryStringVals = $().SPServices.SPGetQueryString(); var lastID = queryStringVals.ID; var QSList = queryStringVals.List; @@ -2607,9 +2664,9 @@ // On first load, change the form actions to redirect back to this page with the current lastID for this user and the // original Source. - if(typeof queryStringVals.ID === 'undefined') { + if(typeof queryStringVals.ID === "undefined") { lastID = $().SPServices.SPGetLastItemId({ - listName: thisList + listName: SPServicesContext.thisList }); $("form[name='aspnetForm']").each(function() { // This page... @@ -2619,13 +2676,13 @@ "Source=" + queryStringVals.Source.replace(/\//g, "%2f").replace(/:/g, "%3a") : ""; var newQS = []; - if(typeof QSList !== 'undefined') { + if(typeof QSList !== "undefined") { newQS.push("List=" + QSList); } - if(typeof QSRootFolder !== 'undefined') { + if(typeof QSRootFolder !== "undefined") { newQS.push("RootFolder=" + QSRootFolder); } - if(typeof QSContentTypeId !== 'undefined') { + if(typeof QSContentTypeId !== "undefined") { newQS.push("ContentTypeId=" + QSContentTypeId); } @@ -2645,13 +2702,15 @@ } else { while(queryStringVals.ID === lastID) { lastID = $().SPServices.SPGetLastItemId({ - listName: thisList + listName: SPServicesContext.thisList }); } // If there is a RedirectURL parameter on the Query String, then redirect there instead of the value // specified in the options (opt.redirectUrl) var thisRedirectUrl = (typeof queryStringVals.RedirectURL === "string") ? queryStringVals.RedirectURL : opt.redirectUrl; - location.href = thisRedirectUrl + "?" + opt.qsParamName + "=" + lastID + + location.href = thisRedirectUrl + + (thisRedirectUrl.indexOf("?") > 0) ? "&" : "?" + + opt.qsParamName + "=" + lastID + ((typeof queryStringVals.RealSource === "string") ? ("&Source=" + queryStringVals.RealSource) : ""); } }; // End $.fn.SPServices.SPRedirectWithID @@ -2680,27 +2739,22 @@ // Create a temporary clone of the select to use to determine the appropriate width settings. // We'll append it to the end of the enclosing span. var cloneId = genContainerId("SPSetMultiSelectSizes", opt.multiSelectColumn); - possibleValues.clone().appendTo(possibleValues.closest("span")).css({ + var enclosingSpan = possibleValues.closest("span"); + enclosingSpan.append(""); + var cloneObj = enclosingSpan.find("> select"); + cloneObj.css({ "width": "auto", // We want the clone to resize its width based on the contents "height": 0, // Just to keep the page clean while we are using the clone "visibility": "hidden" // And let's keep it hidden - }).attr({ - id: cloneId, // We don't want the clone to have the same id as its source - length: 0 // And let's start with no options - }); - var cloneObj = $("#" + cloneId); + }) // Add all the values to the cloned select. First the left (possible values) select... - possibleValues.find("option").each(function() { - cloneObj.append(""); - }); + cloneObj.append(possibleValues.find("option").clone()); // ...then the right (selected values) select (in case some values have already been selected) - selectedValues.find("option").each(function() { - cloneObj.append(""); - }); + cloneObj.append(selectedValues.find("option").clone()); // We'll add 5px for a little padding on the right. - var divWidth = $("#" + cloneId).width() + 5; + var divWidth = cloneObj.width() + 5; var newDivWidth = divWidth; if(opt.minWidth > 0 || opt.maxWidth > 0) { if(divWidth < opt.minWidth) { @@ -2718,9 +2772,15 @@ // Set the new widths possibleValues.css("width", selectWidth + "px").parent().css("width", newDivWidth + "px"); selectedValues.css("width", selectWidth + "px").parent().css("width", newDivWidth + "px"); + // If the new widths are wide enough, remove the x scroll bar + if(opt.maxWidth === 0 || opt.maxWidth > newDivWidth) { + possibleValues.parent().css("overflow-x", "hidden"); + selectedValues.parent().css("overflow-x", "hidden"); + } // Remove the select's clone, since we're done with it - $("#" + cloneId).remove(); + cloneObj.remove(); + }; // End $.fn.SPServices.SPSetMultiSelectSizes // Does an audit of a site's list forms to show where script is in use. @@ -2764,7 +2824,7 @@ operation: "GetListCollection", webURL: opt.webURL, async: false, // Need this to be synchronous so we're assured of a valid value - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("List").each(function() { listXml = $(this); @@ -2781,7 +2841,7 @@ webURL: opt.webURL, listName: listXml.attr("ID"), async: false, // Need this to be synchronous so we're assured of a valid value - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("ContentType").each(function() { // Don't deal with folders if($(this).attr("ID").substring(0,6) !== "0x0120") { @@ -2818,7 +2878,7 @@ webURL: opt.webURL, listName: listXml.attr("ID"), async: false, // Need this to be synchronous so we're assured of a valid value - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("View").each(function() { SPScriptAuditPage(opt, listXml, "View", $(this).attr("DisplayName"), $(this).attr("Url")); }); @@ -2852,7 +2912,7 @@ cacheXML: true, webURL: opt.webURL, listName: listsArray[i], - completefunc: function (xData, Status) { + completefunc: function (xData) { $(xData.responseXML).find("List").each(function() { listXml = $(this); }); @@ -2867,10 +2927,11 @@ CAMLQuery: "Folder", CAMLViewFields: "", CAMLRowLimit: 0, - completefunc: function(xData, Status) { + completefunc: function(xData) { $(xData.responseXML).SPFilterNode("z:row").each(function() { var thisPageUrl = $(this).attr("ows_FileRef").split(";#")[1]; - var thisPageType = (typeof $(this).attr("ows_Title") !== 'undefined') ? $(this).attr("ows_Title") : ""; + var thisTitle = $(this).attr("ows_Title"); + var thisPageType = (typeof thisTitle !== "undefined") ? thisTitle : ""; if(thisPageUrl.indexOf(".aspx") > 0) { SPScriptAuditPage(opt, listXml, "Page", thisPageType, SLASH + thisPageUrl); } @@ -2902,6 +2963,8 @@ async: false, success: function(xData) { + var scriptMatch; + while (scriptMatch = scriptRegex.exec(xData)) { var scriptLanguage = getScriptAttribute(scriptMatch, "language"); var scriptType = getScriptAttribute(scriptMatch, "type"); @@ -2939,6 +3002,7 @@ } // End of function SPScriptAuditPage function getScriptAttribute(source, attribute) { + var matches; var regex = RegExp(attribute + "=(\"([^\"]*)\")|('([^']*)')", "gi"); if(matches = regex.exec(source)) { return matches[2]; @@ -2962,7 +3026,7 @@ $.fn.SPServices.SPArrangeChoices = function (options) { var opt = $.extend({}, { - listName: "", // The list name for the current form + listName: $().SPServices.SPListNameFromUrl(), // The list name for the current form columnName: "", // The display name of the column in the form perRow: 99, // Maximum number of choices desired per row. randomize: false // If true, randomize the order of the options @@ -2973,69 +3037,69 @@ var out; // Get information about columnName from the list to determine if we're allowing fill-in choices - $().SPServices({ + var thisGetList = $().SPServices({ operation: "GetList", async: false, cacheXML: true, - listName: (opt.listName.length > 0) ? opt.listName : $().SPServices.SPListNameFromUrl(), - completefunc: function(xData, Status) { - $(xData.responseXML).find("Fields").each(function() { - $(this).find("Field[DisplayName='" + opt.columnName + "']").each(function() { - // Determine whether columnName allows a fill-in choice - columnFillInChoice = ($(this).attr("FillInChoice") === "TRUE") ? true : false; - // Stop looking;we're done - return false; - }); - }); - } + listName: opt.listName }); - var thisFormField = findFormField(opt.columnName); + // When the promise is available... + thisGetList.done(function() { + + // Figure out if we need to handle fill in choices + columnFillInChoice = ($(thisGetList.responseXML).find("Field[DisplayName='" + opt.columnName + "']").attr("FillInChoice") === "TRUE") ? true : false; + + // Find the column in the form + var thisFormField = findFormField(opt.columnName); - var totalChoices = $(thisFormField).find("tr").length; - var choiceNumber = 0; - var fillinPrompt; - var fillinInput; - // Collect all of the choices - $(thisFormField).find("tr").each(function() { - choiceNumber++; - // If this is the fill-in prompt, save it... - if(columnFillInChoice && choiceNumber === (totalChoices - 1)) { - fillinPrompt = $(this).find("td").html(); - // ...or if it is the fill-in input box, save it... - } else if(columnFillInChoice && choiceNumber === totalChoices) { - fillinInput = $(this).find("td").html(); - // ...else push into the columnOptions array. - } else { - columnOptions.push($(this).html()); + var totalChoices = $(thisFormField).find("tr").length; + var choiceNumber = 0; + var fillinPrompt; + var fillinInput; + + // Collect all of the choices + $(thisFormField).find("tr").each(function(i) { + choiceNumber++; + // If this is the fill-in prompt, save it... + if(columnFillInChoice && choiceNumber === (totalChoices - 1)) { + fillinPrompt = $(this).find("td").html(); + // ...or if it is the fill-in input box, save it... + } else if(columnFillInChoice && choiceNumber === totalChoices) { + fillinInput = $(this).find("td").html(); + // ...else push into the columnOptions array. + } else { + columnOptions.push($(this).html()); + } + }); + + // If randomize is true, randomly sort the options + if(opt.randomize) { + columnOptions.sort(randOrd); } - }); - out = "
    " + fillinPrompt + fillinInput + "
    " + fillinPrompt + fillinInput + "
    "; for (i=0; i < node.attributes.length; i++) { @@ -3771,6 +3926,7 @@ return out; } // End of function showAttrs + // Find a dropdown (or multi-select) in the DOM. Returns the dropdown onject and its type: // S = Simple (select);C = Compound (input + select hybrid);M = Multi-select (select hybrid) function DropdownCtl(colName) { @@ -3797,6 +3953,26 @@ } } // End of function DropdownCtl + + + // Find the MultiLookupPickerdata input element. The structures are slightly different in 2013 vs. prior versions. + function MultiLookupPicker(o) { + + // Find input element that contains 'MultiLookup' and ends with 'data'. This holds all available values. + this.MultiLookupPickerdata = o.closest("span").find("input[id*='MultiLookup'][id$='data']"); + + // The ids in 2013 are different than prior versions, so we need to parse them out. + var thisMultiLookupPickerdataId = this.MultiLookupPickerdata.attr("id"); + var thisIdEndLoc = thisMultiLookupPickerdataId.indexOf("Multi"); + var thisIdEnd = thisMultiLookupPickerdataId.substr(thisIdEndLoc); + var thisMasterId = thisMultiLookupPickerdataId.substr(0, thisIdEndLoc) + thisIdEnd.substr(0, thisIdEnd.indexOf("_") + 1) + "m"; + + this.master = window[thisMasterId]; + + } // End of function MultiLookupPicker + + + // Returns the selected value(s) for a dropdown in an array. Expects a dropdown object as returned by the DropdownCtl function. // If matchOnId is true, returns the ids rather than the text values for the selection options(s). function getDropdownSelected(columnSelect, matchOnId) { @@ -3866,14 +4042,13 @@ // Get the URL for a specified form for a list function getListFormUrl(l, f) { - var thisForm, u; - + var u; $().SPServices({ operation: "GetFormCollection", async: false, listName: l, - completefunc: function (xData, Status) { - u = $(xData.responseXML).find("Form[Type='" + f + "']").attr("Url");; + completefunc: function (xData) { + u = $(xData.responseXML).find("Form[Type='" + f + "']").attr("Url"); } }); return u; @@ -3904,10 +4079,10 @@ } // End of function addToPayload // Finds the td which contains a form field in default forms using the comment which contains: - // + // // as the "anchor" to find it. Necessary because SharePoint doesn't give all field types ids or specific classes. function findFormField(columnName) { var thisFormBody; @@ -3924,7 +4099,7 @@ }); return thisFormBody; } // End of function findFormField - + // The SiteData operations have the same names as other Web Service operations. To make them easy to call and unique, I'm using // the SiteData prefix on their names. This function replaces that name with the right name in the SOAPEnvelope. function siteDataFixSOAPEnvelope(SOAPEnvelope, siteDataOperation) { @@ -3936,7 +4111,7 @@ // Wrap an XML node (n) around a value (v) function wrapNode(n, v) { - var thisValue = v !== undefined ? v : ""; + var thisValue = typeof v !== "undefined" ? v : ""; return "<" + n + ">" + thisValue + ""; } @@ -3955,10 +4130,30 @@ return s.substring(s.lastIndexOf(SLASH)+1,s.length); } - // Escape string characters - function escapeHTML(s) { - return s.replace(/&/g,'&').replace(/"/g,'"').replace(//g,'>'); +/* Taken from http://dracoblue.net/dev/encodedecode-special-xml-characters-in-javascript/155/ */ + var xml_special_to_escaped_one_map = { + '&': '&', + '"': '"', + '<': '<', + '>': '>'}; + var escaped_one_to_xml_special_map = { + '&': '&', + '"': '"', + '<': '<', + '>': '>'}; + + function encodeXml(string) { + return string.replace(/([\&"<>])/g, function(str, item) { + return xml_special_to_escaped_one_map[item]; + }); + } + function decodeXml(string) { + return string.replace(/("|<|>|&)/g, + function(str, item) { + return escaped_one_to_xml_special_map[item]; + }); } +/* Taken from http://dracoblue.net/dev/encodedecode-special-xml-characters-in-javascript/155/ */ // Escape column values function escapeColumnValue(s) { @@ -3974,4 +4169,15 @@ return u.replace(/&/g,'%26'); } + // Split values like 1;#value into id and value + function SplitIndex(s) { + var spl = s.split(";#"); + this.id = spl[0]; + this.value = spl[1]; + } + + function pad(n) { + return n < 10 ? "0" + n : n; + } + })(jQuery); \ No newline at end of file diff --git a/jquery.SPServices-2013.01.min.js b/jquery.SPServices-2013.01.min.js new file mode 100644 index 0000000..69025ad --- /dev/null +++ b/jquery.SPServices-2013.01.min.js @@ -0,0 +1,21 @@ +/* + * SPServices - Work with SharePoint's Web Services using jQuery + * Version 2013.01 + * @requires jQuery v1.5 or greater - jQuery 1.7+ recommended + * + * Copyright (c) 2009-2013 Sympraxis Consulting LLC + * Examples and docs at: + * http://spservices.codeplex.com + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + */ +/* + * @description Work with SharePoint's Web Services using jQuery + * @type jQuery + * @name SPServices + * @category Plugins/SPServices + * @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com + */ +/* jshint undef: true */ +/* global _spUserId, _spPageContextInfo, GipAddSelectedItems, GipRemoveSelectedItems, GipGetGroupData */ +(function(ak){var aa="2013.01";var Q="/";var ah="Column not found on page";var ac="http://schemas.microsoft.com/sharepoint";var B={};var b="Alerts";var u="Authentication";var am="Copy";var G="Forms";var ar="Lists";var l="Meetings";var C="People";var f="Permissions";var g="PublishedLinksService";var ai="Search";var A="SPSearch";var ag="SharePointDiagnostics";var Z="SiteData";var aA="Sites";var J="SocialDataService";var ae="SpellCheck";var n="TaxonomyClientService";var k="usergroup";var K="UserProfileService";var E="Versions";var ay="Views";var e="WebPartPages";var av="Webs";var F="Workflow";var ao=new ao();var O=0;var x=["listName","description"];var U=[];U.GetAlerts=[b,false];U.DeleteAlerts=[b,true];U.Mode=[u,false];U.Login=[u,false];U.CopyIntoItems=[am,true];U.CopyIntoItemsLocal=[am,true];U.GetItem=[am,false];U.GetForm=[G,false];U.GetFormCollection=[G,false];U.AddAttachment=[ar,true];U.AddDiscussionBoardItem=[ar,true];U.AddList=[ar,true];U.AddListFromFeature=[ar,true];U.ApplyContentTypeToList=[ar,true];U.CheckInFile=[ar,true];U.CheckOutFile=[ar,true];U.CreateContentType=[ar,true];U.DeleteAttachment=[ar,true];U.DeleteContentType=[ar,true];U.DeleteContentTypeXmlDocument=[ar,true];U.DeleteList=[ar,true];U.GetAttachmentCollection=[ar,false];U.GetList=[ar,false];U.GetListAndView=[ar,false];U.GetListCollection=[ar,false];U.GetListContentType=[ar,false];U.GetListContentTypes=[ar,false];U.GetListItemChanges=[ar,false];U.GetListItemChangesSinceToken=[ar,false];U.GetListItems=[ar,false];U.GetVersionCollection=[ar,false];U.UndoCheckOut=[ar,true];U.UpdateContentType=[ar,true];U.UpdateContentTypesXmlDocument=[ar,true];U.UpdateContentTypeXmlDocument=[ar,true];U.UpdateList=[ar,true];U.UpdateListItems=[ar,true];U.AddMeeting=[l,true];U.CreateWorkspace=[l,true];U.RemoveMeeting=[l,true];U.SetWorkSpaceTitle=[l,true];U.ResolvePrincipals=[C,false];U.SearchPrincipals=[C,false];U.AddPermission=[f,true];U.AddPermissionCollection=[f,true];U.GetPermissionCollection=[f,true];U.RemovePermission=[f,true];U.RemovePermissionCollection=[f,true];U.UpdatePermission=[f,true];U.GetLinks=[g,true];U.GetPortalSearchInfo=[ai,false];U.GetQuerySuggestions=[ai,false];U.GetSearchMetadata=[ai,false];U.Query=[ai,false];U.QueryEx=[ai,false];U.Registration=[ai,false];U.Status=[ai,false];U.SPQuery=[A,false];U.SPQueryEx=[A,false];U.SPRegistration=[A,false];U.SPStatus=[A,false];U.SendClientScriptErrorReport=[ag,true];U.GetAttachments=[Z,false];U.EnumerateFolder=[Z,false];U.SiteDataGetList=[Z,false];U.SiteDataGetListCollection=[Z,false];U.SiteDataGetSite=[Z,false];U.SiteDataGetSiteUrl=[Z,false];U.SiteDataGetWeb=[Z,false];U.CreateWeb=[aA,true];U.DeleteWeb=[aA,false];U.GetSite=[aA,false];U.GetSiteTemplates=[aA,false];U.AddComment=[J,true];U.AddTag=[J,true];U.AddTagByKeyword=[J,true];U.CountCommentsOfUser=[J,false];U.CountCommentsOfUserOnUrl=[J,false];U.CountCommentsOnUrl=[J,false];U.CountRatingsOnUrl=[J,false];U.CountTagsOfUser=[J,false];U.DeleteComment=[J,true];U.DeleteRating=[J,true];U.DeleteTag=[J,true];U.DeleteTagByKeyword=[J,true];U.DeleteTags=[J,true];U.GetAllTagTerms=[J,false];U.GetAllTagTermsForUrlFolder=[J,false];U.GetAllTagUrls=[J,false];U.GetAllTagUrlsByKeyword=[J,false];U.GetCommentsOfUser=[J,false];U.GetCommentsOfUserOnUrl=[J,false];U.GetCommentsOnUrl=[J,false];U.GetRatingAverageOnUrl=[J,false];U.GetRatingOfUserOnUrl=[J,false];U.GetRatingOnUrl=[J,false];U.GetRatingsOfUser=[J,false];U.GetRatingsOnUrl=[J,false];U.GetSocialDataForFullReplication=[J,false];U.GetTags=[J,true];U.GetTagsOfUser=[J,true];U.GetTagTerms=[J,true];U.GetTagTermsOfUser=[J,true];U.GetTagTermsOnUrl=[J,true];U.GetTagUrlsOfUser=[J,true];U.GetTagUrlsOfUserByKeyword=[J,true];U.GetTagUrls=[J,true];U.GetTagUrlsByKeyword=[J,true];U.SetRating=[J,true];U.UpdateComment=[J,true];U.SpellCheck=[ae,false];U.AddTerms=[n,true];U.GetChildTermsInTerm=[n,false];U.GetChildTermsInTermSet=[n,false];U.GetKeywordTermsByGuids=[n,false];U.GetTermsByLabel=[n,false];U.GetTermSets=[n,false];U.AddGroup=[k,true];U.AddGroupToRole=[k,true];U.AddRole=[k,true];U.AddRoleDef=[k,true];U.AddUserCollectionToGroup=[k,true];U.AddUserCollectionToRole=[k,true];U.AddUserToGroup=[k,true];U.AddUserToRole=[k,true];U.GetAllUserCollectionFromWeb=[k,false];U.GetGroupCollection=[k,false];U.GetGroupCollectionFromRole=[k,false];U.GetGroupCollectionFromSite=[k,false];U.GetGroupCollectionFromUser=[k,false];U.GetGroupCollectionFromWeb=[k,false];U.GetGroupInfo=[k,false];U.GetRoleCollection=[k,false];U.GetRoleCollectionFromGroup=[k,false];U.GetRoleCollectionFromUser=[k,false];U.GetRoleCollectionFromWeb=[k,false];U.GetRoleInfo=[k,false];U.GetRolesAndPermissionsForCurrentUser=[k,false];U.GetRolesAndPermissionsForSite=[k,false];U.GetUserCollection=[k,false];U.GetUserCollectionFromGroup=[k,false];U.GetUserCollectionFromRole=[k,false];U.GetUserCollectionFromSite=[k,false];U.GetUserCollectionFromWeb=[k,false];U.GetUserInfo=[k,false];U.GetUserLoginFromEmail=[k,false];U.RemoveGroup=[k,true];U.RemoveGroupFromRole=[k,true];U.RemoveRole=[k,true];U.RemoveUserCollectionFromGroup=[k,true];U.RemoveUserCollectionFromRole=[k,true];U.RemoveUserCollectionFromSite=[k,true];U.RemoveUserFromGroup=[k,true];U.RemoveUserFromRole=[k,true];U.RemoveUserFromSite=[k,true];U.RemoveUserFromWeb=[k,true];U.UpdateGroupInfo=[k,true];U.UpdateRoleDefInfo=[k,true];U.UpdateRoleInfo=[k,true];U.UpdateUserInfo=[k,true];U.AddColleague=[K,true];U.AddLink=[K,true];U.AddMembership=[K,true];U.AddPinnedLink=[K,true];U.CreateMemberGroup=[K,true];U.CreateUserProfileByAccountName=[K,true];U.GetCommonColleagues=[K,false];U.GetCommonManager=[K,false];U.GetCommonMemberships=[K,false];U.GetInCommon=[K,false];U.GetPropertyChoiceList=[K,false];U.GetUserColleagues=[K,false];U.GetUserLinks=[K,false];U.GetUserMemberships=[K,false];U.GetUserPinnedLinks=[K,false];U.GetUserProfileByGuid=[K,false];U.GetUserProfileByIndex=[K,false];U.GetUserProfileByName=[K,false];U.GetUserProfileCount=[K,false];U.GetUserProfileSchema=[K,false];U.ModifyUserPropertyByAccountName=[K,true];U.RemoveAllColleagues=[K,true];U.RemoveAllLinks=[K,true];U.RemoveAllMemberships=[K,true];U.RemoveAllPinnedLinks=[K,true];U.RemoveColleague=[K,true];U.RemoveLink=[K,true];U.RemoveMembership=[K,true];U.RemovePinnedLink=[K,true];U.UpdateColleaguePrivacy=[K,true];U.UpdateLink=[K,true];U.UpdateMembershipPrivacy=[K,true];U.UpdatePinnedLink=[K,true];U.DeleteAllVersions=[E,true];U.DeleteVersion=[E,true];U.GetVersions=[E,false];U.RestoreVersion=[E,true];U.AddView=[ay,true];U.DeleteView=[ay,true];U.GetView=[ay,false];U.GetViewHtml=[ay,false];U.GetViewCollection=[ay,false];U.UpdateView=[ay,true];U.UpdateViewHtml=[ay,true];U.AddWebPart=[e,true];U.AddWebPartToZone=[e,true];U.GetWebPart2=[e,false];U.GetWebPartPage=[e,false];U.GetWebPartProperties=[e,false];U.GetWebPartProperties2=[e,false];U.CreateContentType=[av,true];U.GetColumns=[av,false];U.GetContentType=[av,false];U.GetContentTypes=[av,false];U.GetCustomizedPageStatus=[av,false];U.GetListTemplates=[av,false];U.GetObjectIdFromUrl=[av,false];U.GetWeb=[av,false];U.GetWebCollection=[av,false];U.GetAllSubWebCollection=[av,false];U.UpdateColumns=[av,true];U.UpdateContentType=[av,true];U.WebUrlFromPageUrl=[av,false];U.AlterToDo=[F,true];U.GetTemplatesForItem=[F,false];U.GetToDosForItem=[F,false];U.GetWorkflowDataForItem=[F,false];U.GetWorkflowTaskData=[F,false];U.StartWorkflow=[F,true];var T={};T.header="";T.footer="";T.payload="";var ab;ak.fn.SPServices=function(aC){var aE=ak.extend({},ak.fn.SPServices.defaults,aC);for(var aD=0;aD";ab=ac+"/soap/2002/1/alerts/";break;case l:T.opheader+="xmlns='"+ac+"/soap/meetings/' >";ab=ac+"/soap/meetings/";break;case f:T.opheader+="xmlns='"+ac+"/soap/directory/' >";ab=ac+"/soap/directory/";break;case g:T.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/' >";ab="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/";break;case ai:T.opheader+="xmlns='urn:Microsoft.Search' >";ab="urn:Microsoft.Search/";break;case ag:T.opheader+="xmlns='"+ac+"/diagnostics/' >";ab="http://schemas.microsoft.com/sharepoint/diagnostics/";break;case J:T.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService' >";ab="http://microsoft.com/webservices/SharePointPortalServer/SocialDataService/";break;case ae:T.opheader+="xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/' >";ab="http://schemas.microsoft.com/sharepoint/publishing/spelling/SpellCheck";break;case n:T.opheader+="xmlns='"+ac+"/taxonomy/soap/' >";ab=ac+"/taxonomy/soap/";break;case k:T.opheader+="xmlns='"+ac+"/soap/directory/' >";ab=ac+"/soap/directory/";break;case K:T.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' >";ab="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/";break;case e:T.opheader+="xmlns='http://microsoft.com/sharepoint/webpartpages' >";ab="http://microsoft.com/sharepoint/webpartpages/";break;case F:T.opheader+="xmlns='"+ac+"/soap/workflow/' >";ab=ac+"/soap/workflow/";break;default:T.opheader+="xmlns='"+ac+"/soap/'>";ab=ac+"/soap/";break}ab+=aE.operation;T.opfooter="";var aG="_vti_bin/"+U[aE.operation][0]+".asmx";if(aE.webURL.charAt(aE.webURL.length-1)===Q){aG=aE.webURL+aG}else{if(aE.webURL.length>0){aG=aE.webURL+Q+aG}else{aG=ak().SPServices.SPGetCurrentSite()+Q+aG}}T.payload="";switch(aE.operation){case"GetAlerts":break;case"DeleteAlerts":T.payload+="";for(aD=0;aD";break;case"Mode":break;case"Login":ap(aE,["username","password"]);break;case"CopyIntoItems":ap(aE,["SourceUrl"]);T.payload+="";for(aD=0;aD";ap(aE,["Fields","Stream","Results"]);break;case"CopyIntoItemsLocal":ap(aE,["SourceUrl"]);T.payload+="";for(aD=0;aD";break;case"GetItem":ap(aE,["Url","Fields","Stream"]);break;case"GetForm":ap(aE,["listName","formUrl"]);break;case"GetFormCollection":ap(aE,["listName"]);break;case"AddAttachment":ap(aE,["listName","listItemID","fileName","attachment"]);break;case"AddDiscussionBoardItem":ap(aE,["listName","message"]);break;case"AddList":ap(aE,["listName","description","templateID"]);break;case"AddListFromFeature":ap(aE,["listName","description","featureID","templateID"]);break;case"ApplyContentTypeToList":ap(aE,["webUrl","contentTypeId","listName"]);break;case"CheckInFile":ap(aE,["pageUrl","comment","CheckinType"]);break;case"CheckOutFile":ap(aE,["pageUrl","checkoutToLocal","lastmodified"]);break;case"CreateContentType":ap(aE,["listName","displayName","parentType","fields","contentTypeProperties","addToView"]);break;case"DeleteAttachment":ap(aE,["listName","listItemID","url"]);break;case"DeleteContentType":ap(aE,["listName","contentTypeId"]);break;case"DeleteContentTypeXmlDocument":ap(aE,["listName","contentTypeId","documentUri"]);break;case"DeleteList":ap(aE,["listName"]);break;case"GetAttachmentCollection":ap(aE,["listName",["listItemID","ID"]]);break;case"GetList":ap(aE,["listName"]);break;case"GetListAndView":ap(aE,["listName","viewName"]);break;case"GetListCollection":break;case"GetListContentType":ap(aE,["listName","contentTypeId"]);break;case"GetListContentTypes":ap(aE,["listName"]);break;case"GetListItems":ap(aE,["listName","viewName",["query","CAMLQuery"],["viewFields","CAMLViewFields"],["rowLimit","CAMLRowLimit"],["queryOptions","CAMLQueryOptions"]]);break;case"GetListItemChanges":ap(aE,["listName","viewFields","since","contains"]);break;case"GetListItemChangesSinceToken":ap(aE,["listName","viewName","query","viewFields","rowLimit","queryOptions","changeToken","contains"]);break;case"GetVersionCollection":ap(aE,["strlistID","strlistItemID","strFieldName"]);break;case"UndoCheckOut":ap(aE,["pageUrl"]);break;case"UpdateContentType":ap(aE,["listName","contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields","addToView"]);break;case"UpdateContentTypesXmlDocument":ap(aE,["listName","newDocument"]);break;case"UpdateContentTypeXmlDocument":ap(aE,["listName","contentTypeId","newDocument"]);break;case"UpdateList":ap(aE,["listName","listProperties","newFields","updateFields","deleteFields","listVersion"]);break;case"UpdateListItems":ap(aE,["listName"]);if(typeof aE.updates!=="undefined"&&aE.updates.length>0){ap(aE,["updates"])}else{T.payload+="";for(aD=0;aD"+L(aE.valuepairs[aD][1])+""}if(aE.batchCmd!=="New"){T.payload+=""+aE.ID+""}T.payload+=""}break;case"AddMeeting":ap(aE,["organizerEmail","uid","sequence","utcDateStamp","title","location","utcDateStart","utcDateEnd","nonGregorian"]);break;case"CreateWorkspace":ap(aE,["title","templateName","lcid","timeZoneInformation"]);break;case"RemoveMeeting":ap(aE,["recurrenceId","uid","sequence","utcDateStamp","cancelMeeting"]);break;case"SetWorkspaceTitle":ap(aE,["title"]);break;case"ResolvePrincipals":ap(aE,["principalKeys","principalType","addToUserInfoList"]);break;case"SearchPrincipals":ap(aE,["searchText","maxResults","principalType"]);break;case"AddPermission":ap(aE,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"AddPermissionCollection":ap(aE,["objectName","objectType","permissionsInfoXml"]);break;case"GetPermissionCollection":ap(aE,["objectName","objectType"]);break;case"RemovePermission":ap(aE,["objectName","objectType","permissionIdentifier","permissionType"]);break;case"RemovePermissionCollection":ap(aE,["objectName","objectType","memberIdsXml"]);break;case"UpdatePermission":ap(aE,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"GetLinks":break;case"GetPortalSearchInfo":T.opheader="<"+aE.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ab="http://microsoft.com/webservices/OfficeServer/QueryService/"+aE.operation;break;case"GetQuerySuggestions":T.opheader="<"+aE.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ab="http://microsoft.com/webservices/OfficeServer/QueryService/"+aE.operation;T.payload+=au("queryXml",h(aE.queryXml));break;case"GetSearchMetadata":T.opheader="<"+aE.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ab="http://microsoft.com/webservices/OfficeServer/QueryService/"+aE.operation;break;case"Query":T.payload+=au("queryXml",h(aE.queryXml));break;case"QueryEx":T.opheader="<"+aE.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ab="http://microsoft.com/webservices/OfficeServer/QueryService/"+aE.operation;T.payload+=au("queryXml",h(aE.queryXml));break;case"Registration":T.payload+=au("registrationXml",h(aE.registrationXml));break;case"Status":break;case"SPQuery":T.payload+=au("queryXml",h(aE.queryXml));break;case"SPQueryEx":T.opheader="<"+aE.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";ab="http://microsoft.com/webservices/OfficeServer/QueryService/"+aE.operation;T.payload+=au("queryXml",h(aE.queryXml));break;case"SendClientScriptErrorReport":ap(aE,["message","file","line","client","stack","team","originalFile"]);break;case"EnumerateFolder":ap(aE,["strFolderUrl"]);break;case"GetAttachments":ap(aE,["strListName","strItemId"]);break;case"SiteDataGetList":ap(aE,["strListName"]);T=j(T,aE.operation);break;case"SiteDataGetListCollection":T=j(T,aE.operation);break;case"SiteDataGetSite":T=j(T,aE.operation);break;case"SiteDataGetSiteUrl":ap(aE,["Url"]);T=j(T,aE.operation);break;case"SiteDataGetWeb":T=j(T,aE.operation);break;case"CreateWeb":ap(aE,["url","title","description","templateName","language","languageSpecified","locale","localeSpecified","collationLocale","collationLocaleSpecified","uniquePermissions","uniquePermissionsSpecified","anonymous","anonymousSpecified","presence","presenceSpecified"]);break;case"DeleteWeb":ap(aE,["url"]);break;case"GetSite":ap(aE,["SiteUrl"]);break;case"GetSiteTemplates":ap(aE,["LCID","TemplateList"]);break;case"AddComment":ap(aE,["url","comment","isHighPriority","title"]);break;case"AddTag":ap(aE,["url","termID","title","isPrivate"]);break;case"AddTagByKeyword":ap(aE,["url","keyword","title","isPrivate"]);break;case"CountCommentsOfUser":ap(aE,["userAccountName"]);break;case"CountCommentsOfUserOnUrl":ap(aE,["userAccountName","url"]);break;case"CountCommentsOnUrl":ap(aE,["url"]);break;case"CountRatingsOnUrl":ap(aE,["url"]);break;case"CountTagsOfUser":ap(aE,["userAccountName"]);break;case"DeleteComment":ap(aE,["url","lastModifiedTime"]);break;case"DeleteRating":ap(aE,["url"]);break;case"DeleteTag":ap(aE,["url","termID"]);break;case"DeleteTagByKeyword":ap(aE,["url","keyword"]);break;case"DeleteTags":ap(aE,["url"]);break;case"GetAllTagTerms":ap(aE,["maximumItemsToReturn"]);break;case"GetAllTagTermsForUrlFolder":ap(aE,["urlFolder","maximumItemsToReturn"]);break;case"GetAllTagUrls":ap(aE,["termID"]);break;case"GetAllTagUrlsByKeyword":ap(aE,["keyword"]);break;case"GetCommentsOfUser":ap(aE,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetCommentsOfUserOnUrl":ap(aE,["userAccountName","url"]);break;case"GetCommentsOnUrl":ap(aE,["url","maximumItemsToReturn","startIndex"]);if(typeof aE.excludeItemsTime!=="undefined"&&aE.excludeItemsTime.length>0){T.payload+=au("excludeItemsTime",aE.excludeItemsTime)}break;case"GetRatingAverageOnUrl":ap(aE,["url"]);break;case"GetRatingOfUserOnUrl":ap(aE,["userAccountName","url"]);break;case"GetRatingOnUrl":ap(aE,["url"]);break;case"GetRatingsOfUser":ap(aE,["userAccountName"]);break;case"GetRatingsOnUrl":ap(aE,["url"]);break;case"GetSocialDataForFullReplication":ap(aE,["userAccountName"]);break;case"GetTags":ap(aE,["url"]);break;case"GetTagsOfUser":ap(aE,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetTagTerms":ap(aE,["maximumItemsToReturn"]);break;case"GetTagTermsOfUser":ap(aE,["userAccountName","maximumItemsToReturn"]);break;case"GetTagTermsOnUrl":ap(aE,["url","maximumItemsToReturn"]);break;case"GetTagUrls":ap(aE,["termID"]);break;case"GetTagUrlsByKeyword":ap(aE,["keyword"]);break;case"GetTagUrlsOfUser":ap(aE,["termID","userAccountName"]);break;case"GetTagUrlsOfUserByKeyword":ap(aE,["keyword","userAccountName"]);break;case"SetRating":ap(aE,["url","rating","title","analysisDataEntry"]);break;case"UpdateComment":ap(aE,["url","lastModifiedTime","comment","isHighPriority"]);break;case"SpellCheck":ap(aE,["chunksToSpell","declaredLanguage","useLad"]);break;case"AddTerms":ap(aE,["sharedServiceId","termSetId","lcid","newTerms"]);break;case"GetChildTermsInTerm":ap(aE,["sspId","lcid","termId","termSetId"]);break;case"GetChildTermsInTermSet":ap(aE,["sspId","lcid","termSetId"]);break;case"GetKeywordTermsByGuids":ap(aE,["termIds","lcid"]);break;case"GetTermsByLabel":ap(aE,["label","lcid","matchOption","resultCollectionSize","termIds","addIfNotFound"]);break;case"GetTermSets":ap(aE,["sharedServiceId","termSetId","lcid","clientTimeStamps","clientVersions"]);break;case"AddGroup":ap(aE,["groupName","ownerIdentifier","ownerType","defaultUserLoginName","description"]);break;case"AddGroupToRole":ap(aE,["groupName","roleName"]);break;case"AddRole":ap(aE,["roleName","description","permissionMask"]);break;case"AddRoleDef":ap(aE,["roleName","description","permissionMask"]);break;case"AddUserCollectionToGroup":ap(aE,["groupName","usersInfoXml"]);break;case"AddUserCollectionToRole":ap(aE,["roleName","usersInfoXml"]);break;case"AddUserToGroup":ap(aE,["groupName","userName","userLoginName","userEmail","userNotes"]);break;case"AddUserToRole":ap(aE,["roleName","userName","userLoginName","userEmail","userNotes"]);break;case"GetAllUserCollectionFromWeb":break;case"GetGroupCollection":ap(aE,["groupNamesXml"]);break;case"GetGroupCollectionFromRole":ap(aE,["roleName"]);break;case"GetGroupCollectionFromSite":break;case"GetGroupCollectionFromUser":ap(aE,["userLoginName"]);break;case"GetGroupCollectionFromWeb":break;case"GetGroupInfo":ap(aE,["groupName"]);break;case"GetRoleCollection":ap(aE,["roleNamesXml"]);break;case"GetRoleCollectionFromGroup":ap(aE,["groupName"]);break;case"GetRoleCollectionFromUser":ap(aE,["userLoginName"]);break;case"GetRoleCollectionFromWeb":break;case"GetRoleInfo":ap(aE,["roleName"]);break;case"GetRolesAndPermissionsForCurrentUser":break;case"GetRolesAndPermissionsForSite":break;case"GetUserCollection":ap(aE,["userLoginNamesXml"]);break;case"GetUserCollectionFromGroup":ap(aE,["groupName"]);break;case"GetUserCollectionFromRole":ap(aE,["roleName"]);break;case"GetUserCollectionFromSite":break;case"GetUserCollectionFromWeb":break;case"GetUserInfo":ap(aE,["userLoginName"]);break;case"GetUserLoginFromEmail":ap(aE,["emailXml"]);break;case"RemoveGroup":ap(aE,["groupName"]);break;case"RemoveGroupFromRole":ap(aE,["roleName","groupName"]);break;case"RemoveRole":ap(aE,["roleName"]);break;case"RemoveUserCollectionFromGroup":ap(aE,["groupName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromRole":ap(aE,["roleName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromSite":ap(aE,["userLoginNamesXml"]);break;case"RemoveUserFromGroup":ap(aE,["groupName","userLoginName"]);break;case"RemoveUserFromRole":ap(aE,["roleName","userLoginName"]);break;case"RemoveUserFromSite":ap(aE,["userLoginName"]);break;case"RemoveUserFromWeb":ap(aE,["userLoginName"]);break;case"UpdateGroupInfo":ap(aE,["oldGroupName","groupName","ownerIdentifier","ownerType","description"]);break;case"UpdateRoleDefInfo":ap(aE,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateRoleInfo":ap(aE,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateUserInfo":ap(aE,["userLoginName","userName","userEmail","userNotes"]);break;case"AddColleague":ap(aE,["accountName","colleagueAccountName","group","privacy","isInWorkGroup"]);break;case"AddLink":ap(aE,["accountName","name","url","group","privacy"]);break;case"AddMembership":ap(aE,["accountName","membershipInfo","group","privacy"]);break;case"AddPinnedLink":ap(aE,["accountName","name","url"]);break;case"CreateMemberGroup":ap(aE,["membershipInfo"]);break;case"CreateUserProfileByAccountName":ap(aE,["accountName"]);break;case"GetCommonColleagues":ap(aE,["accountName"]);break;case"GetCommonManager":ap(aE,["accountName"]);break;case"GetCommonMemberships":ap(aE,["accountName"]);break;case"GetInCommon":ap(aE,["accountName"]);break;case"GetPropertyChoiceList":ap(aE,["propertyName"]);break;case"GetUserColleagues":ap(aE,["accountName"]);break;case"GetUserLinks":ap(aE,["accountName"]);break;case"GetUserMemberships":ap(aE,["accountName"]);break;case"GetUserPinnedLinks":ap(aE,["accountName"]);break;case"GetUserProfileByGuid":ap(aE,["guid"]);break;case"GetUserProfileByIndex":ap(aE,["index"]);break;case"GetUserProfileByName":if(typeof aE.accountName!=="undefined"&&aE.accountName.length>0){ap(aE,[["AccountName","accountName"]])}else{ap(aE,["AccountName"])}break;case"GetUserProfileCount":break;case"GetUserProfileSchema":break;case"ModifyUserPropertyByAccountName":ap(aE,["accountName","newData"]);break;case"RemoveAllColleagues":ap(aE,["accountName"]);break;case"RemoveAllLinks":ap(aE,["accountName"]);break;case"RemoveAllMemberships":ap(aE,["accountName"]);break;case"RemoveAllPinnedLinks":ap(aE,["accountName"]);break;case"RemoveColleague":ap(aE,["accountName","colleagueAccountName"]);break;case"RemoveLink":ap(aE,["accountName","id"]);break;case"RemoveMembership":ap(aE,["accountName","sourceInternal","sourceReference"]);break;case"RemovePinnedLink":ap(aE,["accountName","id"]);break;case"UpdateColleaguePrivacy":ap(aE,["accountName","colleagueAccountName","newPrivacy"]);break;case"UpdateLink":ap(aE,["accountName","data"]);break;case"UpdateMembershipPrivacy":ap(aE,["accountName","sourceInternal","sourceReference","newPrivacy"]);break;case"UpdatePinnedLink ":ap(aE,["accountName","data"]);break;case"DeleteAllVersions":ap(aE,["fileName"]);break;case"DeleteVersion":ap(aE,["fileName","fileVersion"]);break;case"GetVersions":ap(aE,["fileName"]);break;case"RestoreVersion":ap(aE,["fileName","fileVersion"]);break;case"AddView":ap(aE,["listName","viewName","viewFields","query","rowLimit","rowLimit","type","makeViewDefault"]);break;case"DeleteView":ap(aE,["listName","viewName"]);break;case"GetView":ap(aE,["listName","viewName"]);break;case"GetViewCollection":ap(aE,["listName"]);break;case"GetViewHtml":ap(aE,["listName","viewName"]);break;case"UpdateView":ap(aE,["listName","viewName","viewProperties","query","viewFields","aggregations","formats","rowLimit"]);break;case"UpdateViewHtml":ap(aE,["listName","viewName","viewProperties","toolbar","viewHeader","viewBody","viewFooter","viewEmpty","rowLimitExceeded","query","viewFields","aggregations","formats","rowLimit"]);break;case"AddWebPart":ap(aE,["pageUrl","webPartXml","storage"]);break;case"AddWebPartToZone":ap(aE,["pageUrl","webPartXml","storage","zoneId","zoneIndex"]);break;case"GetWebPart2":ap(aE,["pageUrl","storageKey","storage","behavior"]);break;case"GetWebPartPage":ap(aE,["documentName","behavior"]);break;case"GetWebPartProperties":ap(aE,["pageUrl","storage"]);break;case"GetWebPartProperties2":ap(aE,["pageUrl","storage","behavior"]);break;case"Webs.CreateContentType":ap(aE,["displayName","parentType","newFields","contentTypeProperties"]);break;case"GetColumns":ap(aE,["webUrl"]);break;case"GetContentType":ap(aE,["contentTypeId"]);break;case"GetContentTypes":break;case"GetCustomizedPageStatus":ap(aE,["fileUrl"]);break;case"GetListTemplates":break;case"GetObjectIdFromUrl":ap(aE,["objectUrl"]);break;case"GetWeb":ap(aE,[["webUrl","webURL"]]);break;case"GetWebCollection":break;case"GetAllSubWebCollection":break;case"UpdateColumns":ap(aE,["newFields","updateFields","deleteFields"]);break;case"Webs.UpdateContentType":ap(aE,["contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields"]);break;case"WebUrlFromPageUrl":ap(aE,[["pageUrl","pageURL"]]);break;case"AlterToDo":ap(aE,["item","todoId","todoListId","taskData"]);break;case"GetTemplatesForItem":ap(aE,["item"]);break;case"GetToDosForItem":ap(aE,["item"]);break;case"GetWorkflowDataForItem":ap(aE,["item"]);break;case"GetWorkflowTaskData":ap(aE,["item","listId","taskId"]);break;case"StartWorkflow":ap(aE,["item","templateId","workflowParameters"]);break;default:break}var aH=T.header+T.opheader+T.payload+T.opfooter+T.footer;var aF;if(aE.cacheXML){aF=B[aH]}var aB=ak.isFunction(aE.completefunc);if(typeof aF==="undefined"){B[aH]=ak.ajax({url:aG,async:aB?false:aE.async,beforeSend:function(i){if(U[aE.operation][1]){i.setRequestHeader("SOAPAction",ab)}},type:"POST",data:aH,dataType:"xml",contentType:"text/xml;charset='utf-8'",complete:function(aI,i){if(aB){aE.completefunc(aI,i)}}});return B[aH]}else{if(aB){aE.completefunc(aF,null)}return aF}};ak.fn.SPServices.defaults={cacheXML:false,operation:"",webURL:"",makeViewDefault:false,CAMLViewName:"",CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:"",batchCmd:"Update",valuepairs:[],DestinationUrls:[],behavior:"Version3",storage:"Shared",objectType:"List",cancelMeeting:true,nonGregorian:false,fClaim:false,recurrenceId:0,sequence:0,maximumItemsToReturn:0,startIndex:0,isHighPriority:false,isPrivate:false,rating:1,maxResults:10,principalType:"User",async:true,completefunc:null};ak.fn.SPServices.SPGetCurrentSite=function(){if(ao.thisSite.length>0){return ao.thisSite}var i=T.header+""+location.protocol+"//"+location.host+location.pathname+""+T.footer;ak.ajax({async:false,url:"/_vti_bin/Webs.asmx",type:"POST",data:i,dataType:"xml",contentType:'text/xml;charset="utf-8"',complete:function(aB){ao.thisSite=ak(aB.responseXML).find("WebUrlFromPageUrlResult").text()}});return ao.thisSite};ak.fn.SPServices.SPCascadeDropdowns=function(aJ){var aB=ak.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListParentColumn:"",relationshipListChildColumn:"",relationshipListSortColumn:"",parentColumn:"",childColumn:"",listName:ak().SPServices.SPListNameFromUrl(),CAMLQuery:"",CAMLQueryOptions:"FALSE",promptText:"",noneText:"(None)",simpleChild:false,selectSingleOption:false,matchOnId:false,completefunc:null,debug:false},aJ);var aD=false;var aH="SPServices.SPCascadeDropdowns";var aE=new aq(aB.parentColumn);if(aE.Obj.html()===null&&aB.debug){X(aH,"parentColumn: "+aB.parentColumn,ah);return}var i=new aq(aB.childColumn);if(i.Obj.html()===null&&aB.debug){X(aH,"childColumn: "+aB.childColumn,ah);return}if(aB.simpleChild===true&&i.Type==="C"){ak().SPServices.SPComplexToSimpleDropdown({columnName:aB.childColumn});i=new aq(aB.childColumn)}var aI,aG;ak().SPServices({operation:"GetList",async:false,cacheXML:true,listName:aB.listName,completefunc:function(aK){ak(aK.responseXML).find("Fields").each(function(){ak(this).find("Field[DisplayName='"+aB.childColumn+"']").each(function(){aI=(ak(this).attr("Required")==="TRUE")?true:false;aG=ak(this).attr("StaticName");return false})})}});var aF={opt:aB,childSelect:i,childColumnStatic:aG,childColumnRequired:aI};var aC=aE.Obj.data("SPCascadeDropdownsChildColumns");if(typeof aC==="undefined"){aE.Obj.data("SPCascadeDropdownsChildColumns",[aF])}else{aC.push(aF);aE.Obj.data("SPCascadeDropdownsChildColumns",aC);aD=true}if(!aD){switch(aE.Type){case"S":aE.Obj.bind("change",function(){ax(aB.parentColumn,aE)});break;case"C":ak("input[id='"+aE.Obj.attr("optHid")+"']").bind("propertychange",function(){ax(aB.parentColumn,aE)});break;case"M":aE.Obj.bind("dblclick",function(){ax(aB.parentColumn,aE)});aE.Obj.closest("span").find("select[id$='SelectResult']").bind("dblclick",function(){ax(aB.parentColumn,aE)});aE.Obj.closest("span").find("button").each(function(){ak(this).bind("click",function(){ax(aB.parentColumn,aE)})});break;default:break}}ax(aB.parentColumn,aE)};function ax(aL,aF){var aM="";var aE;var aH=null;var aC;var aI;var i;var aK;var aG;var aJ;var aD;var aB=aF.Obj.data("SPCascadeDropdownsChildColumns");ak(aB).each(function(){var aP=this.opt;var aO=this.childSelect;var aT=this.childColumnStatic;var aU=this.childColumnRequired;var aR;aE=c(aF,aP.matchOnId);var aS=aE.join(";#");if(aF.Obj.data("SPCascadeDropdown_Selected_"+aT)===aS){return}aF.Obj.data("SPCascadeDropdown_Selected_"+aT,aS);aH=c(aO,true);if(aO.Type==="M"){aC=new az(aO.Obj);aI=aC.MultiLookupPickerdata;i=aC.master;aR=aO.Obj.closest("span").find("select[ID$='SelectResult']")}var aQ=(aP.relationshipListSortColumn.length>0)?aP.relationshipListSortColumn:aP.relationshipListChildColumn;var aN="";if(aP.CAMLQuery.length>0){aN+=""}if(aE.length===0){aN+=""}else{if(aE.length===1){aN+="":"'/>")+L(aE[0])+""}else{var aV=(aE.length>2)?true:false;for(O=0;O<(aE.length-1);O++){aN+=""}for(O=0;O":"'/>")+L(aE[O])+"";if(O>0&&(O<(aE.length-1))&&aV){aN+=""}}aN+=""}}if(aP.CAMLQuery.length>0){aN+=aP.CAMLQuery+""}aN+="";aN+="";ak().SPServices({operation:"GetListItems",async:false,webURL:aP.relationshipWebURL,listName:aP.relationshipList,CAMLQuery:aN,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:aP.CAMLQueryOptions,completefunc:function(aW){ak(aW.responseXML).find("errorstring").each(function(){var aY="SPServices.SPCascadeDropdowns";var aX=ak(this).text();if(aP.debug&&aX==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){X(aY,"relationshipListParentColumn: "+aP.relationshipListParentColumn+" or relationshipListChildColumn: "+aP.relationshipListChildColumn,"Not found in relationshipList "+aP.relationshipList)}else{if(aP.debug&&aX==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){X(aY,"relationshipList: "+aP.relationshipList,"List not found")}}return});switch(aO.Type){case"S":ak(aO.Obj).find("option").remove();if(!aU&&(aP.promptText.length>0)){aO.Obj.append("")}else{if(!aU){aO.Obj.append("")}}break;case"C":aM=aU?"":aP.noneText+"|0";aO.Obj.attr("value","");break;case"M":ak(aO.Obj).find("option").remove();aK="";break;default:break}aG=parseFloat(ak(aW.responseXML).SPFilterNode("rs:data").attr("ItemCount"));ak(aW.responseXML).SPFilterNode("z:row").each(function(){var aY={};var aX=ak(this).attr("ows_"+aP.relationshipListChildColumn);if(typeof aX!=="undefined"&&aX.indexOf(";#")>0){aY=new m(aX)}else{aY.id=ak(this).attr("ows_ID");aY.value=aX}if(isNaN(aY.id)){aY.id=ak(this).attr("ows_ID")}aJ=aY.id;aD=aY.value;switch(aO.Type){case"S":var aZ=(ak(this).attr("ows_ID")===aH[0])?" selected='selected'":"";aO.Obj.append(""+aY.value+"");break;case"C":if(aY.id===aH[0]){aO.Obj.attr("value",aY.value)}aM=aM+((aM.length>0)?"|":"")+aY.value+"|"+aY.id;break;case"M":aO.Obj.append("");aK+=aY.id+"|t"+aY.value+"|t |t |t";break;default:break}});switch(aO.Type){case"S":aO.Obj.trigger("change");if(aG===1&&aP.selectSingleOption===true){ak(aO.Obj).find("option[value!='0']:first").attr("selected","selected")}break;case"C":aO.Obj.attr("choices",aM);if(aG===1&&aP.selectSingleOption===true){ak(aO.Obj).attr("value",aD);ak("input[id='"+aO.Obj.attr("optHid")+"']").val(aJ)}if(aO.Obj.val()===""){ak("input[id='"+aO.Obj.attr("optHid")+"']").val("")}break;case"M":i.data="";aI.attr("value",aK);ak(aR).find("option").each(function(){var aY=ak(this);var aX=ak(this).html();ak(this).attr("selected","selected");ak(aO.Obj).find("option").filter(function(){return ak(this).text()===aX.replace(/&/,"&")}).each(function(){if(ak(this).html()===aX){aY.removeAttr("selected")}})});GipRemoveSelectedItems(i);ak(aO.Obj).find("option").each(function(){var aX=ak(this);ak(aR).find("option").each(function(){if(ak(this).html()===aX.html()){aX.remove()}})});GipAddSelectedItems(i);i.data=GipGetGroupData(aK);aO.Obj.trigger("dblclick");break;default:break}}});if(aP.completefunc!==null){aP.completefunc()}})}ak.fn.SPServices.SPComplexToSimpleDropdown=function(aJ){var i=ak.extend({},{columnName:"",completefunc:null,debug:false},aJ);var aC=new aq(i.columnName);if(aC.Obj.html()===null&&i.debug){X("SPServices.SPComplexToSimpleDropdown","columnName: "+i.columnName,ah);return}if(aC.Type!=="C"){return}var aH=ak(aC.Obj).attr("choices").split("|");var aD=ak(aC.Obj).attr("optHid");var aI=ak("input[id='"+aD+"']");var aB=ak("input[id='"+aD+"']").val();var aE=ad("SPComplexToSimpleDropdown",i.columnName);var aG="";ak(aC.Obj).closest("td").prepend(aG);ak(aC.Obj).closest("span").find("img").remove();ak(aC.Obj).closest("span").find("input").hide();ak("#"+aE).change(function(){var aK=ak(this).val();aI.val(aK);ak(aC.Obj).val(ak(this).find("option[value='"+(aK!=="0"?aK:"")+"']").html())});ak("#"+aE).trigger("change");if(i.completefunc!==null){i.completefunc()}};ak.fn.SPServices.SPDisplayRelatedInfo=function(aB){var aD=ak.extend({},{columnName:"",relatedWebURL:"",relatedList:"",relatedListColumn:"",relatedColumns:[],displayFormat:"table",headerCSSClass:"ms-vh2",rowCSSClass:"ms-vb",CAMLQuery:"",numChars:0,matchType:"Eq",matchOnId:false,completefunc:null,debug:false},aB);var i;var aC=[];var aG;var aF="SPServices.SPDisplayRelatedInfo";var aE=new aq(aD.columnName);if(aE.Obj.html()===null&&aD.debug){X(aF,"columnName: "+aD.columnName,ah);return}i=ad("SPDisplayRelatedInfo",aD.columnName);ak().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:aD.relatedWebURL,listName:aD.relatedList,completefunc:function(aH){ak(aH.responseXML).find("faultcode").each(function(){if(aD.debug){X(aF,"relatedList: "+aD.relatedList,"List not found");return}});aG=ak(aH.responseXML).find("List");aC[aD.relatedListColumn]=ak(aH.responseXML).find("Fields > Field[Name='"+aD.relatedColumn+"']");for(O=0;O Field[Name='"+aD.relatedColumns[O]+"']")}}});switch(aE.Type){case"S":aE.Obj.bind("change",function(){af(aD,i,aG,aC)});break;case"C":ak("input[id='"+aE.Obj.attr("optHid")+"']").bind("propertychange",function(){af(aD,i,aG,aC)});break;case"M":if(aD.debug){X(aF,"columnName: "+aD.columnName,"Multi-select columns not supported by this function")}break;default:break}af(aD,i,aG,aC)};function af(aC,aG,aI,aD){var aJ=null;var aF="SPServices.SPDisplayRelatedInfo";var aE=new aq(aC.columnName);aJ=c(aE,aC.matchOnId);if(aE.Type==="C"&&aC.numChars>0&&aJ[0].length");var i="";if(aC.CAMLQuery.length>0){i+=""}var aB=aD[aC.relatedListColumn].attr("Type");if(aB==="Lookup"){i+="":"'/>")+L(aJ[0])+""}else{i+="":aC.relatedListColumn+"'/>")+L(aJ[0])+""}if(aC.CAMLQuery.length>0){i+=aC.CAMLQuery+""}i+="";var aH=" ";for(O=0;O"}ak().SPServices({operation:"GetListItems",async:false,webURL:aC.relatedWebURL,listName:aC.relatedList,CAMLQuery:i,CAMLViewFields:""+aH+"",CAMLRowLimit:0,completefunc:function(aL){ak(aL.responseXML).find("errorstring").each(function(){var aM=ak(this).text();if(aC.debug&&aM==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){X(aF,"relatedListColumn: "+aC.relatedListColumn,"Column not found in relatedList "+aC.relatedList)}else{if(aC.debug&&aM==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){X(aF,"relatedList: "+aC.relatedList,"List not found")}}return});var aK;switch(aC.displayFormat){case"table":aK="
    ";aK+="";for(O=0;O"+aD[aC.relatedColumns[O]].attr("DisplayName")+""}aK+="";ak(aL.responseXML).SPFilterNode("z:row").each(function(){aK+="";for(O=0;O"+W(aI,aD[aC.relatedColumns[O]],ak(this).attr("ows_"+aC.relatedColumns[O]),aC)+""}aK+=""});aK+="
    ";break;case"list":aK="";ak(aL.responseXML).SPFilterNode("z:row").each(function(){for(O=0;O"+aD[aC.relatedColumns[O]].attr("DisplayName")+"";aK+="";aK+=""}});aK+="
    "+W(aI,aD[aC.relatedColumns[O]],ak(this).attr("ows_"+aC.relatedColumns[O]),aC)+"
    ";break;default:break}ak("#"+aG).html(aK)}});if(aC.completefunc!==null){aC.completefunc()}}ak.fn.SPServices.SPFilterDropdown=function(aN){var aC=ak.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListColumn:"",relationshipListSortColumn:"",relationshipListSortAscending:true,columnName:"",listName:ak().SPServices.SPListNameFromUrl(),promptText:"",noneText:"(None)",CAMLQuery:"",CAMLQueryOptions:"FALSE",completefunc:null,debug:false},aN);var aM="";var aL=null;var aF;var aG;var aB;var aK;var aJ;var aI="SPServices.SPFilterDropdown";var aH=new aq(aC.columnName);if(aH.Obj.html()===null&&aC.debug){X(aI,"columnName: "+aC.columnName,ah);return}aL=c(aH,true);var aE=(aC.relationshipListSortColumn.length>0)?aC.relationshipListSortColumn:aC.relationshipListColumn;var aD=(aC.relationshipListSortAscending===true)?"":"Ascending='FALSE'";var i="";if(aC.CAMLQuery.length>0){i+=aC.CAMLQuery}i+="";ak().SPServices({operation:"GetList",async:false,cacheXML:true,listName:aC.listName,completefunc:function(aO){ak(aO.responseXML).find("Fields").each(function(){ak(this).find("Field[DisplayName='"+aC.columnName+"']").each(function(){aJ=(ak(this).attr("Required")==="TRUE")?true:false;return false})})}});ak().SPServices({operation:"GetListItems",async:false,webURL:aC.relationshipWebURL,listName:aC.relationshipList,CAMLQuery:i,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:aC.CAMLQueryOptions,completefunc:function(aP){ak(aP.responseXML).find("errorstring").each(function(){var aQ=ak(this).text();if(aC.debug&&aQ==="One or more field types are not installed properly. Go to the list settings page to delete these fields."){X(aI,"relationshipListColumn: "+aC.relationshipListColumn,"Not found in relationshipList "+aC.relationshipList)}else{if(aC.debug&&aQ==="Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."){X(aI,"relationshipList: "+aC.relationshipList,"List not found")}}return});switch(aH.Type){case"S":ak(aH.Obj).find("option").remove();if(!aJ&&(aC.promptText.length>0)){aH.Obj.append("")}else{if(!aJ){aH.Obj.append("")}}break;case"C":aM=aJ?"":aC.noneText+"|0";aH.Obj.attr("value","");break;case"M":ak(aH.Obj).find("option").remove();aK="";break;default:break}ak(aP.responseXML).SPFilterNode("z:row").each(function(){var aR={};var aQ=ak(this).attr("ows_"+aC.relationshipListColumn);if(typeof aQ!=="undefined"&&aQ.indexOf(";#")>0){aR=new m(aQ)}else{aR.id=ak(this).attr("ows_ID");aR.value=aQ}if(isNaN(aR.id)){aR.id=ak(this).attr("ows_ID")}switch(aH.Type){case"S":var aS=(ak(this).attr("ows_ID")===aL[0])?" selected='selected'":"";aH.Obj.append(""+aR.value+"");break;case"C":if(aR.id===aL[0]){aH.Obj.attr("value",aR.value)}aM=aM+((aM.length>0)?"|":"")+aR.value+"|"+aR.id;break;case"M":aH.Obj.append("");aK+=aR.id+"|t"+aR.value+"|t |t |t";break;default:break}});switch(aH.Type){case"S":aH.Obj.trigger("change");break;case"C":aH.Obj.attr("choices",aM);aH.Obj.trigger("propertychange");break;case"M":aF=new az(aH.Obj);aG=aF.MultiLookupPickerdata;aB=aF.master;var aO=aH.Obj.closest("span").find("select[ID$='SelectResult']");aB.data="";aG.attr("value",aK);ak(aO).find("option").each(function(){var aQ=ak(this);ak(this).attr("selected","selected");ak(aH.Obj).find("option").each(function(){if(ak(this).html()===aQ.html()){aQ.removeAttr("selected")}})});GipRemoveSelectedItems(aB);ak(aH.Obj).find("option").each(function(){var aQ=ak(this);ak(aO).find("option").each(function(){if(ak(this).html()===aQ.html()){aQ.remove()}})});GipAddSelectedItems(aB);aB.data=GipGetGroupData(aK);aH.Obj.trigger("dblclick");break;default:break}}});if(aC.completefunc!==null){aC.completefunc()}};ak.fn.SPServices.SPDebugXMLHttpResult=function(aC){var aE=ak.extend({},{node:null,indent:0},aC);var aD;var aG=3;var aF=4;var aB="";aB+="";if(aE.node.nodeName==="DisplayPattern"){aB+=""}else{if(!aE.node.hasChildNodes()){aB+="";if(aE.node.attributes){aB+=""}}else{if(aE.node.hasChildNodes()&&aE.node.firstChild.nodeType===aF){aB+=""}else{if(aE.node.hasChildNodes()&&aE.node.firstChild.nodeType===aG){aB+=""}else{aB+="";if(aE.node.attributes){aB+=""}aB+=""}}}}aB+="
    "+aE.node.nodeName+"
    "+aE.node.nodeName+""+((aE.node.nodeValue!==null)?N(aE.node.nodeValue):" ")+"
    "+s(aE.node)+"
    "+aE.node.nodeName+"
    "+aE.node.nodeName+""+N(aE.node.firstChild.nodeValue)+"
    "+aE.node.nodeName+"
    "+s(aE.node)+"
    ";for(aD=0;aD
    ";return aB};ak.fn.SPServices.SPGetCurrentUser=function(aE){var aG=ak.extend({},{webURL:"",fieldName:"Name",fieldNames:{},debug:false},aE);if(aG.fieldName==="ID"&&typeof ao.thisUserId!=="undefined"){return ao.thisUserId}var aC="";var aF={};var aH=aG.fieldNames.length>0?aG.fieldNames.length:1;var aD;var aB=aG.webURL.length>0?aG.webURL:ak().SPServices.SPGetCurrentSite();ak.ajax({async:false,url:aB+"/_layouts/userdisp.aspx?Force=True&"+new Date().getTime(),complete:function(aI){aD=aI}});for(O=0;O1){i=RegExp('FieldInternalName="'+aG.fieldNames[O]+'"',"gi")}else{i=RegExp('FieldInternalName="'+aG.fieldName+'"',"gi")}ak(aD.responseText).find("table.ms-formtable td[id^='SPField']").each(function(){if(i.test(ak(this).html())){switch(ak(this).attr("id")){case"SPFieldText":aC=ak(this).text();break;case"SPFieldNote":aC=ak(this).find("div").html();break;case"SPFieldURL":aC=ak(this).find("img").attr("src");break;default:aC=ak(this).text();break}return false}})}if(aG.fieldNames[O]!=="ID"){aC=(typeof aC!=="undefined")?aC.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g,""):null}if(aH>1){aF[aG.fieldNames[O]]=aC}}return(aH>1)?aF:aC};ak.fn.SPServices.SPLookupAddNew=function(aI){var aD=ak.extend({},{lookupColumn:"",promptText:"Add new {0}",newWindow:false,ContentTypeID:"",completefunc:null,debug:false},aI);var aF="SPServices.SPLookupAddNew";var aC=new aq(aD.lookupColumn);if(aC.Obj.html()===null&&aD.debug){X(aF,"lookupColumn: "+aD.lookupColumn,ah);return}var i="";var aH="";var aB="";ak().SPServices({operation:"GetList",async:false,cacheXML:true,listName:ak().SPServices.SPListNameFromUrl(),completefunc:function(aJ){ak(aJ.responseXML).find("Field[DisplayName='"+aD.lookupColumn+"']").each(function(){aB=ak(this).attr("StaticName");ak().SPServices({operation:"GetList",async:false,cacheXML:true,listName:ak(this).attr("List"),completefunc:function(aK){ak(aK.responseXML).find("List").each(function(){aH=ak(this).attr("WebFullUrl");aH=aH!==Q?aH+Q:aH})}});i=D(ak(this).attr("List"),"NewForm");return false})}});if(aH.length===0&&aD.debug){X(aF,"lookupColumn: "+aD.lookupColumn,"This column does not appear to be a lookup column");return}if(i.length>0){var aG=aH+i;aG+=aD.newWindow?((aD.ContentTypeID.length>0)?"?ContentTypeID="+aD.ContentTypeID:"")+"' target='_blank'":"?"+((aD.ContentTypeID.length>0)?"ContentTypeID="+aD.ContentTypeID+"&":"")+"Source="+z(location.href)+"'";var aE="
    "+aC+"";if(aD.CAMLQuery.length>0){i+=aD.CAMLQuery+""}i+="";ak().SPServices({operation:"GetListItems",async:false,webURL:aD.webURL,listName:aD.listName,CAMLQuery:i,CAMLViewFields:"",CAMLRowLimit:1,CAMLQueryOptions:"",completefunc:function(aF){ak(aF.responseXML).SPFilterNode("z:row").each(function(){aE=ak(this).attr("ows_ID")})}});return aE};ak.fn.SPServices.SPRequireUnique=function(aB){var aC=ak.extend({},{columnStaticName:"Title",duplicateAction:0,ignoreCase:false,initMsg:"This value must be unique.",initMsgCSSClass:"ms-vb",errMsg:"This value is not unique.",errMsgCSSClass:"ms-formvalidation",showDupes:false,completefunc:null},aB);var aG=ak().SPServices.SPGetQueryString();var aH=aG.ID;ao.thisList=ak().SPServices.SPListNameFromUrl();var aF="{1}
    ";var aE=aF.replace(/\{0\}/g,aC.initMsgCSSClass).replace(/\{1\}/g,aC.initMsg);var aD=ak().SPServices.SPGetDisplayFromStatic({listName:ao.thisList,columnStaticName:aC.columnStaticName});var i=ak("input[Title='"+aD+"']");ak(i).parent().append(aE);ak(i).blur(function(){var aK=[];var aL=ak(this).attr("value");if(aL.length===0){return false}ak().SPServices({operation:"GetListItems",async:false,listName:ao.thisList,CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(aN){var aM=aC.ignoreCase?aL.toUpperCase():aL;ak(aN.responseXML).SPFilterNode("z:row").each(function(){var aO=aC.ignoreCase?ak(this).attr("ows_"+aC.columnStaticName).toUpperCase():ak(this).attr("ows_"+aC.columnStaticName);if((aM===aO)&&(ak(this).attr("ows_ID")!==aH)){aK.push([ak(this).attr("ows_ID"),ak(this).attr("ows_"+aC.columnStaticName)])}})}});var aJ=aC.initMsg;ak("span#SPRequireUnique"+aC.columnStaticName).html(aJ).attr("class",aC.initMsgCSSClass);ak("input[value='OK']:disabled, input[value='Save']:disabled").removeAttr("disabled");if(aK.length>0){aJ=aC.errMsg;ak("span#SPRequireUnique"+aC.columnStaticName).html(aJ).attr("class",aC.errMsgCSSClass);if(aC.duplicateAction===1){ak("input[Title='"+aC.columnDisplayName+"']").focus();ak("input[value='OK'], input[value='Save']").attr("disabled","disabled")}if(aC.showDupes){var aI=" "+aK.length+" duplicate item"+(aK.length>1?"s":"")+": ";for(O=0;O"+aK[O][1]+"
    "}ak("span#SPRequireUnique"+aC.columnStaticName).append(aI)}}});if(aC.completefunc!==null){aC.completefunc()}};ak.fn.SPServices.SPGetDisplayFromStatic=function(aB){var aC=ak.extend({},{webURL:"",listName:"",columnStaticName:"",columnStaticNames:{}},aB);var i="";var aD={};var aE=aC.columnStaticNames.length>0?aC.columnStaticNames.length:1;ak().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:aC.webURL,listName:aC.listName,completefunc:function(aF){if(aE>1){for(O=0;O1)?aD:i};ak.fn.SPServices.SPGetStaticFromDisplay=function(i){var aC=ak.extend({},{webURL:"",listName:"",columnDisplayName:"",columnDisplayNames:{}},i);var aB="";var aD={};var aE=aC.columnDisplayNames.length>0?aC.columnDisplayNames.length:1;ak().SPServices({operation:"GetList",async:false,cacheXML:true,webURL:aC.webURL,listName:aC.listName,completefunc:function(aF){if(aE>1){for(O=0;O1)?aD:aB};ak.fn.SPServices.SPRedirectWithID=function(aC){var aD=ak.extend({},{redirectUrl:"",qsParamName:"ID"},aC);ao.thisList=ak().SPServices.SPListNameFromUrl();var aH=ak().SPServices.SPGetQueryString();var aG=aH.ID;var aF=aH.List;var aB=aH.RootFolder;var aE=aH.ContentTypeId;if(typeof aH.ID==="undefined"){aG=ak().SPServices.SPGetLastItemId({listName:ao.thisList});ak("form[name='aspnetForm']").each(function(){var aJ=(location.href.indexOf("?")>0)?location.href.substring(0,location.href.indexOf("?")):location.href;var aK=(typeof aH.Source==="string")?"Source="+aH.Source.replace(/\//g,"%2f").replace(/:/g,"%3a"):"";var aI=[];if(typeof aF!=="undefined"){aI.push("List="+aF)}if(typeof aB!=="undefined"){aI.push("RootFolder="+aB)}if(typeof aE!=="undefined"){aI.push("ContentTypeId="+aE)}var aL=aJ+((aI.length>0)?("?"+aI.join("&")+"&"):"?")+"Source="+aJ+"?ID="+aG+((aK.length>0)?("%26RealSource="+aH.Source):"")+((typeof aH.RedirectURL==="string")?("%26RedirectURL="+aH.RedirectURL):"");ak(this).attr("action",aL)})}else{while(aH.ID===aG){aG=ak().SPServices.SPGetLastItemId({listName:ao.thisList})}var i=(typeof aH.RedirectURL==="string")?aH.RedirectURL:aD.redirectUrl;location.href=i+(i.indexOf("?")>0)?"&":"?"+aD.qsParamName+"="+aG+((typeof aH.RealSource==="string")?("&Source="+aH.RealSource):"")}};ak.fn.SPServices.SPSetMultiSelectSizes=function(aL){var i=ak.extend({},{multiSelectColumn:"",minWidth:0,maxWidth:0,debug:false},aL);var aG="SPServices.SPSetMultiSelectSizes";var aE=new aq(i.multiSelectColumn);if(aE.Obj.html()===null&&i.debug){X(aG,"multiSelectColumn: "+i.multiSelectColumn,ah);return}if(aE.Type!=="M"&&i.debug){X(aG,"multiSelectColumn: "+i.multiSelectColumn,"Column is not multi-select.");return}var aF=aE.Obj;var aJ=aF.closest("span").find("select[ID$='SelectResult']");var aH=ad("SPSetMultiSelectSizes",i.multiSelectColumn);var aI=aF.closest("span");aI.append("");var aD=aI.find("> select");aD.css({width:"auto",height:0,visibility:"hidden"});aD.append(aF.find("option").clone());aD.append(aJ.find("option").clone());var aB=aD.width()+5;var aK=aB;if(i.minWidth>0||i.maxWidth>0){if(aBi.maxWidth){aK=i.maxWidth}}var aC=aB;aF.css("width",aC+"px").parent().css("width",aK+"px");aJ.css("width",aC+"px").parent().css("width",aK+"px");if(i.maxWidth===0||i.maxWidth>aK){aF.parent().css("overflow-x","hidden");aJ.parent().css("overflow-x","hidden")}aD.remove()};ak.fn.SPServices.SPScriptAudit=function(aC){var aD=ak.extend({},{webURL:"",listName:"",outputId:"",auditForms:true,auditViews:true,auditPages:true,auditPagesListName:"Pages",showHiddenLists:false,showNoScript:false,showSrc:true},aC);var aB=[["New","NewForm.aspx",false],["Display","DispForm.aspx",false],["Edit","EditForm.aspx",false]];var aE;ak("#"+aD.outputId).append(""+(aD.showSrc?"":"")+"
    ListPage ClassPage TypePageScript References
    ");ak("#SPScriptAudit th").attr("class","ms-vh2-nofilter");if(aD.auditForms||aD.auditViews){ak().SPServices({operation:"GetListCollection",webURL:aD.webURL,async:false,completefunc:function(aG){ak(aG.responseXML).find("List").each(function(){aE=ak(this);if((aD.listName.length===0)||(aE.attr("Title")===aD.listName)){if((aD.showHiddenLists&&aE.attr("Hidden")==="False")||!aD.showHiddenLists){if(aD.auditForms){ak().SPServices({operation:"GetListContentTypes",webURL:aD.webURL,listName:aE.attr("ID"),async:false,completefunc:function(aH){ak(aH.responseXML).find("ContentType").each(function(){if(ak(this).attr("ID").substring(0,6)!=="0x0120"){var aJ=ak(this).find("FormUrls");for(O=0;O0)?aD.webURL:ak().SPServices.SPGetCurrentSite())+Q+ak(this).text());aB[O][2]=true});if(!aB[O][2]){var aI=aE.attr("DefaultViewUrl");aw(aD,aE,"Form",aB[O][0],aI.substring(0,aI.lastIndexOf(Q)+1)+aB[O][1])}}for(O=0;OFolder",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(aG){ak(aG.responseXML).SPFilterNode("z:row").each(function(){var aJ=ak(this).attr("ows_FileRef").split(";#")[1];var aH=ak(this).attr("ows_Title");var aI=(typeof aH!=="undefined")?aH:"";if(aJ.indexOf(".aspx")>0){aw(aD,aE,"Page",aI,Q+aJ)}})}})}}ak("#SPScriptAudit tr[class='ms-alternating']:even").removeAttr("class")};function aw(aB,aC,aJ,aF,aD){var aG=0;var aI=0;var aE={};aE.type=[];aE.src=[];aE.script=[];var aH=RegExp("","gi");ak.ajax({type:"GET",url:aD,dataType:"text",async:false,success:function(aP){var aO;while(aO=aH.exec(aP)){var aK=aj(aO,"language");var aQ=aj(aO,"type");var aM=aj(aO,"src");if(aM!==null&&aM.length>0&&!al(aM)){aE.type.push((aK!==null&&aK.length>0)?aK:aQ);aE.src.push(aM);aI++}}if((!aB.showNoScript&&(aE.type.length>0))||aB.showNoScript){var aN=aD.substring(0,aD.lastIndexOf(Q)+1);var aL=""+aC.attr("Title")+((aC.attr("Hidden")==="True")?"(Hidden)":"")+""+aJ+""+aF+""+R(aD)+"";if(aB.showSrc){var i;aL+="";for(aG=0;aG";aL+=""}aL+="
    "+aE.type[aG]+""+R(aE.src[aG])+"
    "}ak("#SPScriptAudit").append(aL)}}})}function aj(aD,aB){var aC;var i=RegExp(aB+"=(\"([^\"]*)\")|('([^']*)')","gi");if(aC=i.exec(aD)){return aC[2]}return null}function al(aD){var aC;var aB=["WebResource.axd","_layouts"];for(aC=0;aC-1){return true}}return false}ak.fn.SPServices.SPArrangeChoices=function(aC){var aD=ak.extend({},{listName:ak().SPServices.SPListNameFromUrl(),columnName:"",perRow:99,randomize:false},aC);var aF=false;var aE=[];var aB;var i=ak().SPServices({operation:"GetList",async:false,cacheXML:true,listName:aD.listName});i.done(function(){aF=(ak(i.responseXML).find("Field[DisplayName='"+aD.columnName+"']").attr("FillInChoice")==="TRUE")?true:false;var aK=y(aD.columnName);var aI=ak(aK).find("tr").length;var aH=0;var aJ;var aG;ak(aK).find("tr").each(function(aL){aH++;if(aF&&aH===(aI-1)){aJ=ak(this).find("td").html()}else{if(aF&&aH===aI){aG=ak(this).find("td").html()}else{aE.push(ak(this).html())}}});if(aD.randomize){aE.sort(p)}aB="";for(O=0;O"}}aB+="";if(aF){aB+=""+aJ+aG+""}ak(aK).find("tr").remove();ak(aK).find("table").append(aB)})};ak.fn.SPServices.SPAutocomplete=function(aC){var aD=ak.extend({},{WebURL:"",sourceList:"",sourceColumn:"",columnName:"",CAMLQuery:"",CAMLQueryOptions:"",CAMLRowLimit:0,filterType:"BeginsWith",numChars:0,ignoreCase:false,highlightClass:"",uniqueVals:false,maxHeight:99999,slideDownSpeed:"fast",processingIndicator:"_layouts/images/REFRESH.GIF",debug:false},aC);var aF;var aB=ak("input[Title='"+aD.columnName+"']");ak("input[Title='"+aD.columnName+"']").css("position","");var aG=aB.attr("ID");var aE=aB.css("color");var aH=aB.css("width");if(aB.html()===null&&aD.debug){X("SPServices.SPAutocomplete","columnName: "+aD.columnName,"Column is not an input control or is not found on page");return}aB.closest("span").find("br").remove();aB.wrap("
    ");var i=ad("SPAutocomplete",aD.columnName);aB.after("
    ");ak("#"+i).css("width",aH);ak(aB).keyup(function(){var aQ=ak(this).val();ak("#"+i).hide();if(aQ.length";if(aD.CAMLQuery.length>0){aI+=""}aI+="<"+aD.filterType+">"+aQ+"";if(aD.CAMLQuery.length>0){aI+=aD.CAMLQuery+""}aI+="";ak().SPServices({operation:"GetListItems",async:false,webURL:aD.WebURL,listName:aD.sourceList,CAMLQuery:aI,CAMLQueryOptions:aD.CAMLQueryOptions,CAMLViewFields:"",CAMLRowLimit:aD.CAMLRowLimit,completefunc:function(aT){var aS=aD.ignoreCase?aQ.toUpperCase():aQ;ak(aT.responseXML).SPFilterNode("z:row").each(function(){var aV=ak(this).attr("ows_"+aD.sourceColumn);var aW=aD.ignoreCase?ak(this).attr("ows_"+aD.sourceColumn).toUpperCase():ak(this).attr("ows_"+aD.sourceColumn);if(aD.filterType==="Contains"){var aU=aW.indexOf(aS);if((aU>=0)&&(!aD.uniqueVals||(ak.inArray(aV,aP)===-1))){aP.push(ak(this).attr("ows_"+aD.sourceColumn))}}else{if(aS===aW.substr(0,aS.length)&&(!aD.uniqueVals||(ak.inArray(aV,aP)===-1))){aP.push(ak(this).attr("ows_"+aD.sourceColumn))}}})}});var aL="";for(O=0;O0){var aK=RegExp(aQ,aD.ignoreCase?"gi":"g");var aN=aP[O].match(aK);var aM=0;for(aF=0;aF"+aN[aF]+"";aP[O]=aP[O].substr(0,aO)+aR+aP[O].substr(aJ);aM=aO+aR.length}}aL+="
  • "+aP[O]+"
  • "}ak("#"+i).html(aL);ak("#"+i+" li").click(function(){ak("#"+i).fadeOut(aD.slideUpSpeed);ak("#"+aG).val(ak(this).text())}).mouseover(function(){var aS={cursor:"hand",color:"#ffffff",background:"#3399ff"};ak(this).css(aS)}).mouseout(function(){var aS={cursor:"inherit",color:aE,background:"transparent"};ak(this).css(aS)});if(aP.length>0){ak("#"+i).slideDown(aD.slideDownSpeed)}aB.css("background-image","")})};ak.fn.SPServices.SPGetQueryString=function(){var aG={};var aF;var aB=location.search.substring(1,location.search.length);var aC=aB.split("&");var aE=/^([^=]+)=(.*)/i;for(var aD=0;aD2){aG[aF[1]]=unescape(aF[2]).replace(/\+/g," ")}}}return aG};ak.fn.SPServices.SPListNameFromUrl=function(i){var aB=ak.extend({},{listName:""},i);if(aB.listName.length>0){ao.thisList=aB.listName;return ao.thisList}else{if(ao.thisList.length>0){return ao.thisList}}var aD=location.href;var aC=aD.substring(0,aD.indexOf(".aspx"));var aE=decodeURIComponent(aC.substring(0,aC.lastIndexOf(Q)+1)).toUpperCase();ak().SPServices({operation:"GetListCollection",async:false,completefunc:function(aF){ak(aF.responseXML).find("List").each(function(){var aG=ak(this).attr("DefaultViewUrl");var aH=aG.substring(0,aG.lastIndexOf(Q)+1).toUpperCase();if(aE.indexOf(aH)>0){ao.thisList=ak(this).attr("ID");return false}})}});return ao.thisList};ak.fn.SPServices.SPUpdateMultipleListItems=function(aD){var aF=ak.extend({},{webURL:"",listName:"",CAMLQuery:"",batchCmd:"Update",valuepairs:[],completefunc:null,folder:"",debug:false},aD);var aE;var aH=[];var aG=[];ak().SPServices({operation:"GetListItems",async:false,webURL:aF.webURL,listName:aF.listName,CAMLQuery:aF.CAMLQuery,CAMLQueryOptions:""+((aF.folder.length>0)?""+aF.folder+"":"")+"",completefunc:function(i){ak(i.responseXML).SPFilterNode("z:row").each(function(){aH.push(ak(this).attr("ows_ID"));var aI=ak(this).attr("ows_FileRef");aI="/"+aI.substring(aI.indexOf(";#")+2);aG.push(aI)})}});var aB;var aC="";for(aE=0;aE";for(aB=0;aB"+L(aF.valuepairs[aB][1])+""}aC+=""+aH[aE]+"";if(aG[aE].length>0){aC+=""+aG[aE]+""}aC+=""}aC+="";ak().SPServices({operation:"UpdateListItems",async:false,webURL:aF.webURL,listName:aF.listName,updates:aC,completefunc:function(i){if(aF.completefunc!==null){aF.completefunc(i)}}})};ak.fn.SPServices.SPConvertDateToISO=function(i){var aB=ak.extend({},{dateToConvert:new Date(),dateOffset:"-05:00"},i);var aC="";var aD=aB.dateToConvert;aC+=aD.getFullYear()+"-";aC+=t(aD.getMonth()+1)+"-";aC+=t(aD.getDate());aC+="T"+t(aD.getHours())+":";aC+=t(aD.getMinutes())+":";aC+=t(aD.getSeconds())+"Z"+aB.dateOffset;return aC};ak.fn.SPFilterNode=function(i){return this.find("*").filter(function(){return this.nodeName===i})};ak.fn.SPXmlToJson=function(i){var aC=ak.extend({},{mapping:{},includeAllAttrs:false,removeOws:true},i);var aD;var aB=[];this.each(function(){var aH={};var aJ=this.attributes;ak.each(aC.mapping,function(){aH[this.mappedName]=""});for(aD=0;aD0){aB.html(aD.valueToSet)}if(aD.checkNames){i.click()}var aF=ak.trim(aB.text());var aE=[];aB.children("span").each(function(){var aJ=ak(this).find("div[data]").attr("data");var aH={};if(typeof aJ!=="undefined"){var aK=ak.parseXML(aJ);var aI=ak(aK);aI.find("DictionaryEntry").each(function(){var aL=ak(this).find("Key").text();var aM=ak(this).find("Value").text();aH[aL]=aM});aE.push(aH)}else{ak().SPServices({operation:"GetUserInfo",async:false,cacheXML:true,userLoginName:ak(this).attr("title"),completefunc:function(aL){ak(aL.responseXML).find("User").each(function(){ak.each(this.attributes,function(aN,aP){var aM=aP.name;var aO=aP.value;aH[aM]=aO});aE.push(aH)})}})}});return{row:aG,contents:aB,currentValue:aF,checkNames:i,dictionaryEntries:aE}};ak.fn.SPFindPeoplePicker=function(i){return ak().SPServices.SPFindPeoplePicker(i)};ak.fn.SPServices.SPFindMMSPicker=function(aD){var aF=ak.extend({},{MMSDisplayName:""},aD);var aC=[];var aB=ak("div[title='"+aF.MMSDisplayName+"']");var aI=aB.closest("td").find("input[type='hidden']");var aH=aI.val().split(";");for(var aE=0;aE0?aD.relatedWebURL:ak().SPServices.SPGetCurrentSite();switch(aI.attr("Type")){case"Text":aK=aN;break;case"URL":switch(aI.attr("Format")){case"Hyperlink":aK="
    "+aN.substring(aN.search(",")+1)+"";break;case"Image":aK=""+aN.substring(aN.search(",")+1)+"";break;default:aK=aN;break}break;case"User":case"UserMulti":var aB=aN.split(";#");for(aJ=0;aJ"+aB[aJ+1]+"")}aK=aL.join(", ");break;case"Calculated":var aG=aN.split(";#");aK=aG[1];break;case"Number":aF=aI.attr("Decimals");aK=typeof aF==="undefined"?parseFloat(aN).toString():parseFloat(aN).toFixed(aF).toString();break;case"Currency":aF=aI.attr("Decimals");aK=typeof aF==="undefined"?parseFloat(aN).toFixed(2).toString():parseFloat(aN).toFixed(aF).toString();break;case"Lookup":switch(aI.attr("Name")){case"FileRef":aH=aM.attr("BaseType")==="1"?aM.attr("RootFolder")+Q+"Forms/DispForm.aspx":aM.attr("RootFolder")+Q+"DispForm.aspx";aK=""+aN.substring(aN.search(";#")+2)+"";break;case"FileDirRef":aH=Q+aN.substring(aN.search(";#")+2);aK=""+aN.substring(aN.search(";#")+2)+"";break;default:aH=D(aI.attr("List"),"DisplayForm");aK=""+aN.substring(aN.search(";#")+2)+"";break}break;case"LookupMulti":aH=D(aI.attr("List"),"DisplayForm");aK="";if(aN.length>0){var aC=aN.split(";#");for(aJ=0;aJ"+aC[(aJ*2)+1]+"")}}aK=aL.join(", ");break;case"File":R=aN.substring(aN.search(";#")+2);aK=""+R+"";break;case"Counter":aK=aN;break;case"DateTime":aK=aN;break;default:aK=aN;break}return aK}function s(aD){var aC;var aB="";for(aC=0;aC"}aB+="
    "+aC+""+aD.attributes.item(aC).nodeName+""+N(aD.attributes.item(aC).nodeValue)+"
    ";return aB}function aq(i){if((this.Obj=ak("select[Title='"+i+"']")).length===1){this.Type="S"}else{if((this.Obj=ak("input[Title='"+i+"']")).length===1){this.Type="C"}else{if((this.Obj=ak("select[ID$='SelectCandidate'][Title^='"+i+" ']")).length===1){this.Type="M"}else{if((this.Obj=ak("select[ID$='SelectCandidate'][Title$=': "+i+"']")).length===1){this.Type="M"}else{if((this.Obj=ak("select[ID$='SelectCandidate'][Title$='\""+i+"\".']")).length===1){this.Type="M"}else{if((this.Obj=ak("select[ID$='SelectCandidate'][Title$=' "+i+"']")).length===1){this.Type="M"}else{this.Type=null}}}}}}}function az(aD){this.MultiLookupPickerdata=aD.closest("span").find("input[id*='MultiLookup'][id$='data']");var aB=this.MultiLookupPickerdata.attr("id");var aC=aB.indexOf("Multi");var i=aB.substr(aC);var aE=aB.substr(0,aC)+i.substr(0,i.indexOf("_")+1)+"m";this.master=window[aE]}function c(aD,aB){var i=[];switch(aD.Type){case"S":if(aB){i.push(aD.Obj.find("option:selected").val()||[])}else{i.push(aD.Obj.find("option:selected").text()||[])}break;case"C":if(aB){i.push(ak("input[id='"+aD.Obj.attr("optHid")+"']").val()||[])}else{i.push(aD.Obj.attr("value")||[])}break;case"M":var aC=aD.Obj.closest("span").find("select[ID$='SelectResult']");ak(aC).find("option").each(function(){i.push(ak(this).html())});break;default:break}return i}function X(aB,aD,aC){var i="Error in function
    "+aB+"
    Parameter
    "+aD+"
    Message
    "+aC+"

    Click to continue
    ";V(i)}function V(aF){var aC="position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;";ak("#aspnetForm").parent().append("
    "+aF);var i=ak("#SPServices_msgBox").height();var aE=ak("#SPServices_msgBox").width();var aD=(ak(window).width()/2)-(aE/2)+"px";var aB=(ak(window).height()/2)-(i/2)-100+"px";ak("#SPServices_msgBox").css({border:"5px #C02000 solid",left:aD,top:aB}).show().fadeTo("slow",0.75).click(function(){ak(this).fadeOut("3000",function(){ak(this).remove()})})}function ad(i,aB){return i+"_"+ak().SPServices.SPGetStaticFromDisplay({listName:ak().SPServices.SPListNameFromUrl(),columnDisplayName:aB})}function D(i,aC){var aB;ak().SPServices({operation:"GetFormCollection",async:false,listName:i,completefunc:function(aD){aB=ak(aD.responseXML).find("Form[Type='"+aC+"']").attr("Url")}});return aB}function ap(aD,aB){var aC;for(aC=0;aC"+i+""}function p(){return(Math.round(Math.random())-0.5)}function N(i){return((i.indexOf("http")===0)||(i.indexOf(Q)===0))?""+i+"":i}function R(i){return i.substring(i.lastIndexOf(Q)+1,i.length)}var Y={"&":"&",'"':""","<":"<",">":">"};var H={"&":"&",""":'"',"<":"<",">":">"};function h(i){return i.replace(/([\&"<>])/g,function(aC,aB){return Y[aB]})}function I(i){return i.replace(/("|<|>|&)/g,function(aC,aB){return H[aB]})}function L(i){if(typeof i==="string"){return i.replace(/&(?![a-zA-Z]{1,8};)/g,"&")}else{return i}}function z(i){return i.replace(/&/g,"%26")}function m(i){var aB=i.split(";#");this.id=aB[0];this.value=aB[1]}function t(i){return i<10?"0"+i:i}})(jQuery); diff --git a/license.txt b/license.txt index 774561a..4dd01fc 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2009-2012 Sympraxis Consulting LLC +Copyright (c) 2009-2013 Sympraxis Consulting LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: