protected void Page_Load(object sender, EventArgs e)
        {
            actions = new Dictionary <String, WBAction>();
            List <String> actionKeys = WBAction.GetKeysForEditableRibbonTabButtons();

            foreach (string key in actionKeys)
            {
                actions.Add(key, new WBAction(key));
            }

            Table table = new Table();

            table.Width = Unit.Percentage(100);

            TableRow headers = new TableRow();

            headers.WBxAddTableHeaderCell("Label");
            headers.WBxAddTableHeaderCell("Icon");
            headers.WBxAddTableHeaderCell("Is Enabled?");
            headers.WBxAddTableHeaderCell("Allow Owners?");
            headers.WBxAddTableHeaderCell("Allow Involved?");
            headers.WBxAddTableHeaderCell("Allow Visitors?");
            headers.WBxAddTableHeaderCell("Is Modal?");
            headers.WBxAddTableHeaderCell("Show Close?");
            headers.WBxAddTableHeaderCell("Allow Maximise?");
            headers.WBxAddTableHeaderCell("Action URL");
            headers.WBxAddTableHeaderCell("Width");
            headers.WBxAddTableHeaderCell("Height");
            headers.WBxAddTableHeaderCell("Revert To Defaults?");

            table.Rows.Add(headers);

            foreach (WBAction action in actions.Values)
            {
                table.Rows.Add(action.CreateEditableTableRow());
            }

            EditActionsTable.Controls.Add(table);

            if (!IsPostBack)
            {
                using (WBCollection collection = new WBCollection(SPContext.Current))
                {
                    foreach (WBAction action in actions.Values)
                    {
                        string propertyValue = collection.Web.WBxGetProperty(action.PropertyKey);
                        action.SetFromPropertyValue(propertyValue);

                        action.SetControlValues();
                    }
                }

                ReturnUrl.Value = Request.QueryString["ReturnUrl"];
            }
        }
Esempio n. 2
0
        protected void editButton_OnClick(object sender, EventArgs e)
        {
            WBAction editAction = WorkBox.GetAction(WBAction.ACTION_KEY__EDIT_PROPERTIES);

            if (editAction.IsEnabled)
            {
                SPUtility.Redirect(editAction.ActionUrl, SPRedirectFlags.Trusted, Context);
            }
            else
            {
                ErrorMessageLabel.Text = "You don't have permission to edit the work box properties";
            }

            //WBLogging.Debug("Got an action URL for edit page as being: " + editAction.ActionUrl);
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WBRecordsType recordsType = WorkBox.RecordsType;

            if (recordsType.WorkBoxReferenceIDRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN)
            {
                showReferenceID = true;
            }

            if (recordsType.WorkBoxReferenceDateRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN)
            {
                showReferenceDate = true;
            }

            if (!IsPostBack)
            {
                WorkBoxTitle.Text       = WorkBox.Title;
                OwningTeam.Text         = WorkBox.OwningTeam.Name;
                FunctionalArea.Text     = WorkBox.FunctionalArea(WBTaxonomy.GetFunctionalAreas(WorkBox.RecordsTypes)).Names();
                RecordsType.Text        = recordsType.FullPath;
                WorkBoxTemplate.Text    = WorkBox.Template.Title;
                WorkBoxStatus.Text      = WorkBox.Status;
                WorkBoxURL.Text         = WorkBox.Url;
                WorkBoxShortTitle.Text  = WorkBox.ShortTitle;
                WorkBoxPrettyTitle.Text = WorkBox.Web.Title;

                if (showReferenceID)
                {
                    ReferenceID.Text = WorkBox.ReferenceID;
                }

                if (showReferenceDate)
                {
                    if (WorkBox.ReferenceDateHasValue)
                    {
                        ReferenceDate.Text = WorkBox.ReferenceDate.ToShortDateString();
                    }
                }

                WBAction editAction = WorkBox.GetAction(WBAction.ACTION_KEY__EDIT_PROPERTIES);
                EditButton.Enabled = editAction.IsEnabled;
            }
        }
