<{include file="file:admin_header.html"}>
<script type="text/javascript" charset="utf-8">
var xoonipsEdit = new XoonipsEdit.edit('<{$xoops_url}>', '<{$dirname}>', '<{$dirname}>_policy_itemtype_detail_registerform', 'policy_itemtype', null);
jQuery.noConflict();
// change rights radio box
function changeRightsRadioBox(flg, radio, targetName) {
  var target = document.getElementById(targetName);
  if (radio.checked == true) {
    if (flg == 1) {
      target.value = radio.value + (target.value).substr(1);
    } else if (flg == 2) {
      target.value = (target.value).substr(0, 1) + radio.value + (target.value).substr(2);
    } else if (flg == 3) {
      target.value = (target.value).substr(0, 2) + radio.value + (target.value).substr(3);
    }
  }
}
// textFile input Window
function xnpOpenTextFileInputWindow( name, elementId ) {
  window.open( '<{$smarty.const.XOONIPS_URL}>/inputtextfilesub.php?name=' + name + '&elementId=' + elementId, 'inputTextFile', 'dependent,menubar=no,location=no,personalbar=no,directories=no,toolbar=no,resizable=yes,scrollbars=no,innerHeight=220,innerWidth=480');
  return false;
}

// change rights jurisdiction
function changeRightsJurisdiction(select, targetName) {
  var target = document.getElementById(targetName);
  var temp = (target.value).split(',');
  target.value = (target.value).substr(0, 3) + select.value + ',' + (target.value).substr(temp[0].length+1);
}

function listChange() {
  var form=jQuery('#<{$dirname}>_policy_itemtype_detail_registerform');
  jQuery('#<{$dirname}>_op').attr('value','detailregister');
  jQuery('#<{$dirname}>_changeop').attr('value','listchange');
  form.submit();	
}
</script>
<{$errors}>
<div style="text-align:right; margin-left: 10px; margin-bottom: 25px;">
</div>
<form name="<{$dirname}>_policy_itemtype_detail_registerform" id="<{$dirname}>_policy_itemtype_detail_registerform" action="policy_itemtype.php?op=detailregister" method="post">
<input type="hidden" name="op" id="<{$dirname}>_op" value="">
<input type="hidden" name="changeop" id="<{$dirname}>_changeop" 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">
  &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}></td>
    <td style="width: 40%; text-align: left;" class="odd">&nbsp;&nbsp;<{$groupInfo.a_name|xoops_escape}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{$groupInfo.b_name|xoops_escape}></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_XML_TAG}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{$groupInfo.a_xml|xoops_escape}></td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;<{$groupInfo.b_xml|xoops_escape}></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'}>
    	<{$smarty.const._AM_XOONIPS_LABEL_HAVE}>
    	<{/if}>
    	<{if $groupInfo.a_occurrence=='0' }>
    	<{$smarty.const._AM_XOONIPS_LABEL_NONE}>
    	<{/if}>
    </td>
    <td style="width: 40%; text-align: left;" class="even">&nbsp;&nbsp;
        <{if $groupInfo.b_occurrence=='1'}>
    	<{$smarty.const._AM_XOONIPS_LABEL_HAVE}>
    	<{/if}>
    	<{if $groupInfo.b_occurrence=='0' }>
    	<{$smarty.const._AM_XOONIPS_LABEL_NONE}>
    	<{/if}>
    </td>
  </tr>
