#*
 * 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/>.
 *#

## ---------------------------------------------------------------------------
#parse("/portlets/smartphone_default/ja/schedule-form-title.vm")

#set($linklist = [["スケジュールへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu','1')"]])
#if($mode=="new_form")
#set ($action_str = "追加する")
#set ($event_submit = "eventSubmit_doSchedule_insert")
#else
#set ($action_str = "更新する")
#set ($event_submit = "eventSubmit_doSchedule_update")
#end
#ALcell_linklist_iphone($career $linklist)
#ALcell_contents_header($career)

#ALcell_errmsg($career $errmsgs)

#if ($!{result.isRepeat()})
<h3>繰り返し</h3>
#if ($!{result.FormData.RepeatType.toString()} == "D") 毎日#end
#if ($!{result.FormData.RepeatType.toString()} == "W") 毎週 #if ($!{result.FormData.Week0.toString()} == "TRUE")日#end#if ($!{result.FormData.Week1.toString()} == "TRUE")月#end#if ($!{result.FormData.Week2.toString()} == "TRUE")火#end#if ($!{result.FormData.Week3.toString()} == "TRUE")水#end#if ($!{result.FormData.Week4.toString()} == "TRUE")木#end#if ($!{result.FormData.Week5.toString()} == "TRUE")金#end#if ($!{result.FormData.Week6.toString()} == "TRUE")土#end 曜日#end
#if ($!{result.FormData.RepeatType.toString()} == "M") 毎月 $!{result.FormData.MonthDay}日#end
#if ($!{result.FormData.LimitFlag.toString()} == "ON")
<h3>期間</h3>
$!{result.FormData.LimitStartDateDate2}から<br />
$!{result.FormData.LimitEndDateDate2}まで
#end
<h3>時間</h3>
$!{result.FormData.StartDateTime2}から$!{result.FormData.EndDateTime2}まで
#if($isDuplicateFacility=="true")
施設予約が重複しています。
#end
#elseif($!{result.isSpan()})
<h3>期間</h3>
$!{result.FormData.StartDateDate2}から<br/>
$!{result.FormData.EndDateDate2}まで
#else
<h3>日付</h3>
$!{result.FormData.StartDateDate2}
<h3>時間</h3>
$!{result.FormData.StartDateTime2}から$!{result.FormData.EndDateTime2}まで
#if($isDuplicateFacility=="true")
施設予約が重複しています。
#end
#end
#ALcell_formheader($career $jslink $portlet)
#if($!{result.EntityId} && $!{result.EntityId} != 'new')
<input type="hidden" name="entityid" value="$!{result.EntityId}">
<input type="hidden" name="edit_repeat_flag" value="$!{result.FormData.EditRepeatFlag.toString()}">
#end
<input type="hidden" name="view_date" value="$!{result.FormData.ViewDate.toString()}">
<input type="hidden" value="$!{result.ScheduleType}" name="schedule_type">

#if ($!{result.isRepeat()})
<input type="hidden" name="repeat_type" value="$!{result.FormData.RepeatType}">
#if ($!{result.FormData.RepeatType.toString()} == "W")
#if ($!{result.FormData.Week0.toString()} == "TRUE") <input type="hidden" name="week_0" value="TRUE"> #end
#if ($!{result.FormData.Week1.toString()} == "TRUE") <input type="hidden" name="week_1" value="TRUE"> #end
#if ($!{result.FormData.Week2.toString()} == "TRUE") <input type="hidden" name="week_2" value="TRUE"> #end
#if ($!{result.FormData.Week3.toString()} == "TRUE") <input type="hidden" name="week_3" value="TRUE"> #end
#if ($!{result.FormData.Week4.toString()} == "TRUE") <input type="hidden" name="week_4" value="TRUE"> #end
#if ($!{result.FormData.Week5.toString()} == "TRUE") <input type="hidden" name="week_5" value="TRUE"> #end
#if ($!{result.FormData.Week6.toString()} == "TRUE") <input type="hidden" name="week_6" value="TRUE"> #end
#elseif ($!{result.FormData.RepeatType.toString()} == "M")
<input type="hidden" name="month_day" value="$!{result.FormData.MonthDay}">
#end
<input type="hidden" name="limit_flag" value="$!{result.FormData.LimitFlag.toString()}">
#if($!{result.FormData.LimitFlag.toString()} == "ON")
<input type="hidden" name="limit_start_date" value="$!{result.FormData.LimitStartDateDate}">
<input type="hidden" name="limit_end_date" value="$!{result.FormData.LimitEndDateDate}">
#end
#end
<input type="hidden" name="start_date_date" value="$!{result.FormData.StartDateDate}">
<input type="hidden" name="start_date_time" value="$!{result.FormData.StartDateTime}">
<input type="hidden" name="end_date_date" value="$!{result.FormData.EndDateDate}">
<input type="hidden" name="end_date_time" value="$!{result.FormData.EndDateTime}">
#set($usercount = 1)
#set($membersize = $!{result.FormData.MemberList.size()})
<input type="hidden" name="shareusers" value="#foreach($record in $!{result.FormData.MemberList})$!{record.Name}#if($usercount<$membersize),#set($usercount = $usercount + 1)#end#end">
#set($facilitycount = 1)
#set($fmembersize = $!{result.FormData.FacilityMemberList.size()})
<input type="hidden" name="sharefacs" value="#foreach($record in $!{result.FormData.FacilityMemberList})$!{record.FacilityId}#if($facilitycount<$fmembersize),#set($facilitycount = $facilitycount + 1)#end#end">

<input type="hidden" name="edit_flag" value="$!{result.FormData.EditFlag.toString()}">
<input type="hidden" name="change_tmpreserve_flag" value="$!{result.FormData.ChangeTmpreserveFlag.toString()}">

<h3>$!result.getFieldName('name')#ALcell_must()</h3>
<p class="center">
#ALtextfield('name' $!result.Name '90%' 50 'active')
</p>

<h3>$!result.getFieldName('place')</h3>
<p class="center">
#ALtextfield('place' $!result.Place '90%' 50 'active')
</p>

<h3>$!result.getFieldName('note')</h3>
<p class="center">
#ALtextarea('note' $!result.Note 5 34)
</p>

<h3>$!result.getFieldName("public_flag")</h3>
<p class="center">
  <select name="public_flag">
    <option value="O"  #if ($!result.PublicFlag.toString() == "O") selected="selected" #end)>公開</option>
    <option value="C"  #if ($!result.PublicFlag.toString() == "C") selected="selected" #end)>非公開</option>
    <option value="P"  #if ($!result.PublicFlag.toString() == "P") selected="selected" #end)>完全に隠す</option>
  </select>
</p>

<p class="center">
#ALcell_submit($career $event_submit $action_str)
</p>
#ALcell_formfooter()
#ALcell_contents_footer($career)
#ALcell_linklist_iphone($career $linklist)

