#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2010 Aimluck,Inc.
 * http://aipostyle.com/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *#

## ---------------------------------------------------------------------------
#set($linklist = [["ワークフローへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('mode','menu')"], ["ワークフロー確認依頼一覧へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('mode','list')"]])
#ALcell_pagetitle_iphone($career "ワークフロー詳細")
#ALcell_linklist_iphone($career $linklist)
#ALcell_contents_header($career)
#ALcell_formheader($career $jslink $portlet)
#ALtableheaderBorder("1")
#if($!result.Detail.Progress.Value == "D")
#ALthtd('' "差戻要確認")
#else
#if($!result.Detail.Progress.Value == "A")
#ALthtd('決裁状況' "承認済み")
#else
#ALthtd('決裁状況' "決裁待ち")
#end
#end
#ALthtd('分類' "$!{result.Detail.CategoryName}")
#if($!result.Detail.RequestName != '')
#ALthtd('表題' "$!result.Detail.RequestName")
#end
#ALthtd('投稿日' "$!result.Detail.CreateDate")
#ALthtd('申請日' "$!result.Detail.CreateDate")
#ALthtd('重要度' "$!result.Detail.PriorityString")
#ALthtd('申請内容' $!result.Detail.Note)
#ALthtd('金額' "$!{result.Detail.PriceStr}&nbsp;円")

#ALtablefooterBorder()
<input type="hidden" name="confirmusers" value="#foreach($record in $!{result.MemberList})$!{record.Name},#end"> ##メンバーリストの作成
#if($!result.Detail.UserId.Value == $!result.LoginUser.UserId.Value)
#ALcell_submit($career 'eventSubmit_doWorkflow_delete' '削除する')
#end

#if($!result.Detail.OldRequestLinks.size() > 0)
<h3>過去の申請内容</h3>
<ul>
#set ($count = 1)
#foreach ($record in $!result.Detail.OldRequestLinks)
<li>
<a href="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).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>
</li>
#set ($count = $count + 1)
#end
</ul>
#end

<h3>決済履歴</h3>
##[決済]/[ユーザー名]/[日時]/[コメント]
#set ($confirm_view_flg = true)
<ol>
#foreach ($record in $result.Detail.DecisionRecords)
#set($delimiter="")
#ALcell_li_header($career)
#if($!record.Status.Value == "C")
#if($confirm_view_flg)
$!{record.StatusString}
#end
#elseif($!record.Status.Value == "R" || $!record.Status.Value == "A" || $!record.Status.Value == "D")
$!{record.StatusString}
#set($delimiter="/")
#else
未確認
#end
 / $!record.UserAliasName $delimiter
#if($!record.Status.Value == "R" || $!record.Status.Value == "A") $!{record.UpdateDate} #end
#if($confirm_view_flg && $!record.Status.Value == "C" && $!record.UserId.Value == $!result.LoginUser.UserId.Value)
#ALtextarea('comment' $!record.Note 10 40)
#ALcell_submit($career 'eventSubmit_doWorkflow_accept' '承認する')
#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()
に#ALcell_submit($career 'eventSubmit_doWorkflow_denial' '差し戻す')
#else
$!record.Note
#end
#ALcell_li_footer($career)
#if($!record.Status.Value == "C")
#set ($confirm_view_flg = false)
#end
#end
</ol>
#ALformfooter()
#ALcell_contents_footer($career)
#ALcell_linklist_iphone($career $linklist)
