#*
 * 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($otherlist = [["別ユーザーのスケジュールを見る", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectgroup','1')"]])
## add by motegi1019 end
#set($methodlist = [["登録(1日)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_oneday','1').addQueryData('entityid','new')"], ["登録(繰り返し)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_repeat','1').addQueryData('entityid','new')"], ["登録(期間)へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_span','1').addQueryData('entityid','new')"]])
#set($menulist = [["前の週へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $prevweek)"], ["今週に戻る", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $!now)"],["週を指定", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectday','1').addQueryData('view_date', $!daylist.get(0))"],["次の週へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu','1').addQueryData('start_date', $nextweek)"]])
###set ($menulist_schedule = [["スケジュール(1日)", ""], ["表示(今日)", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_list','1').addQueryData('tab','oneday').addQueryData('view_date', $today)"], ["表示(日付指定)", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectday','1')"], ["登録(1日)", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_oneday','1').addQueryData('entityid','new')"], ["登録(繰り返し)", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_repeat','1').addQueryData('entityid','new')"], ["登録(期間)", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_span','1').addQueryData('entityid','new')"]])
###set ($menulist = [$menulist_schedule])
###ALcell_menulist($career 'スケジュール' $menulist)
##ALcell_pagetitle_iphone($career "スケジュール($!daylist.get(0).replace('-','/') - $!daylist.get(6).replace('-','/'))")
#ALcell_pagetitle_iphone($career "スケジュール")
#ALcell_linklist_iphone($career $otherlist)
#ALcell_contents_header($career)

#ALcell_navi_header($career)
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu','1').addQueryData('start_date', $nextweek)" class="btn_right">次の週へ</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $prevweek)" class="btn_left">前の週へ</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $!now)" class="btn">今週に戻る</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectday','1').addQueryData('view_date', $!daylist.get(0))" class="btn">週を指定 </a>
#ALcell_navi_footer($career)
<ul class="multi_list">
#set($daycount = 0)
#foreach($record in $!result.List)
#set($yearindex = $!daylist.get($daycount).indexOf("-") + 1)
#ALcell_li_header($career)
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_list','1').addQueryData('tab','oneday').addQueryData('view_date', $!daylist.get($daycount))">$!daylist.get($daycount).substring($yearindex).replace('-','/')$!weekdaylist.get($daycount)</a>
#ALcell_ul_header($career)
#foreach($schedule in $!record)
#ALcell_li_header($career)
###if($schedule.Repeat)期間：#else $schedule.StartDate&nbsp;-&nbsp;$schedule.EndDate #end
<a href="$!jslink.getAction('controls.Maximize',$!portlet.ID).addQueryData('mode','detail').addQueryData('entityid', $!{schedule.ScheduleId}).addQueryData('view_date', $!daylist.get($daycount))">
#if(! $!{schedule.isSpan()})
$!{schedule.StartDate} - $!{schedule.EndDate}#ALcell_br($career)
#else
期間：
#end
$schedule.Name
#if(!$schedule.Public)#ALcell_br($career) &nbsp;(非公開)#end
#if(!$schedule.Repeat && $schedule.Pattern != 'N')#ALcell_br($career) &nbsp;(繰り返し)#end
</a>
#ALcell_li_footer($career)
#end
#ALcell_ul_footer($career)
#ALcell_li_footer($career)
#set($daycount = $daycount + 1)
#end
</ul>
#ALcell_navi_header($career)
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu','1').addQueryData('start_date', $nextweek)" class="btn_right">次の週へ</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $prevweek)" class="btn_left">前の週へ</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_menu', '1').addQueryData('start_date', $!now)" class="btn">今週に戻る</a>
<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doSchedule_form_selectday','1').addQueryData('view_date', $!daylist.get(0))" class="btn">週を指定 </a>
#ALcell_navi_footer($career)
#ALcell_contents_footer($career)
#ALcell_linklist_iphone($career $otherlist)