protected virtual void DisplayStates(IWorkflow workflow, XmlControl placeholder)
 {
     this._stateNames = null;
     foreach (WorkflowState state in workflow.GetStates())
     {
         if (WorkflowFilterer.FilterVisibleCommands(workflow.GetCommands(state.StateID)).Length > 0)
         {
             string    str2;
             DataUri[] items    = this.GetItems(state, workflow);
             string    str      = ShortID.Encode(workflow.WorkflowID) + "_" + ShortID.Encode(state.StateID);
             Section   section2 = new Section
             {
                 ID = str + "_section"
             };
             Section control = section2;
             control.Attributes["Width"] = "100%";
             placeholder.AddControl(control);
             int length = items.Length;
             if (length <= 0)
             {
                 str2 = Translate.Text("None");
             }
             else if (length == 1)
             {
                 str2 = string.Format("1 {0}", Translate.Text("item"));
             }
             else
             {
                 str2 = string.Format("{0} {1}", length, Translate.Text("items"));
             }
             str2           = string.Format("<span style=\"font-weight:normal\"> - ({0})</span>", str2);
             control.Header = state.DisplayName + str2;
             control.Icon   = state.Icon;
             if (Settings.ClientFeeds.Enabled)
             {
                 FeedUrlOptions options2 = new FeedUrlOptions("/sitecore/shell/~/feed/workflowstate.aspx")
                 {
                     UseUrlAuthentication = true
                 };
                 FeedUrlOptions options = options2;
                 options.Parameters["wf"] = workflow.WorkflowID;
                 options.Parameters["st"] = state.StateID;
                 control.FeedLink         = options.ToString();
             }
             control.Collapsed = length <= 0;
             Border child = new Border();
             control.Controls.Add(child);
             child.ID = str + "_content";
             this.DisplayState(workflow, state, items, child, 0, this.PageSize);
             this.CreateNavigator(control, str + "_navigator", length);
         }
     }
 }
        private void CreateCommand(IWorkflow workflow, WorkflowCommand command, Item item, XmlControl workboxItem)
        {
            XmlControl webControl = Resource.GetWebControl("WorkboxCommand") as XmlControl;

            webControl["Header"] = command.DisplayName;
            webControl["Icon"]   = command.Icon;
            CommandBuilder builder = new CommandBuilder("workflow:send");

            builder.Add("id", item.ID.ToString());
            builder.Add("la", item.Language.Name);
            builder.Add("vs", item.Version.ToString());
            builder.Add("command", command.CommandID);
            builder.Add("wf", workflow.WorkflowID);
            builder.Add("ui", command.HasUI);
            builder.Add("suppresscomment", command.SuppressComment);
            webControl["Command"] = builder.ToString();
            workboxItem.AddControl(webControl);
        }
Exemple #3
0
 /// <summary>
 /// Creates the command.
 /// </summary>
 /// <param name="workflow">
 /// The workflow.
 /// </param>
 /// <param name="command">
 /// The command.
 /// </param>
 /// <param name="item">
 /// The item.
 /// </param>
 /// <param name="workboxItem">
 /// The workbox item.
 /// </param>
 private void CreateCommand(IWorkflow workflow, WorkflowCommand command, Item item, XmlControl workboxItem)
 {
     Assert.ArgumentNotNull(workflow, "workflow");
     Assert.ArgumentNotNull(command, "command");
     Assert.ArgumentNotNull(item, "item");
     Assert.ArgumentNotNull(workboxItem, "workboxItem");
     XmlControl webControl = Resource.GetWebControl("WorkboxCommand") as XmlControl;
     Assert.IsNotNull(webControl, "workboxCommand is null");
     webControl["Header"] = command.DisplayName;
     webControl["Icon"] = command.Icon;
     CommandBuilder commandBuilder = new CommandBuilder("workflow:send");
     commandBuilder.Add("id", item.ID.ToString());
     commandBuilder.Add("la", item.Language.Name);
     commandBuilder.Add("vs", item.Version.ToString());
     commandBuilder.Add("command", command.CommandID);
     commandBuilder.Add("wf", workflow.WorkflowID);
     commandBuilder.Add("ui", command.HasUI);
     commandBuilder.Add("suppresscomment", command.SuppressComment);
     webControl["Command"] = commandBuilder.ToString();
     workboxItem.AddControl(webControl);
 }
