#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2008 Aimluck,Inc.
 * http://aipostyle.com/
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *#
## ---------------------------------------------------------------------------
#set ($indicator_id = "indicator-dlg-")
## ---------------------------------------------------------------------------
#ALdialogheader("ワークフロー詳細")
#ALajaxIndicator("$indicator_id" "$!portlet.ID" "")
#ALerrmsg($errmsgs)
<div id="messageDiv"></div>
<form name="workflowForm$!portlet.ID" id="workflowForm$!portlet.ID" action="$!jslink.getPortletById($!portlet.ID).addQueryData('template','WorkflowFormJSONScreen').addQueryData('entityid',$!{result.Detail.RequestId})" method="post" onsubmit="aimluck.io.submit(this,'$indicator_id','$!portlet.ID',aipo.workflow.onReceiveMessage);return false;">
<input type="hidden" name="mode" value="none" />
<input type="hidden" name="secid" value="$secid" />
<div class"p">
#ALtableheaderWide()
#ALtdcaption('決裁状況')
#ALtditemheader()
#if($!result.Detail.Progress.Value == "D")
<span class="caution">差戻要確認</span>&nbsp;&nbsp;
#set ( $editUrl = $!utils.escapeXML("$!jslink.getPortletById($!portlet.ID).addQueryData('template','WorkflowFormScreen').addQueryData('entityid',$!{result.Detail.RequestId})") )
<input name="ajaxbuttonEdit" class="button" type="button" value="再申請する" onclick="aipo.common.showDialog('$!editUrl', '$!portlet.ID' , aipo.workflow.onLoadWorkflowDialog )" />
#else
<span class="caution">#if($!result.Detail.Progress.Value == "A") 承認済み #else 決裁待ち #end</span>
#end
#if($!result.Detail.UserId.Value == $!result.LoginUser.UserId.Value)
&nbsp;&nbsp;#ALsubmitJS('eventSubmit_doWorkflow_delete' '削除する' "aipo.workflow.onDelete('$!portlet.ID');") 
#end
#ALtditemfooter()
#ALtdcaption('表題')
#ALtditemheader()
$!result.Detail.CategoryName #if($!result.Detail.RequestName != '') <br/> $!result.Detail.RequestName #end
#ALtditemfooter()
#ALtdcaption('申請日')
#ALtditem($!result.Detail.CreateDate)
#ALtdcaption('重要度')
#ALtditem($!result.Detail.PriorityString)
#ALtdcaption('申請内容')
#ALtditem($!result.Detail.Note)
#ALtdcaption('金額')
#ALtditem("$!{result.Detail.PriceStr}&nbsp;円")
#if($!result.Detail.OldRequestLinks.size() > 0)
#ALtdcaption('過去の申請内容')
#ALtditemheader()
#set ($count = 1)
#foreach ($record in $!result.Detail.OldRequestLinks)
<div><a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","WorkflowDetailScreen").addQueryData('mode','detail').addQueryData('entityid',$record.RequestId).addQueryData('prvid',$!{result.PreviousID}))');">${count}回目 $record.CategoryName #if($record.RequestName.toString() != '') &nbsp;&nbsp; $record.RequestName #end $record.UpdateDate</a></div>
#set ($count = $count + 1)
#end
#ALtditemfooter()
#end
#ALtablefooter()
</div>
#ALtableheaderWide()
<tr>
#ALtdheadAtt("決裁履歴" "colspan='4' align='center'")
</tr>
<tr>
#ALtdheadThin("決裁")
#ALtdheadThin("ユーザー名")
#ALtdheadThin("日時")
#ALtdhead("コメント")
</tr>
#set ($confirm_view_flg = true)
#foreach ($record in $result.Detail.DecisionRecords)
<tr>
#ALtdcellheaderAtt("nowrap='nowrap'")
#if($!record.Status.Value == "C")
#if($confirm_view_flg)
<span class="caution">$!{record.StatusString}</span>
#end
#elseif($!record.Status.Value == "R" || $!record.Status.Value == "A" || $!record.Status.Value == "D")
$!{record.StatusString}
#end
#ALtdcellfooter()
#ALtdcellAtt("$!record.UserAliasName" 'nowrap')
#ALtdcellheaderAtt("nowrap='nowrap'")
#if($!record.Status.Value == "R" || $!record.Status.Value == "A") $!{record.UpdateDate} #end
#ALtdcellfooter()
#ALtdcellheader()
#if($confirm_view_flg && $!record.Status.Value == "C" && $!record.UserId.Value == $!result.LoginUser.UserId.Value)
#ALtextarea('comment' $!record.Note 10 40)
<div class="alignleft">
<div class="alignleft">#ALsubmitJS('eventSubmit_doWorkflow_accept' '承認する' "aipo.workflow.onAccept('$!portlet.ID');")／</div>
<div class="alignleft">
<span id="order_field">
#ALselectpdheader("passback_order" "90%" "" )
<option value='0'>申請者</option>
#foreach ($record in $result.Detail.DecisionRecords)
#if($!record.Status.Value == "A")
<option value='$!record.Order'>$!record.UserAliasName</option>
#end
#end
#ALselectfooter()
</span>に#ALsubmitJS('eventSubmit_doWorkflow_denial'  '差し戻す' "aipo.workflow.onDenial('$!portlet.ID');")</div>
</div>
#else
$!record.Note
#end
#ALtdcellfooter()
</tr>
#if($!record.Status.Value == "C")
#set ($confirm_view_flg = false)
#end
#end
#ALtablefooter()
#ALbuttonheader()
#if($!result.Detail.Progress.Value == "R")
#set ( $editUrl = $!utils.escapeXML("$!jslink.getPortletById($!portlet.ID).addQueryData('template','WorkflowDetailScreen').addQueryData('mode', 'detail').addQueryData('entityid', $!{result.PreviousID}).addQueryData('prvid',$!{result.PreviousID})") )
<input name="ajaxbuttonBack" class="button" type="button" value="戻る" onclick="aipo.common.showDialog('$!editUrl', '$!portlet.ID' )" />
#end
#ALajaxbuttonClose()
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()
