diff --git a/src/org/labkey/workflow/view/WorkflowViewBase.java b/src/org/labkey/workflow/view/WorkflowViewBase.java index 72454d8..0411536 100644 --- a/src/org/labkey/workflow/view/WorkflowViewBase.java +++ b/src/org/labkey/workflow/view/WorkflowViewBase.java @@ -22,6 +22,8 @@ import org.labkey.api.data.Container; import org.labkey.api.jsp.JspBase; import org.labkey.api.util.DateUtil; +import org.labkey.api.util.HtmlString; +import org.labkey.api.util.HtmlStringBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.StringUtilsLabKey; import org.labkey.api.view.ActionURL; @@ -188,25 +190,28 @@ else if (variables.get(key) instanceof Date) } - public String navigationLinks(@Nullable String processDefinitionName, @NotNull String processDefinitionKey, @Nullable String processInstanceId) + public HtmlString navigationLinks(@Nullable String processDefinitionName, @NotNull String processDefinitionKey, @Nullable String processInstanceId) { - StringBuilder builder = new StringBuilder(); + HtmlStringBuilder builder = HtmlStringBuilder.of(); + builder.append(PageFlowUtil.link("All workflows").href(new ActionURL(WorkflowController.BeginAction.class, getContainer()))); - builder.append("\n  \n"); + builder.append(HtmlString.NBSP).append(HtmlString.NBSP); if (processDefinitionName != null) { builder.append(PageFlowUtil.link(processDefinitionName).href(new ActionURL(WorkflowController.SummaryAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey))); - builder.append("\n  \n"); + builder.append(HtmlString.NBSP).append(HtmlString.NBSP); + } builder.append(PageFlowUtil.link("Process instance list").href(new ActionURL(WorkflowController.InstanceListAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey))); - builder.append("\n  \n"); + builder.append(HtmlString.NBSP).append(HtmlString.NBSP); + if (processInstanceId != null) { builder.append(PageFlowUtil.link("This Process Instance").href(new ActionURL(WorkflowController.ProcessInstanceAction.class, getContainer()).addParameter("processInstanceId", processInstanceId))); - builder.append("\n  \n"); + builder.append(HtmlString.NBSP).append(HtmlString.NBSP); } builder.append(PageFlowUtil.link("My tasks").href(new ActionURL(WorkflowController.TaskListAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey).addParameter("assignee", getUser().getUserId()))); - return builder.toString(); + return builder.getHtmlString(); } } diff --git a/src/org/labkey/workflow/view/workflowList.jsp b/src/org/labkey/workflow/view/workflowList.jsp index 0bcc57d..664cc60 100644 --- a/src/org/labkey/workflow/view/workflowList.jsp +++ b/src/org/labkey/workflow/view/workflowList.jsp @@ -34,7 +34,7 @@ %> -<%= unsafe(navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null)) %> +<%= navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null) %>

@@ -49,5 +49,5 @@ <% } %> -<%= unsafe(navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null)) %> +<%= navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null) %> diff --git a/src/org/labkey/workflow/view/workflowProcessInstance.jsp b/src/org/labkey/workflow/view/workflowProcessInstance.jsp index f4a1c70..db985f6 100644 --- a/src/org/labkey/workflow/view/workflowProcessInstance.jsp +++ b/src/org/labkey/workflow/view/workflowProcessInstance.jsp @@ -57,7 +57,7 @@ There is no active process with id <%= h(bean.getId()) %> else { %> -<%= unsafe(navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null)) %> +<%= navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null) %>

diff --git a/src/org/labkey/workflow/view/workflowProcessStart.jsp b/src/org/labkey/workflow/view/workflowProcessStart.jsp index a2998c0..6222b5e 100644 --- a/src/org/labkey/workflow/view/workflowProcessStart.jsp +++ b/src/org/labkey/workflow/view/workflowProcessStart.jsp @@ -43,7 +43,7 @@ %> -<%= unsafe(navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null)) %> +<%= navigationLinks(bean.getProcessDefinitionName(), bean.getProcessDefinitionKey(), null) %>

<% if (!bean.isDeployed(getContainer())) diff --git a/src/org/labkey/workflow/view/workflowTask.jsp b/src/org/labkey/workflow/view/workflowTask.jsp index ec078f7..f6aaacd 100644 --- a/src/org/labkey/workflow/view/workflowTask.jsp +++ b/src/org/labkey/workflow/view/workflowTask.jsp @@ -49,7 +49,7 @@ String changeAssigneeLabel = bean.getAssigneeId() == null ? "Assign" : "Reassign"; boolean canChangeAssignee = bean.canClaim(getUser(), getContainer()) || (bean.isDelegated() && bean.canDelegate(getUser(), getContainer())) || bean.canAssign(getUser(), getContainer()); %> -<%= unsafe(navigationLinks(bean.getProcessDefinitionName(getContainer()), bean.getProcessDefinitionKey(getContainer()), bean.getProcessInstanceId())) %> +<%= navigationLinks(bean.getProcessDefinitionName(getContainer()), bean.getProcessDefinitionKey(getContainer()), bean.getProcessInstanceId()) %>