#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2011 Aimluck,Inc.
 * http://www.aipo.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 ($indicator_id = "indicator-dlg-")
## ---------------------------------------------------------------------------
#set($linklist = [["依頼一覧へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('mode','list')"], ["ﾜｰｸﾌﾛｰへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('mode','menu')"]])
#ALcell_formheader($career $jslink $portlet)
#ALcell_pagetitle($career "ﾜｰｸﾌﾛｰ詳細")
#ALcell_dl_header($career)
#ALcell_dt($career '決裁状況')
#if($!result.Detail.Progress.Value == "D")
<dd class="caution">差戻要確認</dd>&nbsp;&nbsp;
#else
<dd class="caution">#if($!result.Detail.Progress.Value == "A") 承認済み #else 決裁待ち #end</dd>
#end
#ALcell_dt($career '分類')
#ALcell_dd($career $!{result.Detail.CategoryName})
#if($!result.Detail.RequestName != '')
#ALcell_dt($career '表題')
#ALcell_dd($career $!{result.Detail.RequestName})
#end
#ALcell_dt($career '投稿日')

#ALcell_dd($career "$!result.Detail.CreateDate")
<input type="hidden" name="confirmusers" value="#foreach($record in $!{result.MemberList})$!{record.Name},#end"> ##メンバーリストの作成

#ALcell_dt($career '申請日')
#ALcell_dd($career "$!result.Detail.CreateDate")
#ALcell_dt($career '重要度')
#ALcell_dd($career "$!result.Detail.PriorityString")
#ALcell_dt($career '申請内容')
#ALcell_dd($career $!result.Detail.Note)
#ALcell_dt($career '金額')
#ALcell_dd($career "$!{result.Detail.PriceStr}&nbsp;円")
#if($!result.Detail.UserId.Value == $!result.LoginUser.UserId.Value)
#ALcell_hr($career '1')
#ALcell_submit($career 'eventSubmit_doWorkflow_delete' '削除する')
#end
#if($!result.Detail.OldRequestLinks.size() > 0)
#ALcell_dt($career '過去の申請内容')
#ALtditemheader()
#set ($count = 1)
#foreach ($record in $!result.Detail.OldRequestLinks)
<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>
#set ($count = $count + 1)
#end
#end
<hr style="border:solid 1px #ffffff; color:#ffffff" />
<div style="background:$config.getString("aipo.color.cell.vm.logo"); color:#ffffff; text-align:center;"><img src="${context_path}/images/dot.gif" width="1" height="1" /></div>
<div style="background:$config.getString("aipo.color.cell.vm.title"); text-align:center;">決裁履歴</div>
<div style="background:$config.getString("aipo.color.cell.vm.logo");"><img src="${context_path}/images/dot.gif" width="1" height="1" /></div>
<hr style="border:solid 1px #ffffff; color:#ffffff" />
[決裁]/[ユーザー名]/[日時]/[コメント]
#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)
#ALcell_textarea($career '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' '差し戻す')
</div>
#else
$!record.Note
#end
#ALcell_li_footer($career)
#if($!record.Status.Value == "C")
#set ($confirm_view_flg = false)
#end
#end
</ol>
#ALformfooter()
#ALcell_hr($career '1')
#ALcell_linklist($career $linklist)
#ALtdcellFooterLink($career)

