我正在尝试配置查看工作流程详细信息时显示的表单。我可以生成一个自定义表单,但是"一般信息"仍显示默认表单附带的部分。我不希望它被显示出来。我的配置如下:
<config evaluator="task-type" condition="vorwf:allocateDocumentProperties" replace="true">
<forms>
<form id="workflow-details">
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="vorwf:author" />
<show id="vorwf:reviewer" />
<show id="vorwf:approver" />
<show id="vorwf:prevComment" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="transitions" />
</field-visibility>
<appearance>
<set id="information" appearance="title" label="Workflow Information" />
<set id="wfinfo" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignees" appearance="title" label="Assignees" template="/org/alfresco/components/form/3-column-set.ftl" />
<set id="items" appearance="title" label="Workflow Documents" />
<set id="outcome" appearance="" />
<field id="bpm:workflowDescription" label="Message" set="information" read-only="true">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label="Due Date" set="wfinfo" read-only="true">
<control template="/org/alfresco/components/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
<control-param name="submitTime">false</control-param>
</control>
</field>
<field id="bpm:workflowPriority" label="Priority" set="wfinfo" read-only="true">
<control template="controls/workflow/priority.ftl" />
</field>
<field id="vorwf:prevComment" label="Comments from workflow initiator" set="wfinfo" read-only="true">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="saveLineBreaks">true</control-param>
</control>
</field>
<field id="vorwf:author" label="Book Captain" set="assignees">
<control template="/org/alfresco/components/form/controls/authority.ftl" /><!--authority.ftl used for selecting assignees-->
</field>
<field id="vorwf:reviewer" label="Reviewer" set="assignees" >
<control template="/org/alfresco/components/form/controls/authority.ftl" />
</field>
<field id="vorwf:approver" label="Authoriser" set="assignees" >
<control template="/org/alfresco/components/form/controls/authority.ftl" />
</field>
<field id="packageItems" set="items" />
<field id="bpm:comment" label="Comments" set="outcome" >
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="saveLineBreaks">true</control-param>
</control>
</field>
<field id="transitions" set="outcome" />
</appearance>
</form>
</forms>
</config>
如果有任何想法请告诉我!
答案 0 :(得分:0)
基本上你需要从共享webscript中删除它。这不是从表单配置中加载的。
以下是负责加载General Info
部分的文件。
请找到评论“需要删除下面的html元素”并删除该元素。
你还需要从javascript文件中删除代码。因为javascript文件中有一个ajax调用,它正在设置这些元素的数据。如果你没有更新javacript文件,它可能会抛出一个异常,可能会停止渲染表单。< / p>
<@markup id="css" >
<#-- CSS Dependencies -->
<#include "../form/form.css.ftl"/>
<@link href="${url.context}/res/components/workflow/workflow-form.css" group="workflow"/>
<#-- Global Folder Picker (req'd by Copy/Move To) -->
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/documentlibrary/global-folder.css" />
<#-- Cloud Authentication -->
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/cloud/cloud-auth-form.css" />
<#-- Cloud Folder Picker -->
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/cloud/cloud-folder-picker.css" />
<#-- Cloud Sync Status -->
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/cloud/cloud-sync-status.css" />
</@>
<@markup id="js">
<#-- JavaScript Dependencies -->
<#include "../form/form.js.ftl"/>
<@script src="${url.context}/res/components/workflow/workflow-form.js" group="workflow"/>
<@script src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="workflow" />
<@script src="${url.context}/res/modules/simple-dialog.js" group="workflow"/>
<@script src="${url.context}/res/modules/documentlibrary/global-folder.js" group="workflow" />
<@script src="${url.context}/res/modules/documentlibrary/cloud-folder.js" group="workflow" />
<@script src="${url.context}/res/modules/cloud-auth.js" group="workflow" />
<@script src="${url.context}/res/components/common/common-component-style-filter-chain.js" group="workflow"/>
</@>
<@markup id="widgets">
<@createWidgets group="workflow"/>
</@>
<@markup id="html">
<@uniqueIdDiv>
<#assign el=args.htmlid?html>
<div id="${el}-body" class="workflow-form"></div>
<div class="hidden">
<#--
The workflow details page form is actually a form display of the workflow's start task AND data from the workflow itself.
The approach taken to mix all this information is described in the Alfresco.WorkflowForm javascript class.
-->
<#-- Will be inserted in the top of the form after its been loaded through ajax -->
<div id="${el}-summary-form-section">
<h3>
${msg("header.workflowSummary")}
</h3>
<div class="workflow-summary-buttons">
<button id="${el}-viewWorkflowDiagram" class="hidden">${msg("button.viewWorkflowDiagram")}</button>
</div>
<div class="form-element-background-color form-element-border summary">
<div class="summary-icons">
<h3>${msg("label.general")}</h3>
<div id="${el}-statusSummary" class="status"></div>
<div id="${el}-dueSummary" class="due"></div>
<div id="${el}-prioritySummary" class="priority"></div>
</div>
<div class="recent-task form-element-border">
<div class="yui-gc">
<div class="yui-u first">
<h3>${msg("label.mostRecentlyCompletedTask")}</h3>
</div>
<div class="yui-u current-tasks">
<a href="#current-tasks">${msg("link.viewCurrentTasks")}</a>
</div>
</div>
<div>
<a id="${el}-recentTaskTitle" href=""></a>
</div>
<div class="yui-gb">
<div class="yui-u first">
<span class="viewmode-label">${msg("label.completedOn")}:</span>
<span class="viewmode-value" id="${el}-recentTaskCompletedOn"></span>
</div>
<div class="yui-u">
<span class="viewmode-label">${msg("label.completedBy")}:</span>
<span class="viewmode-value" id="${el}-recentTaskCompletedBy"></span>
</div>
<div class="yui-u">
<span class="viewmode-label">${msg("label.outcome")}:</span>
<span class="viewmode-value" id="${el}-recentTaskOutcome"></span>
</div>
</div>
<div class="yui-gf">
<div class="yui-u first avatar">
<img id="${el}-recentTaskOwnersAvatar" src="" alt="${msg("label.avatar")}">
</div>
<div class="yui-u">
<div id="${el}-recentTaskOwnersCommentLink"></div>
<div id="${el}-recentTaskOwnersComment" class="task-comment form-element-border"></div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<#-- Will be inserted above "More Info" in the form after its been loaded through ajax -->
<#--Need to remove below html element-->
<div id="${el}-general-form-section">
<div class="set">
<div class="set-title">${msg("header.generalInfo")}</div>
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.title")}:</span>
<span class="viewmode-value" id="${el}-title"></span>
</div>
</div>
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.description")}:</span>
<span class="viewmode-value" id="${el}-description"></span>
</div>
</div>
<div class="yui-gb">
<div class="yui-u first">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.startedBy")}:</span>
<span class="viewmode-value" id="${el}-startedBy"></span>
</div>
</div>
</div>
<div class="yui-u">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.due")}:</span>
<span class="viewmode-value" id="${el}-due"></span>
</div>
</div>
</div>
<div class="yui-u">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.completed")}:</span>
<span class="viewmode-value" id="${el}-completed"></span>
</div>
</div>
</div>
</div>
<div class="yui-gb">
<div class="yui-u first">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.started")}:</span>
<span class="viewmode-value" id="${el}-started"></span>
</div>
</div>
</div>
<div class="yui-u">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.priority")}:</span>
<span class="viewmode-value" id="${el}-priority"></span>
</div>
</div>
</div>
<div class="yui-u">
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.status")}:</span>
<span class="viewmode-value" id="${el}-status"></span>
</div>
</div>
</div>
</div>
<div class="form-field">
<div class="viewmode-field">
<span class="viewmode-label">${msg("label.message")}:</span>
<span class="viewmode-value" id="${el}-message"></span>
</div>
</div>
</div>
</div>
<#-- Will be inserted below "Items" in the form after its been loaded through ajax -->
<div id="${el}-currentTasks-form-section" class="current-tasks">
<a name="current-tasks"></a>
<h3>${msg("header.currentTasks")}</h3>
<div class="form-element-background-color"></div>
</div>
<#-- Will be inserted in the bottom of the form after its been loaded through ajax -->
<div id="${el}-workflowHistory-form-section" class="workflow-history">
<h3>${msg("header.history")}</h3>
<div class="form-element-background-color"></div>
</div>
</div>
</@>
</@>