<h2>{i18n}New State{/i18n}</h2>

<p class="descriptiveText">{i18n}As documents move through their lifecycle, they
are placed in certain <strong>states</strong>.  For example, an invoice
which has been mailed might be in the "Pending" <strong>state</strong> after
the "sent" <strong>transition</strong> has been performed by a user.{/i18n}</p>

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Create a new state{/i18n}</legend>

<p class="descriptiveText">{i18n}Please note that additional configuration is
possible on states beyond what is specified here (e.g. which users to notify
about the document, etc).  Please edit the state
to access and modify these other properties.{/i18n}</p>

<input type="hidden" name="action" value="newState" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />

{* Standard Form *}

{foreach item=oWidget from=$add_fields}
  {$oWidget->render()}
{/foreach}

{*

<div class="field">
<label>{i18n}Informed Users{/i18n}</label>
<p class="descriptiveText">{i18n}Please select which roles or groups should be
informed when this state is reached.{/i18n}</p>


{if $aRoles}
<p>{i18n}Roles{/i18n}</p>
{entity_checkboxes entities=$aRoles name="fRoleIds" multiple="true" selected=$aInformed.role assign=aBoxes}
{foreach from=$aBoxes item=sBox}
{$sBox}
{/foreach}
{/if}

<p>{i18n}Groups{/i18n}</p>
{entity_checkboxes entities=$aGroups name="fGroupIds" multiple="true" selected=$aInformed.group assign=aBoxes}
{foreach from=$aBoxes item=sBox}
{$sBox}
{/foreach}
</div>

*}

<div class="field">
<label>{i18n}Actions Allowed{/i18n}</label>
<p class="descriptiveText">{i18n}Workflows can control which actions (edit metadata,
download, etc.) are available on a given document.  Please specify which of
the actions controlled by this workflow are available when the document is in
this state.{/i18n}</p>
{if (!empty($aActions))}

{entity_checkboxes name="fActions" entities=$aActions idmethod="getName" method="getDisplayName" assign="aCheckboxes" selected="$aActionsSelected"}
{foreach from=$aCheckboxes item=sCheckbox}
{$sCheckbox}
{/foreach}


{else}
<div class="ktInfoMessage"<span>{i18n}No actions are controlled by this workflow.{/i18n}</span></div>
{/if}
</div>

<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Create state{/i18n}" />
</div>

</fieldset>