</table>
<div style="text-align: right; margin-left: 10px; margin-bottom: 25px;">
</div>
<table width="100%" cellspacing="1" class="outer">
  <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"><br /></th>
  </tr>
  </thead>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_NAME}><{$smarty.const._AM_XOONIPS_LABEL_REQUIRED_MARK}></td>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;&nbsp;<input type="text" name="name" size="50" maxlength="255" value="<{$name}>" /></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: 80%; text-align: left;" class="even">&nbsp;&nbsp;<input type="text" name="xml" size="50" maxlength="30" value="<{$xml}>" /></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_VIEW_TYPE}><{$smarty.const._AM_XOONIPS_LABEL_REQUIRED_MARK}></td>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;
   		<select id="viewtype" name="view_type" onchange="op.value='detailregister'; changeop.value='vtchange'; submit();">
      	<{foreach item=viewtype from=$viewtypelist}>
        <option value="<{$viewtype.viewtype_id}>" <{$viewtype.selected}>><{$viewtype.name}></option>
      	<{/foreach}>
      	</select>
    </td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_SUBTYPES}></td>
    <td style="width: 80%; text-align: left;" class="even">&nbsp;&nbsp;<{$list_block}></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DATA_TYPE}><{$smarty.const._AM_XOONIPS_LABEL_REQUIRED_MARK}></td>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;
       	<select id="datatype" name="data_type" onchange="op.value='detailregister'; changeop.value='dtchange'; submit();">
      	<{foreach item=datatype from=$datatypelist}>
      	<{if $datatype.selected ne ''}><{assign var=default_data_length value=$datatype.data_length}><{assign var=default_data_decimal_places value=$datatype.data_decimal_places}><{/if}>
        <option value="<{$datatype.datatype_id}>" <{$datatype.selected}>><{$datatype.name}></option>
      	<{/foreach}>
      	</select>
	</td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DATA_LENGTH}></td>
    <td style="width: 80%; text-align: left;" class="even">&nbsp;
       	<input type="text" id="datalength" name="data_length" size="6" maxlength="5" value="<{if $data_length!=0}><{if $data_length!=-1}><{$data_length}><{/if}><{else}><{if $default_data_length!=-1}><{$default_data_length}><{/if}><{/if}>" />
	</td>
  </tr>
  <{if $selected_datatype_name == 'float' || $selected_datatype_name == 'double'}>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DATA_LENGTH2}></td>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;
		<input type="text" id="datalength2" name="data_decimal_places" size="3" maxlength="2" value="<{if $data_decimal_places ne ''}><{$data_decimal_places}><{else}><{$default_decimal_places}><{/if}>" />
	</td>
  </tr>
  <{/if}>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DEFAULT_VALUE}></td>
    <td style="width: 80%; text-align: left;" class="even">&nbsp;&nbsp;<{$default_block}></td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_ESSENTIAL}></td>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;
        <{if $essential=='1'}>
    	<input type="checkbox" name="essential" value="1" checked />
    	<{else}>
    	<input type="checkbox" name="essential" value="1" />
    	<{/if}>
    </td>
  </tr>
  <tr>
    <td style="width: 20%; text-align: left;" class="head" rowspan="3"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DISPLAY}></td>
    <td style="width: 80%; text-align: left;" class="even">&nbsp;&nbsp;<{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_DISPLAY}>&nbsp;&nbsp;&nbsp;&nbsp;
       	<{if $detail_display=='1'}>
    	<input type="checkbox" name="detail_display" value="1" checked />
    	<{else}>
    	<input type="checkbox" name="detail_display" value="1" />
    	<{/if}>
    	<br /><span style="font-weight: normal;"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_DISPLAY_DESC}></span>
    </td>
  </tr>
  <tr>
    <td style="width: 80%; text-align: left;" class="odd">&nbsp;&nbsp;<{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_TARGET}>&nbsp;&nbsp;&nbsp;&nbsp;
        <{if $detail_target=='1'}>
    	<input type="checkbox" name="detail_target" value="1" checked />
    	<{else}>
    	<input type="checkbox" name="detail_target" value="1" />
    	<{/if}>
    	<br /><span style="font-weight: normal;"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_DETAIL_TARGET_DESC}></span>
    </td>
  </tr>
  <tr>
    <td style="width: 80%; text-align: left;" class="even">&nbsp;&nbsp;<{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_SCOPE_SEARCH}>&nbsp;&nbsp;&nbsp;&nbsp;
        <{if $scope_search=='1'}>
    	<input type="checkbox" name="scope_search" value="1" checked <{$scope_search_arr}> />
    	<{else}>
    	<input type="checkbox" name="scope_search" value="1" <{$scope_search_arr}> />
    	<{/if}>
    	<input type="hidden" name="scope_search_arr" value="<{$scope_search_arr}>">
    	<br /><span style="font-weight: normal;"><{$smarty.const._AM_XOONIPS_LABEL_ITEMTYPE_SCOPE_SEARCH_DESC}></span>
    </td>
  </tr>
</table>
<div style="text-align: left">
	<input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_BACK}>"
	onclick="window.location='policy_itemtype.php?op=groupedit&itemtypeid=<{$itemtypeid}>&base_itemtypeid=<{$base_itemtypeid}>&groupid=<{$groupid}>'" />&nbsp;&nbsp;
 	<input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_REGISTER}>" onclick="op.value='detailregistersave'; submit();" />
</div>
</form>
<{include file="file:admin_footer.html"}>
