<h2>{i18n}Document Type{/i18n}: { $oDocumentType->getName() }</h2>

<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="action" value="editobject">
<input type="hidden" name="fDocumentTypeId" value="{$oDocumentType->getId()}">
<input type="textbox" name="name" value="{$sDocTypeName}">
<input type="submit" name="submit" value="{i18n}Change{/i18n}" />
</form>

<h2>{i18n}Type-specific field sets{/i18n}</h2>

<p class="descriptiveText"></p>

{ if $aCurrentFieldsets }
<form method="POST" action="{$smarty.server.PHP_SELF}">
<fieldset>
<legend>{i18n}Linked Fieldsets{/i18n}</legend>
  <input type="hidden" name="action" value="removefieldsets">
  <input type="hidden" name="fDocumentTypeId" value="{$oDocumentType->getId()}">

  <table class="listing">
  <thead>
     <tr>
        <th>{i18n}Fieldset{/i18n}</th>
     </tr>
  </thead>
  <tbody>
    {foreach from="$aCurrentFieldsets item=oFieldset}
      <tr>
        <td><label><input type="checkbox" name="fieldsetid[]" value="{$oFieldset->getId() }" />{$oFieldset->getName() }</label></td>
      </tr>
    {/foreach}
    
  </tbody>
  </table>
  <div class="form_actions">
  <input type="submit" name="submit" value="{i18n}Disassociate Fieldsets{/i18n}">
  </div>
</fieldset>
</form>
{else}
<div class="ktInfoMessage"><span>{i18n}No fieldsets are currently associated with this type.{/i18n}</span></div>
{ /if }

{ if $bAvailableFieldsets }
<form method="POST" action="{$smarty.server.PHP_SELF}">
<fieldset>
<legend>{i18n}Associate Fieldsets{/i18n}</legend>

  <input type="hidden" name="action" value="addfieldsets">
  <input type="hidden" name="fDocumentTypeId" value="{$oDocumentType->getId()}">
  
  {$availableWidget->render()}
  
  <div class="form_actions">
    <input type="submit" name="submit" value="{i18n}Associate Fieldsets{/i18n}" />
  </div>
</fieldset>
</form>
{elseif !$bAnyFieldsets}
<div class="ktInfoMessage"><span>{i18n}No fieldsets are available to be added.  To add a fieldset, please go to 
DMS Administration{/i18n} &raquo; {i18n}Document Metadata and Workflow Configuration{/i18n} &raquo {i18n}Document Field Management{/i18n} </span></div>
{ /if }