Exemple #4
0
 /// <summary>
 /// Displays the states.
 /// </summary>
 /// <param name="workflow">
 /// The workflow.
 /// </param>
 /// <param name="placeholder">
 /// The placeholder.
 /// </param>
 protected virtual void DisplayStates(IWorkflow workflow, XmlControl placeholder)
 {
     string str;
     Assert.ArgumentNotNull(workflow, "workflow");
     Assert.ArgumentNotNull(placeholder, "placeholder");
     this.stateNames = null;
     WorkflowState[] states = workflow.GetStates();
     for (int i = 0; i < (int)states.Length; i++)
     {
         WorkflowState workflowState = states[i];
         WorkflowCommand[] workflowCommandArray = WorkflowFilterer.FilterVisibleCommands(workflow.GetCommands(workflowState.StateID));
         if ((int)workflowCommandArray.Length > 0)
         {
             DataUri[] items = this.GetItems(workflowState, workflow);
             Assert.IsNotNull(items, "items is null");
             string str1 = string.Concat(ShortID.Encode(workflow.WorkflowID), "_", ShortID.Encode(workflowState.StateID));
             Section section = new Section();
             section.ID = string.Concat(str1, "_section");
             Section icon = section;
             placeholder.AddControl(icon);
             int length = (int)items.Length;
             if (length > 0)
             {
                 str = (length != 1 ? string.Format("{0} {1}", length, Translate.Text("items")) : string.Format("1 {0}", Translate.Text("item")));
             }
             else
             {
                 str = "none";
             }
             str = string.Format("<span style=\"font-weight:normal\"> - ({0})</span>", str);
             icon.Header = string.Concat(workflowState.DisplayName, str);
             icon.Icon = workflowState.Icon;
             if (Settings.ClientFeeds.Enabled)
             {
                 FeedUrlOptions feedUrlOption = new FeedUrlOptions("/sitecore/shell/~/feed/workflowstate.aspx");
                 feedUrlOption.UseUrlAuthentication = true;
                 FeedUrlOptions workflowID = feedUrlOption;
                 workflowID.Parameters["wf"] = workflow.WorkflowID;
                 workflowID.Parameters["st"] = workflowState.StateID;
                 icon.FeedLink = workflowID.ToString();
             }
             icon.Collapsed = length <= 0;
             Border border = new Border();
             icon.Controls.Add(border);
             border.ID = string.Concat(str1, "_content");
             this.DisplayState(workflow, workflowState, items, border, 0, this.PageSize);
             this.CreateNavigator(icon, string.Concat(str1, "_navigator"), length);
         }
     }
 }
 protected virtual void DisplayStates(IWorkflow workflow, XmlControl placeholder)
 {
     this._stateNames = null;
     foreach (WorkflowState state in workflow.GetStates())
     {
         if (WorkflowFilterer.FilterVisibleCommands(workflow.GetCommands(state.StateID)).Length > 0)
         {
             string str2;
             DataUri[] items = this.GetItems(state, workflow);
             string str = ShortID.Encode(workflow.WorkflowID) + "_" + ShortID.Encode(state.StateID);
             Section section2 = new Section
             {
                 ID = str + "_section"
             };
             Section control = section2;
             control.Attributes["Width"] = "100%";
             placeholder.AddControl(control);
             int length = items.Length;
             if (length <= 0)
             {
                 str2 = Translate.Text("None");
             }
             else if (length == 1)
             {
                 str2 = string.Format("1 {0}", Translate.Text("item"));
             }
             else
             {
                 str2 = string.Format("{0} {1}", length, Translate.Text("items"));
             }
             str2 = string.Format("<span style=\"font-weight:normal\"> - ({0})</span>", str2);
             control.Header = state.DisplayName + str2;
             control.Icon = state.Icon;
             if (Settings.ClientFeeds.Enabled)
             {
                 FeedUrlOptions options2 = new FeedUrlOptions("/sitecore/shell/~/feed/workflowstate.aspx")
                 {
                     UseUrlAuthentication = true
                 };
                 FeedUrlOptions options = options2;
                 options.Parameters["wf"] = workflow.WorkflowID;
                 options.Parameters["st"] = state.StateID;
                 control.FeedLink = options.ToString();
             }
             control.Collapsed = length <= 0;
             Border child = new Border();
             control.Controls.Add(child);
             child.ID = str + "_content";
             this.DisplayState(workflow, state, items, child, 0, this.PageSize);
             this.CreateNavigator(control, str + "_navigator", length);
         }
     }
 }