documentWorkflow.smarty 1.3 KB
<h1>Document Workflow</h1>

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

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

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

{else}

<h2>Current workflow settings</h2>

<table class="prettysw" cellpadding="0" cellspacing="0">
<tr><th>Workflow</th><td>{$oWorkflow->getName()}</td></tr>
<tr><th>State</th><td>{$oState->getName()}</td></tr>
</table>

<h2>Transition to another workflow state</h2>

<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="action" value="performTransition" />
<input type="hidden" name="fDocumentId" value="{$oDocument->getId()}" />
<table class="prettysw" cellpadding="0" cellspacing="0">
<tr><th>Transition to perform</th><td>
{entity_radios entities=$aTransitions name=fTransitionId assign=aRadio method=showDescription}
{foreach from=$aRadio item=sRadio}
{$sRadio}<br />
{/foreach}
</td></tr>
<tr><th>Reason for transition</th><td><input type="textbox" name="fComments"
/></td></tr>
</table>
<input type="submit" name="submit" value="Perform Transition" />
</form>


{/if}