<div class="xleprogress">
<{include file="db:`$dirname`_inc_menu.html"}>

<{if $actionForm->hasError()}>
  <ul class="error">
    <{foreach item=message from=$actionForm->getErrorMessages()}>
      <li><{$message|xoops_escape}></li>
    <{/foreach}>
  </ul>
<{/if}>

<h1><{$smarty.const._MD_XLEPROGRESS_LANG_APPROVE_ITEM}></h1>
<div>
<{$detailview}>
</div>
<form action="index.php?action=HistoryEdit" method="post">
  <dl>
    <dt><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT}></dt>
    <dd>
	  <{if $actionForm->get('status') == $status_request}>
      <label><input type="radio" name="result" value="9" /><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT_APPROVE}></label>
      <label><input type="radio" name="result" value="1" /><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT_REJECT}></label>
      <{elseif $actionForm->get('status') == $status_approve}>
      <label><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT_APPROVE}></label>
      <{elseif $actionForm->get('status') == $status_reject}>
      <label><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT_REJECT}></label>
      <{/if}>
    </dd>
    <dt><{$smarty.const._MD_XLEPROGRESS_LANG_COMMENT}></dt>
    <dd>
      <{if $actionForm->get('status') == $status_request}>
      <{xoops_textarea type=text name=comment value=$actionForm->get('comment')}>
      <{else}>
      <{xoops_textarea readonly=readonly type=text name=comment value=$actionForm->get('comment')}>
      <{/if}>
    </dd>
    <dt></dt>
  	<{if $actionForm->get('status') == $status_request}>
    <dd>
      <{xoops_token form=$actionForm}>
      <{xoops_input type=hidden name=item_id value=$actionForm->get('item_id')}>
      <{xoops_input type=hidden name=progress_id value=$actionForm->get('progress_id')}>
      <input type="submit" value="<{$smarty.const._SUBMIT}>" />
      <input type="submit" value="<{$smarty.const._CANCEL}>" name="_form_control_cancel" />
    </dd>
    <{/if}>
  </dl>
</form>

<div class="clear"></div>

<h2><{$smarty.const._MD_XLEPROGRESS_LANG_HISTORY}></h2>
<table class="outer">
	<tr>
		<th><{$smarty.const._MD_XLEPROGRESS_LANG_USER}></th>
		<th><{$smarty.const._MD_XLEPROGRESS_LANG_STEP}></th>
		<th><{$smarty.const._MD_XLEPROGRESS_LANG_RESULT}></th>
		<th><{$smarty.const._MD_XLEPROGRESS_LANG_POSTTIME}></th>
	</tr>
	<{foreach item=history from=$object->mItem->mHistory}>
	<tr>
		<td><{$history->getShow('uid')|xoops_user:"user_name"}></td>
		<td><{$history->getShow('step')}></td>
		<td><{$history->getShowResult()}></td>
		<td><{$history->getShow('posttime')|xoops_formattimestamp:m}></td>
	</tr>
	<{/foreach}>
</table>
</div>
