#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * http://aipostyle.com/
 * 
 * Copyright(C) 2010 avanza Co.,Ltd. All rights reserved.
 * http://www.avnz.co.jp/
 * 
 * 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/>.
 *#
## ---------------------------------------------------------------------------
#set ($tabs = [["インポート", "import","$!jslink.getPortletById($!portlet.ID).addQueryData('template','CoordinationForGoogleCalImportScreen').addQueryData('tab','import')"], ["エクスポート", "export", "$!jslink.getPortletById($!portlet.ID).addQueryData('template','CoordinationForGoogleCalExportScreen').addQueryData('tab','export')"]])
## ---------------------------------------------------------------------------
#ALajaxtabheader($tabs $!result.currentTab)
<form name="Export" action="$!jslink.getPortletById($!portlet.ID).addQueryData('template','CoordinationForGoogleCalICSExportScreen')"  method="post">
<input type="hidden" name="secid" value="$secid" />
<input type="hidden" id="time_change" name="time_change" value="month_select" />

<div style="margin:0px 0px 5px 0px">
スケジュールをICSファイルでダウンロードします。
エクスポートするスケジュールデータの期間を指定して、
「エクスポート」ボタンをクリックしてください。
</div>
#ALtableheaderWide()
	<tr>
		<td width="150" class="caption">エクスポートする期間指定</td>
		<td>
			#if( "$!result.TimeSelectFlg" == "day_select" )
				#set( $div_unit_month_style = "display:none;" )
				#set( $div_unit_day_style = "display:block;" )
			#else
				#set( $div_unit_month_style = "display:block;" )
				#set( $div_unit_day_style = "display:none;" )
			#end
			<div id="div_unit_month" style="display:block;">
				<input type="button" onClick="aipo.coordinationforgooglecal.changeSummaryUnit('day');" value="日単位指定に切り替える"/>
				<select name="view_date_year_from" id="view_date_year_from" size="1">
				#set($end_year = 2015)
				#foreach ( $num in [2000..$!{end_year}] )
					<option value="$num" #if ($!result.FromDate.Year == "$num") selected="selected" #end>$num年</option>
				#end
				</select>
				<select name="view_date_month_from" id="view_date_month_from" size="1">
				#foreach ( $num in [1..12] )
					<option value="$num" #if ($!result.FromDate.Month == "$num") selected="selected" #end>$num月</option>
				#end
				</select>
				～
				<select name="view_date_year_to" id="view_date_year_to" size="1">
				#set($end_year = 2015)
				#foreach ( $num in [2000..$!{end_year}] )
					<option value="$num" #if ($!result.ToDate.Year == "$num") selected="selected" #end>$num年</option>
				#end
				</select>
				<select name="view_date_month_to" id="view_date_month_to" size="1">
				#foreach ( $num in [1..12] )
					<option value="$num" #if ($!result.ToDate.Month == "$num") selected="selected" #end>$num月</option>
				#end
				</select>
			</div>

			<div id="div_unit_day" style="display:none;">
				<input type="button" onClick="aipo.coordinationforgooglecal.changeSummaryUnit('month');" value="月単位指定に切り替える"/>
				<div id="from"></div> 
				～
				<div id="to"></div> 
			</div>
			#if("$!result.PeriodFlg" == "no_period")
            <input type="checkbox" name="period" value="no_period" checked>期間の指定をしない</input>
			#else
			<input type="checkbox" name="period" value="no_period">期間の指定をしない</input>
			#end
		</td>
	</tr>
	<tr>
		<td colspan="9" align="center">                                    
			<input name="send" class="button" type="submit" value="エクスポート" onclick="aimluck.io.setHiddenValue(this);" />
			<input id="default_from_date" type="hidden" value="$!{result.FromDate.Year}/$!{result.FromDate.Month}/$!{result.FromDate.Day}" />
			<input id="default_to_date" type="hidden" value="$!{result.ToDate.Year}/$!{result.ToDate.Month}/$!{result.ToDate.Day}" />
   		</td>
	</tr>
#ALtablefooter()
</form>
#ALajaxtabfooter()
<script type="text/javascript">
<!-- 
#if( "$!result.TimeSelectFlg" == "day_select" )
dojo.addOnLoad(aipo.coordinationforgooglecal.changeSummaryUnit)
#end
//-->
</script>