documentWorkflow.smarty 1.42 KB
<h2>Document Workflow</h2>

<p class="descriptiveText">
Workflow is a description of a document's lifecycle.  It is made up of
workflow states, which describe where in the lifecycle the document is,
and workflow transitions, which describe the next steps within the
lifecycle of the document.
</p>

{if !$oWorkflow}
<h3>No workflow</h3>

<p>Document has no assigned workflow.</p>

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset><legend>Start workflow on document</legend>
<input type="hidden" name="action" value="startWorkflow" />
<input type="hidden" name="fDocumentId" value="{$oDocument->getId()}" />
{entity_select entities=$aWorkflows name=fWorkflowId}
<div class="form_actions">
<input type="submit" name="submit" value="Start Workflow" />
</div>
</fieldset>
</form>

{else}

<h3>Current workflow settings</h3>

<dl class="metadata">
<dt>Workflow</dt><dd>{$oWorkflow->getName()}</dd>
<dt>State</dt><dd>{$oState->getName()}</dd>
</dl>

{if $aTransitions}
<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="action" value="performTransition" />
<input type="hidden" name="fDocumentId" value="{$oDocument->getId()}" />
<fieldset><legend>Transition to another workflow state</legend>
{foreach from=$transition_fields item=oWidget }
  {$oWidget->render()}
{/foreach}
<div class="form_actions">
<input type="submit" name="submit" value="Perform Transition" />
</div>
</fieldset>
</form>
{/if}

{/if}