protected void updatePanelWithTeamDetails(WBTeam team) { TeamName.Text = team.Name; TeamGUID.Text = team.Id.ToString(); TeamAcronym.Text = team.Acronym; UseAllFunctionalAreas.Checked = team.UseAllFunctionalAreas; TeamFunctionalAreas.Text = team.FunctionalAreaUIControlValue; if (TeamFunctionalAreas.Text == "") { InheritedFunctionalAreas.Text = team.FunctionalArea(functionalAreas).Names(); } else { InheritedFunctionalAreas.Text = ""; } TeamsSiteURL.Text = team.TeamSiteUrl; TeamsSiteGUID.Text = team.TeamSiteGuidString; WBLogging.Debug("In TeamManagement.updatePanelWithTeamDetails(): OwnersGroupName = " + team.OwnersGroupName); WBLogging.Debug("In TeamManagement.updatePanelWithTeamDetails(): MembersGroupName = " + team.MembersGroupName); InformationAssetOwner.WBxInitialise(team.InformationAssetOwner(SPContext.Current.Web)); TeamManager.WBxInitialise(team.Manager(SPContext.Current.Web)); //TeamOwnersSharePointUserGroup.CommaSeparatedAccounts = ""; //TeamOwnersSharePointUserGroup.ResolvedEntities.Clear(); //TeamOwnersSharePointUserGroup.Entities.Clear(); TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.OwnersGroupName)); //TeamMembersSharePointUserGroup.CommaSeparatedAccounts = ""; //TeamMembersSharePointUserGroup.ResolvedEntities.Clear(); //TeamMembersSharePointUserGroup.Entities.Clear(); TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.MembersGroupName)); //TeamPublishersSharePointUserGroup.CommaSeparatedAccounts = ""; TeamPublishersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.PublishersGroupName)); RecordsTypesListUrl.Text = team.RecordsTypesListUrl; CommonActivitiesListUrl.Text = team.CommonActivitiesListUrl; FunctionalActivitiesListUrl.Text = team.FunctionalActivitiesListUrl; }
protected void Page_Load(object sender, EventArgs e) { manager = new WBRecordsManager(SPContext.Current.Web.CurrentUser.LoginName); if (WorkBox.IsWebAWorkBox(SPContext.Current.Web)) { workBox = new WorkBox(SPContext.Current); team = workBox.OwningTeam; functionalAreasTaxonomy = workBox.FunctionalAreasTaxonomy; } else { team = WBTeam.GetFromTeamSite(SPContext.Current); if (team != null) { teamsTaxonomy = team.Taxonomy; functionalAreasTaxonomy = WBTaxonomy.GetFunctionalAreas(teamsTaxonomy); } } if (team == null) { WBLogging.Debug("Couldn't find a suitable team !!"); return; } masterLibraryHasVersions = manager.Libraries.ProtectedMasterLibrary.List.EnableVersioning; RecordsLibraryFolders.TreeNodePopulate += new TreeNodeEventHandler(RecordsLibraryFolders_TreeNodePopulate); // RecordsLibraryFolders.SelectedNodeChanged += new EventHandler(RecordsLibraryFolders_SelectedNodeChanged); RecordsLibraryFolders.PopulateNodesFromClient = true; RecordsLibraryFolders.EnableClientScript = true; treeState = new WBLocationTreeState(SPContext.Current.Web, WBRecordsManager.VIEW_MODE__BROWSE_FOLDERS, WBRecordsType.PROTECTIVE_ZONE__PUBLIC); if (!IsPostBack) { WBTermCollection <WBTerm> functionalAreas = team.FunctionalArea(functionalAreasTaxonomy); ViewState["SortColumn"] = WBColumn.DatePublished.InternalName; ViewState["SortDirection"] = "Descending"; /* * TreeViewLocationCollection collection = new TreeViewLocationCollection(manager, , "", functionalAreas); * * RecordsLibraryFolders.DataSource = collection; * RecordsLibraryFolders.DataBind(); */ manager.PopulateWithFunctionalAreas(treeState, RecordsLibraryFolders.Nodes, WBRecordsManager.VIEW_MODE__BROWSE_FOLDERS, functionalAreas); } else { SetSelectedPath(); if (!String.IsNullOrEmpty(selectedPath)) { ProcessSelection(selectedPath); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SPSite site = SPContext.Current.Site; SPWeb web = SPContext.Current.Web; WBTaxonomy teams = WBTaxonomy.GetTeams(site); WBTaxonomy functionalAreas = WBTaxonomy.GetFunctionalAreas(teams); teams.InitialiseTaxonomyControl(TeamTerm, "Select Team Term", false); teams.InitialiseTaxonomyControl(ParentTeamTerm, "Select the Parent Team Term", false); functionalAreas.InitialiseTaxonomyControl(TeamFunctionalAreas, "Select the functional area", true); TeamName.Text = web.Title; WBTeam team = WBTeam.GetFromTeamSite(teams, web); if (team != null) { TeamTerm.Text = team.UIControlValue; TeamAcronym.Text = team.Acronym; TeamFunctionalAreas.Text = team.FunctionalAreaUIControlValue; UseAllFunctionalAreas.Checked = team.UseAllFunctionalAreas; if (TeamFunctionalAreas.Text == "") { InheritedFunctionalAreas.Text = team.FunctionalArea(functionalAreas).Names(); } else { InheritedFunctionalAreas.Text = ""; } InformationAssetOwner.WBxInitialise(team.InformationAssetOwner(web)); TeamManager.WBxInitialise(team.Manager(web)); TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.OwnersGroupName)); TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.MembersGroupName)); TeamPublishersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.PublishersGroupName)); TeamTerm.Enabled = false; ParentTeamTerm.Enabled = false; TeamOwnersSharePointUserGroup.Enabled = false; TeamMembersSharePointUserGroup.Enabled = false; RecordsTypesListUrl.Text = team.RecordsTypesListUrl; } else { TeamTerm.Text = ""; SPWeb parentWeb = web.ParentWeb; WBTeam parentTeam = WBTeam.GetFromTeamSite(teams, parentWeb); if (parentTeam != null) { ParentTeamTerm.Text = parentTeam.UIControlValue; InheritedFunctionalAreas.Text = parentTeam.FunctionalArea(functionalAreas).Names(); RecordsTypesListUrl.Text = parentTeam.RecordsTypesListUrl; } TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(web.Title + " - Owners")); TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(web.Title + " - Members")); } } }
protected void Page_Load(object sender, EventArgs e) { string relatedWorkBoxUrl = ""; string recordsTypeGUIDString = ""; // Set the reference date control to match the locally set locale: ReferenceDate.LocaleId = SPContext.Current.Web.Locale.LCID; recordsTypes = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); teams = WBTaxonomy.GetTeams(recordsTypes); seriesTags = WBTaxonomy.GetSeriesTags(recordsTypes); functionalAreas = WBTaxonomy.GetFunctionalAreas(recordsTypes); if (!IsPostBack) { WorkBoxCollectionUrl.Value = Request.QueryString["workBoxCollectionUrl"]; pageRenderingRequired = true; recordsTypeGUIDString = Request.QueryString["recordsTypeGUID"]; RecordsTypeGUID.Value = recordsTypeGUIDString; if (recordsTypeGUIDString != "") { workBoxRecordsType = recordsTypes.GetRecordsType(new Guid(recordsTypeGUIDString)); } else { WBLogging.Generic.Unexpected("The records type GUID appears to be blank in initial call to page!"); } // Now to setup some default intiail values: ReferenceDate.SelectedDate = DateTime.Now; functionalAreaFieldIsEditable = workBoxRecordsType.IsFunctionalAreaEditable; string owningTeamGuidString = Request.QueryString["owningTeamGUID"]; WBTeam owningTeam = null; if (owningTeamGuidString != null && !owningTeamGuidString.Equals("")) { owningTeam = teams.GetTeam(new Guid(owningTeamGuidString)); OwningTeamField.Text = owningTeam.Name; // UIControlValue; OwningTeamUIControlValue.Value = owningTeam.UIControlValue; InvolvedTeamsField.Text = owningTeam.UIControlValue; } relatedWorkBoxUrl = Request.QueryString["relatedWorkBoxURL"]; RelatedWorkBoxUrl.Value = relatedWorkBoxUrl; RelationType.Value = Request.QueryString["relationType"]; if (relatedWorkBoxUrl != null && relatedWorkBoxUrl != "") { relatedWorkBox = new WorkBox(relatedWorkBoxUrl); ReferenceID.Text = relatedWorkBox.ReferenceID; WBTerm seriesTag = relatedWorkBox.SeriesTag(seriesTags); if (seriesTag != null) { seriesTagInitialValue = seriesTag.UIControlValue; } owningTeam = relatedWorkBox.OwningTeam; OwningTeamField.Text = owningTeam.Name; // UIControlValue; OwningTeamUIControlValue.Value = owningTeam.UIControlValue; InvolvedTeamsField.Text = relatedWorkBox.InvolvedTeams.UIControlValue; } // Now let's setup the initial value for the functional area: if (functionalAreaFieldIsEditable) { functionalAreaInitialValue = workBoxRecordsType.DefaultFunctionalAreaUIControlValue; if (functionalAreaInitialValue == null || functionalAreaInitialValue == "") { if (owningTeam != null) { functionalAreaInitialValue = owningTeam.FunctionalArea(functionalAreas).UIControlValue; } } } else { functionalAreaInitialValue = workBoxRecordsType.DefaultFunctionalAreaUIControlValue; } } else { WBUtils.logMessage("In the postback with workBoxCollectionUrl = " + WorkBoxCollectionUrl.Value); pageRenderingRequired = false; relatedWorkBoxUrl = RelatedWorkBoxUrl.Value; recordsTypeGUIDString = RecordsTypeGUID.Value; if (recordsTypeGUIDString != "") { workBoxRecordsType = recordsTypes.GetRecordsType(new Guid(recordsTypeGUIDString)); } else { WBLogging.Generic.Unexpected("The records type GUID appears to be blank in postback!"); } } if (pageRenderingRequired) { renderPage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String currentUserLoginName = SPContext.Current.Web.CurrentUser.LoginName; WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); WBTaxonomy functionalAreas = WBTaxonomy.GetFunctionalAreas(teams); WBTeam team = WBTeam.GetFromTeamSite(teams, SPContext.Current.Web); if (team == null) { WorkBox workBox = WorkBox.GetIfWorkBox(SPContext.Current); if (workBox != null) { team = workBox.OwningTeam; } } // Check if this user has permission - checking basic team membership: if (team == null || !team.IsCurrentUserTeamMember()) { AccessDeniedPanel.Visible = true; UpdateRecordsMetadataPanel.Visible = false; AccessDeniedReason.Text = "You are not a member of this team"; return; } RecordID.Text = Request.QueryString["RecordID"]; WBLogging.Debug("Record ID is found to be: " + RecordID.Text); using (WBRecordsManager manager = new WBRecordsManager(currentUserLoginName)) { WBRecord record = manager.Libraries.GetRecordByID(RecordID.Text); record.CheckMetadata(); Filename.Text = record.Name; RecordTitle.Text = record.Title; String location = "<unknown>"; if (record.FunctionalArea != null && record.FunctionalArea.Count > 0) { WBLogging.Debug("Found functional area = " + record.FunctionalArea); WBTerm functionalArea = record.FunctionalArea[0]; location = functionalArea.FullPath; WBLogging.Debug("location = " + location); WBTermCollection <WBTerm> teamsFunctionalAreas = team.FunctionalArea(functionalAreas); if (!teamsFunctionalAreas.Contains(functionalArea)) { WBLogging.Debug("Team functional areas UIControlValue: " + teamsFunctionalAreas.UIControlValue); WBLogging.Debug("Record's functional area UIControlValue: " + functionalArea); AccessDeniedPanel.Visible = true; UpdateRecordsMetadataPanel.Visible = false; AccessDeniedReason.Text = "The team " + team.Name + " does not have permission to edit this functional area: " + functionalArea.Name; return; } } location += "/" + record.RecordsType.FullPath; String folders = record.ProtectedMasterRecord.LibraryRelativePath.Replace(record.Name, "").Replace(location, ""); RecordsLocation.Text = "<b>" + location + "</b> " + folders; String status = record.RecordSeriesStatus; RecordSeriesStatus.Text = status; String explainStatus = ""; if (status == "Latest") { if (record.ProtectiveZone == WBRecordsType.PROTECTIVE_ZONE__PUBLIC) { explainStatus = "(live on the public website)"; } else if (record.ProtectiveZone == WBRecordsType.PROTECTIVE_ZONE__PUBLIC_EXTRANET) { explainStatus = "(live on a public extranet website)"; } else { explainStatus = "(live on izzi intranet)"; } } else if (status == "Retired") { explainStatus = "(visible on izzi intranet searches)"; } else if (status == "Archived") { explainStatus = "(archived in the protected, master records library)"; } ExplainStatus.Text = explainStatus; RecordSeriesStatusChange.DataSource = new String[] { "", "Retire", "Archive" }; RecordSeriesStatusChange.DataBind(); RecordSeriesStatusChange.SelectedValue = ""; ProtectiveZone.DataSource = new String[] { WBRecordsType.PROTECTIVE_ZONE__PROTECTED, WBRecordsType.PROTECTIVE_ZONE__PUBLIC }; ProtectiveZone.DataBind(); ProtectiveZone.SelectedValue = record.ProtectiveZone; manager.SubjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTags, WBColumn.SubjectTags.DisplayName, true); SubjectTags.Text = record.SubjectTagsUIControlValue; manager.TeamsTaxonomy.InitialiseTaxonomyControl(OwningTeam, WBColumn.OwningTeam.DisplayName, false); OwningTeam.Text = record.OwningTeam.UIControlValue; manager.TeamsTaxonomy.InitialiseTaxonomyControl(InvolvedTeams, WBColumn.InvolvedTeams.DisplayName, true); InvolvedTeams.Text = record.InvolvedTeamsWithoutOwningTeamAsUIControlValue; } } }