Esempio n. 4
0
        private void generateTableOfAllInvolved()
        {
            WBAction inviteIndividualsAction = WorkBox.GetAction(WBAction.ACTION_KEY__INVITE_INDIVIDUALS);

            if (inviteIndividualsAction.IsEnabled)
            {
                currentUserCanRemoveIndividuals = true;
            }

            WBAction inviteTeamsAction = WorkBox.GetAction(WBAction.ACTION_KEY__INVITE_TEAMS);

            if (inviteTeamsAction.IsEnabled)
            {
                currentUserCanRemoveTeams = true;
            }

            SPServiceContext   serviceContext = SPServiceContext.GetContext(SPContext.Current.Site);
            UserProfileManager profileManager = new UserProfileManager(serviceContext);

            Dictionary <String, String> headers = new Dictionary <String, String>();

            headers.Add("body", "\n\nWork Box Title: " + WorkBox.Title + "\nWork Box URL: " + WorkBox.Url);

            string html = "<p>Users Involved with <b>" + WorkBox.Title + "</b></p>\n";

            html += "<table class=\"wbf-dialog-form\">\n";

            if (WorkBox.OwningTeam != null)
            {
                html += "<tr><td class=\"wbf-field-name-panel wbf-wider\"><b>Owning Team:</b><ul><li>";

                html += WBUtils.GenerateLinkToEmailGroup("Email work box owners", WorkBox.GetAllOwners(SPContext.Current.Site).WBxToEmails(), headers);

                html += "</li></ul></td><td class=\"wbf-field-value-panel\">\n";

                html += renderTeamAsFieldSet(profileManager, SPContext.Current.Site, WorkBox.OwningTeam);

                html += "</td></tr>\n";
            }


            html += "<tr><td class=\"wbf-field-name-panel wbf-wider\"><b>Involved Teams:</b><ul><li>";

            html += WBUtils.GenerateLinkToEmailGroup("Email all involved with work box", WorkBox.GetAllInvolved(SPContext.Current.Site).WBxToEmails(), headers);

            html += "</li></ul></td><td class=\"wbf-field-value-panel\">\n";

            if (WorkBox.InvolvedTeams != null && WorkBox.OwningTeam != null)
            {
                foreach (WBTeam involved in WorkBox.InvolvedTeams)
                {
                    if (involved.Id.Equals(WorkBox.OwningTeam.Id))
                    {
                        continue;
                    }

                    html += renderTeamAsFieldSet(profileManager, SPContext.Current.Site, involved, "Involved");
                }
            }

            html += "</td></tr>\n";

            html += "<tr><td class=\"wbf-field-name-panel wbf-wider\"><b>Involved Individuals:</b></td><td class=\"wbf-field-value-panel\"><ul>\n";

            if (WorkBox.InvolvedIndividuals != null)
            {
                foreach (SPUser user in WorkBox.InvolvedIndividuals)
                {
                    html += "<li>" + renderUser(profileManager, user, "Involved") + "</li>";
                }
            }

            html += "</ul>";
            html += "</td></tr>\n";


            html += "<tr><td class=\"wbf-field-name-panel wbf-wider\"><b>Visiting Teams:</b><ul><li>";

            html += WBUtils.GenerateLinkToEmailGroup("Email everyone who can visit the work box", WorkBox.GetAllWhoCanVisit(SPContext.Current.Site).WBxToEmails(), headers);

            html += "</li></ul></td><td class=\"wbf-field-value-panel\">\n";

            if (WorkBox.VisitingTeams != null)
            {
                foreach (WBTeam visiting in WorkBox.VisitingTeams)
                {
                    html += renderTeamAsFieldSet(profileManager, SPContext.Current.Site, visiting, "Visiting");
                }
            }

            html += "</td></tr>\n";

            html += "<tr><td class=\"wbf-field-name-panel wbf-wider\"><b>Visiting Individuals:</b></td><td class=\"wbf-field-value-panel\"><ul>\n";

            if (WorkBox.VisitingIndividuals != null)
            {
                foreach (SPUser user in WorkBox.VisitingIndividuals)
                {
                    html += "<li>" + renderUser(profileManager, user, "Visiting") + "</li>";
                }
            }

            html += "</ul>";
            html += "</td></tr>\n";


            html += "</table>\n";

            GeneratedViewOfAllInvolved.Text = html;
        }