<{include file="file:admin_header.html"}>
<script type="text/javascript" charset="utf-8">
var <{$dirname}>Edit = new XoonipsEdit.edit('<{$xoops_url}>', '<{$dirname}>', 'policy_itemtype_group_editform');
jQuery.noConflict();
jQuery(function(){
  <{$dirname}>Edit.sortable();
  jQuery('.<{$dirname}>_sortable tbody').bind('sortstop',function(event, ui){
    jQuery('#<{$dirname}>_op').attr('value','groupeditsave');
    jQuery('#<{$dirname}>_mode').attr('value','1');
    jQuery('#<{$dirname}>_policy_itemtype_group_editform').submit();
  });
});
function dconfirm(action){
  if(confirm('<{$smarty.const._AM_XOONIPS_MSG_DELETE_CONFIRM}>')) {
    var form=jQuery('#<{$dirname}>_policy_itemtype_group_editform');
    form.attr('action', action);
    jQuery('#<{$dirname}>_op').val('detaildelete');
    form.submit();
  }
  return false;
}
</script>
<{$errors}>
<div style="text-align:right; margin-left: 10px; margin-bottom: 25px;">
</div>
<form name="<{$dirname}>_policy_itemtype_group_editform" id="<{$dirname}>_policy_itemtype_group_editform" action="policy_itemtype.php?op=groupedit" method="post">
<input type="hidden" id="<{$dirname}>_op" name="op" value="update">
<input type="hidden" id="<{$dirname}>_mode" name="mode" value="">
<input type="hidden" name="itemtypeid" value="<{$itemtypeid}>">
<input type="hidden" name="base_itemtypeid" value="<{$base_itemtypeid}>">
<input type="hidden" name="groupid" value="<{$groupid}>">
<{$token_ticket}>
<table width="100%" cellspacing="1" class="outer">
  <{$smarty.const._AM_XOONIPS_POLICY_ITEMTYPE_TITLE}>&nbsp;&nbsp;<b><{$itemtype_name}></b>
  <thead>
  <tr>
    <th style="width: 20%; text-align: center;" class="head"><br /></th>
    <th style="width: 40%; text-align: center;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_MODIFY_CONTENT}></th>
    <th style="width: 40%; text-align: center;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_RELEASE_CONTENT}></th>
  </tr>
  </thead>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_GROUP_NAME}><{$smarty.const._AM_XOONIPS_LABEL_REQUIRED_MARK}></td>
    <td style="width: 40%; text-align: left;" class="odd">&nbsp;&nbsp;<input type="text" name="name" size="50" maxlength="255" value="<{$groupInfo.a_name|xoops_escape}>"></td>
    <td style="width: 40%; text-align: left;" class="odd">&nbsp;&nbsp;<{if $groupInfo.a_name!=$groupInfo.b_name}><span class="<{$dirname}>_diff"><{$groupInfo.b_name|xoops_escape}></span><{else}><{$groupInfo.b_name|xoops_escape}><{/if}></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_XML_TAG}><{$smarty.const._AM_XOONIPS_LABEL_REQUIRED_MARK}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<input type="text" name="xml" size="50" maxlength="30" value="<{$groupInfo.a_xml|xoops_escape}>"></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{if $groupInfo.a_xml!=$groupInfo.b_xml}><span class="<{$dirname}>_diff"><{$groupInfo.b_xml|xoops_escape}></span><{else}><{$groupInfo.b_xml|xoops_escape}><{/if}></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_OCCURRENCE}></td>
    <td style="width: 40%; text-align: left;" class="odd">&nbsp;&nbsp;
        <{if $groupInfo.a_occurrence=='1'}>
      <input type="checkbox" name="occurrence" value="1" checked />
      <{else}>
      <input type="checkbox" name="occurrence" value="1" />
      <{/if}>
    </td>
    <td style="width: 40%; text-align: left;" class="odd">&nbsp;&nbsp;
        <{if $groupInfo.b_occurrence=='1'}>
      <{if $groupInfo.a_occurrence=='0'}><span class="<{$dirname}>_diff"><{$smarty.const._AM_XOONIPS_LABEL_HAVE}></span><{else}><{$smarty.const._AM_XOONIPS_LABEL_HAVE}><{/if}>
      <{/if}>
      <{if $groupInfo.b_occurrence=='0'}>
      <{if $groupInfo.a_occurrence=='1'}><span class="<{$dirname}>_diff"><{$smarty.const._AM_XOONIPS_LABEL_NONE}></span><{else}><{$smarty.const._AM_XOONIPS_LABEL_NONE}><{/if}>
      <{/if}>
    </td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DISPLAY_ORDER}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{$groupInfo.a_weight|xoops_escape}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{if $groupInfo.a_weight!=$groupInfo.b_weight}><span class="<{$dirname}>_diff"><{$groupInfo.b_weight|xoops_escape}></span><{else}><{$groupInfo.b_weight|xoops_escape}><{/if}></td>
  </tr>
