#*
 * 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/>.
 *#
## ---------------------------------------------------------------------------
#if  ($mode=="new_form")
#set ($indicator_str = "データを送信")
#set ($action_str = "追加する")
#set ($event_submit = "eventSubmit_doTodo_insert")
#set ($subtitle = 'ToDo追加')
#else
#set ($indicator_str = "データを送信")
#set ($action_str = "更新する")
#set ($subtitle = 'ToDo編集')
#set ($event_submit = "eventSubmit_doTodo_update")
#end
#set ($indicator_id = "indicator-dlg-")
## ---------------------------------------------------------------------------
#ALdialogheader($subtitle)
#ALajaxIndicator("$indicator_id" "$!portlet.ID" "")
#ALerrmsg($errmsgs)
<div id="messageDiv"></div>
#ALajaxscreenformheader("todoForm" $jslink $portlet "ToDoFormJSONScreen" "aimluck.io.submit(this,'$indicator_id','$!portlet.ID',aipo.todo.onReceiveMessage)")
<input name="is_new_category" type="hidden" value="$!result.NewCategory"/>
#if($mode=="new_form")
<input type="hidden" name="mode" value="insert" />
#else
<input type="hidden" name="mode" value="update" />
#end
#ALtableheaderWide()
#ALtdcaption($!result.getFieldName("category_id"))
#ALtditemheader()
<div id="todoCategoryInputField" #if(!$!{result.NewCategory})style="display:none"#end>
#ALtableheaderSubWide()
#ALtdcaption("#ALrequired($!result.getFieldName('category_name'))")
#ALtditem("#ALtextfield('category_name' $!result.CategoryName '90%' 50 'active')")
#ALtablefooter()
</div>
<div id="todoCategorySelectField" #if($!{result.NewCategory})style="display:none"#end>
#ALselectpdheader("category_id" "99%" "")
#foreach( $record in $result.CategoryList )
<option value='$!record.CategoryId' #if ($!result.CategoryId.toString() == $!record.CategoryId.toString()) selected="selected" #end>$!record.CategoryName</option>
#end
#ALselectfooter()
</div>
<input name="category_input_button" type="button" class="button" value=" #if(!$!{result.NewCategory})新しく入力する#else一覧から選択する#end " onclick="aipo.todo.formSwitchCategoryInput(this)" />
#ALtditemfooter()
#ALtdcaption("#ALrequired($!result.getFieldName('todo_name'))")
#ALtditem("#ALtextfield('todo_name' $!result.TodoName '90%' 50 'active')")
#ALtdcaption($!result.getFieldName("start_date"))
#ALtditemheader()
<div dojoType="aipo.widget.DropdownDatepicker" id="startdatepicker" widgetId="startdatepicker"  iconURL="images/icon/icon_date.gif" iconAlt="開始日" hiddenId="start_date" #if ($!result.StartDateCheck.toString() == "TRUE") initValue="" #else initValue="$!{result.StartDate.Year}/$!{result.StartDate.Month}/$!{result.StartDate.Day}"checked="checked" #end inputId="input_startdate" dateId="start_date" displayCheck=""></div>
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("end_date"))
#ALtditemheader()
<div dojoType="aipo.widget.DropdownDatepicker" id="enddatepicker" widgetId="enddatepicker"  iconURL="images/icon/icon_date.gif" iconAlt="締切日" #if ($!result.EndDateCheck.toString() == "TRUE") initValue="" #else initValue="$!{result.EndDate.Year}/$!{result.EndDate.Month}/$!{result.EndDate.Day}" #end dateId="end_date"></div>
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("priority"))
#ALtditemheader()
<input name="priority" type="radio" value="1" id="$!{portlet.ID}priority_high_id" #if ($!result.Priority.toString() == "1") checked="checked" #end/><label for="$!{portlet.ID}priority_high_id">高い</label> 
<input name="priority" type="radio" value="2" id="$!{portlet.ID}priority_middle_high_id" #if ($!result.Priority.toString() == "2") checked="checked" #end/><label for="$!{portlet.ID}priority_middle_high_id">やや高い</label> 
<input name="priority" type="radio" value="3" id="$!{portlet.ID}priority_middle_id" #if ($!result.Priority.toString() == "3") checked="checked" #end/><label for="$!{portlet.ID}priority_middle_id">普通</label> 
<input name="priority" type="radio" value="4" id="$!{portlet.ID}priority_middle_low_id" #if ($!result.Priority.toString() == "4") checked="checked" #end/><label for="$!{portlet.ID}priority_middle_low_id">やや低い</label> 
<input name="priority" type="radio" value="5" id="$!{portlet.ID}priority_low_id" #if ($!result.Priority.toString() == "5") checked="checked" #end/><label for="$!{portlet.ID}priority_low_id">低い</label> 
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("state"))
#ALtditemheader()
<select name="state">
<option value="0" #if ($!result.State.toString() == "0") selected="selected" #end>未着手</option>
<option value="10" #if ($!result.State.toString() == "10") selected="selected" #end>10%</option>
<option value="20" #if ($!result.State.toString() == "20") selected="selected" #end>20%</option>
<option value="30" #if ($!result.State.toString() == "30") selected="selected" #end>30%</option>
<option value="40" #if ($!result.State.toString() == "40") selected="selected" #end>40%</option>
<option value="50" #if ($!result.State.toString() == "50") selected="selected" #end>50%</option>
<option value="60" #if ($!result.State.toString() == "60") selected="selected" #end>60%</option> 
<option value="70" #if ($!result.State.toString() == "70") selected="selected" #end>70%</option>
<option value="80" #if ($!result.State.toString() == "80") selected="selected" #end>80%</option>
<option value="90" #if ($!result.State.toString() == "90") selected="selected" #end>90%</option>
<option value="100" #if ($!result.State.toString() == "100") selected="selected" #end>完了</option>           
</select>
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("note"))
#ALtditemheader()
#ALtextarea('note' $!result.Note 10 40)
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("public_flag"))
#ALtditemheader()
<input name="public_flag" type="radio" value="T" id="$!{portlet.ID}public_flag_public_id" #if ($!result.PublicFlag.toString() == "T") checked="checked" #end/><label for="$!{portlet.ID}public_flag_public_id">公開</label>
<input name="public_flag" type="radio" value="F" id="$!{portlet.ID}public_flag_private_id" #if ($!result.PublicFlag.toString() == "F") checked="checked" #end/><label for="$!{portlet.ID}public_flag_private_id">非公開</label> 
#ALtditemfooter()
#ALtdcaption($!result.getFieldName("addon_schedule_flg"))
#ALtditemheader()
<input name="addon_schedule_flg" type="radio" value="T" id="$!{portlet.ID}addon_schedule_flg_id1" #if ($!result.AddonScheduleFlg.toString() == "T") checked="checked" #end/><label for="$!{portlet.ID}addon_schedule_flg_id1">表示</label>
<input name="addon_schedule_flg" type="radio" value="F" id="$!{portlet.ID}addon_schedule_flg_id2" #if ($!result.AddonScheduleFlg.toString() == "F") checked="checked" #end/><label for="$!{portlet.ID}addon_schedule_flg_id2">非表示</label> 
#ALtditemfooter()
#ALtablefooter()
#ALbuttonheader()
#ALsubmit($event_submit $action_str)#ALajaxbuttonClose()
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()
