#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2011 Aimluck,Inc.
 * http://www.aipo.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 ($newUrl1 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoFormScreen").addQueryData("entityid","new")))
#set ($newUrl2 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoCategoryFormScreen").addQueryData("entityid","new")))
#set ($submenulist = [["ToDoを追加する","javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.todo.onLoadTodoDialog);","images/icon/icon_add.gif"], ["カテゴリを追加する","javascript:aipo.common.showDialog('$newUrl2','$!portlet.ID',aipo.todo.onLoadCategoryDialog);","images/icon/icon_add.gif"]])
#set ($tabs = [["未完了ToDo", "list","$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoPublicListScreen').addQueryData('publictab','list')"], ["完了ToDo", "complete", "$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoPublicListScreen').addQueryData('publictab','complete')"]])
## ---------------------------------------------------------------------------
#ALsubmenubar($submenulist "")
<div class="message">他のユーザーの進捗状況を表示します。</div>
#ALajaxtabheader($tabs $!result.currentTab)
#ALspacebothheader()
#ALajaxlistformheader('ToDo')
#ALtableheaderSimpleWide()
#ALtdcaption('ユーザー')
#ALtditemheaderAtt("style='width: 80%;'")  
#ALselectpdheader("target_group_name" "49%" "aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')")
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "all").addQueryData("target_user_id","all"))'>（グループ全体）</option>
#foreach( $record in $!result.MyGroupList )
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "$!record.Name").addQueryData("target_user_id","all"))' #if($!result.TargetGroupName == $!record.Name.toString()) selected="selected" #end>$!record.AliasName</option>
#end
#if(($result.MyGroupList.size() > 0) && ($result.PostMap.size() > 0))
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "all").addQueryData("target_user_id","all"))' #if ($!result.CurrentFilter == $!record.Name.toString()) selected="selected" #end>----------</option>
#end
#foreach( $record in $!result.PostMap )
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "$!{record.GroupName.toString()}").addQueryData("target_user_id","all"))' #if($!result.TargetGroupName == $!record.GroupName.toString()) selected="selected" #end>$!record.PostName</option>
#end
#ALselectfooter()
#ALselectpdheader("target_user_id" "49%" "aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')")
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "$!record.Name").addQueryData("target_user_id","all"))'>（ユーザー全員）</option>
#foreach($record in $!result.Users)
<option value='$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicListScreen").addQueryData("target_group_name", "$!result.TargetGroupName").addQueryData("target_user_id","$!record.UserId"))' #if($!result.TargetUserId != "all") #if($!result.TargetUserId == $!record.UserId.toString()) selected="selected" #end #end>$!record.AliasName</option>
#end
#ALselectfooter()
#ALtditemfooter()
#ALtablefooter()
#if($result.List.size() == 0)
<div class="message">指定された条件に該当するToDoはありません。</div>
#else
#ALajaxpageview('ToDoPublicListScreen' $result)
#ALtableheaderWide()
<tr>
#ALtdheadThin("#ALajaxsort('user_name' 'ユーザー' $result 'ToDoPublicListScreen')")
#ALtdheadThin("#ALajaxsort('priority' '優先度' $result 'ToDoPublicListScreen')")
#ALtdheadW33("#ALajaxsort('todo_name' 'ToDo名' $result 'ToDoPublicListScreen')")
#ALtdheadW33("#ALajaxsort('category' 'カテゴリ' $result 'ToDoPublicListScreen')")
#ALtdheadThin("#ALajaxsort('end_date' '締め切り日' $result 'ToDoPublicListScreen')")
#ALtdheadThin("#ALajaxsort('state' '進捗' $result 'ToDoPublicListScreen')")
</tr>
#foreach ($record in $result.List)
#if($!result.currentTab == "list")
#set($limitState = ${record.limitState.Value})
#if($result.isMatch(0, $limitState)) 
#set($lsStyle = ' style="background-color:#FFFFE5"')
#elseif($result.isMatch(1, $limitState))
#set($lsStyle = ' style="background-color:#FFE5E5"')
#else
#set($lsStyle = '')
#end
#else
#set($lsStyle = '')
#end
<tr $lsStyle>
#ALtdcell($!record.CreatedUser)
#ALtdcellAtt("<img src='images/todo/$!record.PriorityImage' alt='$!record.PriorityString'  title='$!record.PriorityString'/>" 'align="center"')
#ALtdcellheader()
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoPublicDetailScreen").addQueryData("entityid",$record.TodoId))');">$!record.TodoName</a>
#ALtdcellfooter()
#ALtdcell($!record.CategoryName)
#ALtdcellAtt($!record.EndDate 'nowrap="nowrap"')
#if($!result.currentTab == "list")
#ALtdcellAtt("<img src='images/todo/$!record.StateImage' alt='$!record.StateString' title='$!record.StateString'/>" 'align="center"')
#else
#ALtdcellAtt($!record.StateString 'align="center"')
#end
</tr>
#end
#ALtablefooter()
#ALajaxpageviewFooter('ToDoPublicListScreen' $result)
#end
#ALformfooter()
#ALspacebothfooter()
#ALajaxtabfooter()
