#*
 * 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($career = 'wm')
#if ($!{result.Detail.isRepeat()})
#set ($event_submit = "eventSubmit_doSchedule_form_repeat")
#elseif($!{result.Detail.isSpan()})
#set ($event_submit = "eventSubmit_doSchedule_form_span")
#else
#set ($event_submit = "eventSubmit_doSchedule_form_oneday")
#end
#set($link = "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_list','1')")
#set($methodlist = [["登録(1日)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_oneday','1').addQueryData('entityid','new').addQueryData('view_date', $!{result.ViewDate.toString()})"], ["登録(繰り返し)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_repeat','1').addQueryData('entityid','new').addQueryData('view_date', $!{result.ViewDate.toString()})"], ["登録(期間)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_span','1').addQueryData('entityid','new').addQueryData('view_date', $!{result.ViewDate.toString()})"]])
#set($linklist = [["別ユーザーのスケジュールを見る", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectgroup','1')"], ["スケジュールへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu','1')"]])
#set ($hasMember = false)
#ALcell_pagetitle_iphone($career "スケジュール詳細")
#ALcell_linklist_iphone($career $linklist)
#ALcell_contents_header($career)

<dl class="detail">
<dt>名前</dt>
<dd>$!{result.Detail.User.AliasName}</dd>

<dt>日時</dt>
<dd>
#if($!{result.Detail.isSpan()})
$!{result.Detail.StartDate.Year}/$!{result.Detail.StartDate.Month}/$!{result.Detail.StartDate.Day}$!{result.Detail.StartDate.DayOfWeek}から
$!{result.Detail.EndDate.Year}/$!{result.Detail.EndDate.Month}/$!{result.Detail.EndDate.Day}$!{result.Detail.EndDate.DayOfWeek}
#if(! ${result.Detail.isPublic()})
(非公開)
#end
#elseif($!{result.Detail.isRepeat()})
$!{result.Detail.Text}
$!{result.Detail.DateForCell}
#if(! ${result.Detail.isPublic()})
(非公開)
#end
(繰り返し)
#else
$!{result.Detail.StartDate.Year}/$!{result.Detail.StartDate.Month}/$!{result.Detail.StartDate.Day}$!{result.Detail.StartDate.DayOfWeek}
$!{result.Detail.DateForCell}
#if(! ${result.Detail.isPublic()})
(非公開)
#end
#end
#if($!{result.Detail.isTmpreserve()})
(仮)
#end
</dd>
<dt>予定</dt>
<dd>$!{result.Detail.Name}</dd>

<dt>場所</dt>
<dd>$!{result.Detail.Place}</dd>

<dt>内容</dt>
<dd>$!{result.Detail.Note}</dd>

<dt>公開区分</dt>
<dd>
#if($!result.Detail.isPublic())
公開
#elseif($!result.Detail.isPrivate())
非公開
#elseif($!result.Detail.isHidden())
完全に隠す
#end
</dd>

<dt>参加者</dt>
<dd>
#if($!result.MemberList.size() > 1)
#set($counter = 0)
#foreach($record in $!result.MemberList)
#if(!($!{record.Name.toString()} == $!{result.Detail.User.Name.toString()}))
$!record.AliasName
#if($result.getStatus($record.UserId.Value) == "T")
(仮)
#elseif($result.getStatus($record.UserId.Value) == "R")
#set($counter = $counter + 1)
(削除)
#end
<br />
#end
#end
#if($counter < ($!result.MemberList.size() - 1))
#set ($hasMember = true)
#end
#if($hasMember)
#if($!{result.Detail.isEditable()})[編集/削除：可]#else[編集/削除：不可]#end
#end
#end
</dd>

<dt>共有施設</dt>
<dd>
#foreach($record in $!result.FacilityList)
${record.FacilityName}<br />
#end
</dd>

<dt>登録者名</dt>
<dd>
$!{result.Detail.CreateUser.AliasName}<br />($!{result.Detail.CreateDate})
</dd>

<dt>更新者名</dt>
<dd>$!{result.Detail.UpdateUser.AliasName}<br />($!{result.Detail.UpdateDate})</dd>

</dl>


#ALcell_formheader($career $jslink $portlet)
<p class="center">
<input type="hidden" name="entityid" value="$!{result.EntityId}">
<input type="hidden" name="view_date" value="$!{result.ViewDate.toString()}">
#if($!{result.Detail.isOwner()})
<input class="submit" name="$event_submit" type="submit" value="編集する" />
##ALcell_submit($career "$event_submit" '編集する')
<input class="submit" name="eventSubmit_doSchedule_form_delete" type="submit" value="削除する" />
##ALcell_submit($career 'eventSubmit_doSchedule_form_delete' '削除する')
#elseif($!{result.Detail.isTmpreserve()} && $!{result.Detail.isLoginuser()})
<input type="hidden" name="status" value="C">
<input class="submit" name="eventSubmit_doSchedule_change_status" type="submit" value="確定する" />
##ALcell_submit($career 'eventSubmit_doSchedule_change_status' '確定する')
#if($!{result.Detail.isEditable()})
<input class="submit" name="$event_submit" type="submit" value="編集する" />
##ALcell_submit($career "$event_submit" '編集する')
#end
<input class="submit" name="eventSubmit_doSchedule_form_delete" type="submit" value="削除する" />
##ALcell_submit($career 'eventSubmit_doSchedule_form_delete' '削除する')
#elseif($!{result.Detail.isConfirm()} && $!{result.Detail.isLoginuser()})
<input type="hidden" name="status" value="T">
<input class="submit" name="eventSubmit_doSchedule_change_status" type="submit" value="仮の予定にする" />
##ALcell_submit($career 'eventSubmit_doSchedule_change_status' '仮の予定にする')
#if($!{result.Detail.isEditable()})
<input class="submit" name="$event_submit" type="submit" value="編集する" />
##ALcell_submit($career "$event_submit" '編集する')
#end
<input class="submit" name="eventSubmit_doSchedule_form_delete" type="submit" value="削除する" />
##ALcell_submit($career 'eventSubmit_doSchedule_form_delete' '削除する')
#end
</p>
#ALcell_formfooter()

#ALcell_contents_footer($career)
#ALcell_linklist_iphone($career $linklist)