</table>
<div style="text-align: right; margin-left: 10px; margin-bottom: 25px;">
</div>
<div style="text-align: left">
  <input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_BACK}>"
  onclick="window.location='policy_itemtype.php?op=edit&itemtypeid=<{$base_itemtypeid}>'" />&nbsp;&nbsp;
   <input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_UPDATE}>" onclick="op.value='groupeditsave'; submit();" />&nbsp;&nbsp;
</div>
<br />
<p style="color:blue">&nbsp;&nbsp;&nbsp;<{$smarty.const._AM_XOONIPS_POLICY_ITEMTYPE_DETAIL_MODIFY_DESC}></p>

<div class="<{$dirname}>_sortable">
<table width="60%" cellspacing="1" class="outer">
  <thead>
  <tr>
    <th style="width: 50%; text-align: center;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_NAME}></th>
    <th style="width: 10%; text-align: center;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ACTION}></th>
  </tr>
  </thead>
  <tbody>
  <{foreach item=detail from=$details}>
  <tr class= "<{cycle values='odd,even'}>">
   <input type="hidden" name="detail_ids[]" value="<{$detail.detail_id}>">
  <input type="hidden" name="weights[]" value="<{$detail.weight}>">
    <td class="<{$dirname}>_cursor_title" width="50%"><{$detail.name|xoops_escape}><{if $detail.diff}>&nbsp;&nbsp;<span class="<{$dirname}>_diff"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_EDITING}></span><{/if}></td>
    <td class="<{$dirname}>_control" width="10%">
      <a href="policy_itemtype.php?op=detailedit&amp;itemtypeid=<{$itemtypeid}>&amp;base_itemtypeid=<{$base_itemtypeid}>&amp;groupid=<{$groupid}>&amp;detailid=<{$detail.detail_id}>">
        <img src="../images/icon_modify.png" alt="<{$smarty.const._AM_XOONIPS_LABEL_MODIFY}>" title="<{$smarty.const._AM_XOONIPS_LABEL_MODIFY}>"/>
      </a>&nbsp;
      <{if ($detail.disdel)}>
      <a href="#">
        <img src="../images/icon_delete.png" alt="<{$smarty.const._AM_XOONIPS_LABEL_DELETE}>" title="<{$smarty.const._AM_XOONIPS_LABEL_DELETE}>" 
        onclick="return dconfirm('policy_itemtype.php?op=detaildelete&amp;itemtypeid=<{$itemtypeid}>&amp;base_itemtypeid=<{$base_itemtypeid}>&amp;groupid=<{$groupid}>&amp;detailid=<{$detail.detail_id}>')" />
      </a>
      <{/if}>
    </td>
  </tr>
  <{/foreach}>
  </tbody>
  <{if count($details)==0}>
  <tr class="odd">
    <td colspan="2" style="text-align: center;">
      <span style="color: red; font-weight: bold;"><{$smarty.const._AM_XOONIPS_POLICY_ITEMTYPE_DETAIL_EMPTY}></span>
    </td>
  </tr>
  <{/if}>
</table>
</div>
<div style="text-align: left">
   <input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_DETAIL_ADD}>" onclick="window.location='policy_itemtype.php?op=detailregister&amp;itemtypeid=<{$itemtypeid}>&amp;base_itemtypeid=<{$base_itemtypeid}>&amp;groupid=<{$groupid}>&amp;detail_display=1'"/>&nbsp;&nbsp;
</div>
</form>
<{include file="file:admin_footer.html"}>
