Esempio n. 1
0
        protected void saveButton_OnClick(object sender, EventArgs e)
        {
            WBLogging.Debug("In TeamManagement.saveButton_OnClick(): just started");

            WBTeam team = teams.GetSelectedTeam(AllTeamsTreeView.SelectedNode.ValuePath);

            team.Name    = TeamName.Text;
            team.Acronym = TeamAcronym.Text;

            WBLogging.Debug("Set name and acronym");

            team.UseAllFunctionalAreas        = UseAllFunctionalAreas.Checked;
            team.FunctionalAreaUIControlValue = TeamFunctionalAreas.Text;

            team.TeamSiteUrl = TeamsSiteURL.Text;

            WBLogging.Debug("About to set manager");

            team.SetInformationAssetOwner(InformationAssetOwner.WBxGetSingleResolvedUser(SPContext.Current.Web));
            team.SetManager(SPContext.Current.Site, TeamManager.WBxGetSingleResolvedUser(SPContext.Current.Web));

            WBLogging.Debug("Set manager");

            team.OwnersGroupName     = WBUtils.EntitiesToPropertyString(TeamOwnersSharePointUserGroup.ResolvedEntities, 1);
            team.MembersGroupName    = WBUtils.EntitiesToPropertyString(TeamMembersSharePointUserGroup.ResolvedEntities, 1);
            team.PublishersGroupName = WBUtils.EntitiesToPropertyString(TeamPublishersSharePointUserGroup.ResolvedEntities, 1);

            WBLogging.Debug("In TeamManagement.saveButton_OnClick(): OwnersGroupName is now = " + team.OwnersGroupName);
            WBLogging.Debug("In TeamManagement.saveButton_OnClick(): MembersGroupName is now = " + team.MembersGroupName);
            WBLogging.Debug("In TeamManagement.saveButton_OnClick(): PublishersGroupName is now = " + team.PublishersGroupName);

            team.RecordsTypesListUrl         = RecordsTypesListUrl.Text;
            team.CommonActivitiesListUrl     = CommonActivitiesListUrl.Text;
            team.FunctionalActivitiesListUrl = FunctionalActivitiesListUrl.Text;

            team.Update();
            updatePanelWithTeamDetails(team);

            popupMessageOnUpdate("Changes saved OK.");

            WBUtils.logMessage("Clicked Save Changes with TeamsSiteURL.Text = " + TeamsSiteURL.Text);
            WBUtils.logMessage("... and selected path: " + AllTeamsTreeView.SelectedNode.ValuePath);
        }
Esempio n. 2
0
        protected void okButton_OnClick(object sender, EventArgs e)
        {
            SPSite site = SPContext.Current.Site;
            SPWeb  web  = SPContext.Current.Web;

            WBTaxonomy teams = WBTaxonomy.GetTeams(site);

            WBTeam team = null;

            if (TeamTerm.Enabled)
            {
                if (TeamTerm.Text != "" && ParentTeamTerm.Text != "")
                {
                    TeamTermStatus.Text = "You can only select either a direct term or the parent term, not both!";
                    return;
                }

                if (TeamTerm.Text == "" && ParentTeamTerm.Text == "")
                {
                    TeamTermStatus.Text = "You must select either a direct term or the parent term.";
                    return;
                }

                if (TeamTerm.Text != "")
                {
                    team = new WBTeam(teams, TeamTerm.Text);
                }
                else
                {
                    if (ParentTeamTerm.Text != "")
                    {
                        WBTerm parent = new WBTerm(teams, ParentTeamTerm.Text);

                        Term newTerm = parent.Term.CreateTerm(web.Title, WorkBox.LOCALE_ID_ENGLISH);
                        team = new WBTeam(teams, newTerm);
                    }
                }

                team.OwnersGroupName  = WBUtils.EntitiesToPropertyString(TeamOwnersSharePointUserGroup.ResolvedEntities, 1);
                team.MembersGroupName = WBUtils.EntitiesToPropertyString(TeamMembersSharePointUserGroup.ResolvedEntities, 1);
                team.TeamSiteUrl      = web.Url;
            }
            else
            {
                team = WBTeam.GetFromTeamSite(teams, web);
            }

            if (team == null)
            {
                TeamTermStatus.Text = "Had a problem finding or creating the term!";
                return;
            }

            team.Name    = TeamName.Text;
            web.Title    = TeamName.Text;
            team.Acronym = TeamAcronym.Text;

            team.SetInformationAssetOwner(InformationAssetOwner.WBxGetSingleResolvedUser(web));
            team.SetManager(site, TeamManager.WBxGetSingleResolvedUser(web));

            team.PublishersGroupName = WBUtils.EntitiesToPropertyString(TeamPublishersSharePointUserGroup.ResolvedEntities, 1);
            team.RecordsTypesListUrl = RecordsTypesListUrl.Text;

            if (!String.IsNullOrEmpty(TeamFunctionalAreas.Text))
            {
                team.FunctionalAreaUIControlValue = TeamFunctionalAreas.Text;
            }
            team.UseAllFunctionalAreas = UseAllFunctionalAreas.Checked;


            // This will actually update the web as well as the term.
            team.UpdateWithTeamSiteWeb(web);

            SPUtility.Redirect("settings.aspx", SPRedirectFlags.RelativeToLayoutsPage, Context);
        }