#*
 * Aipo is a groupware program developed by TOWN, Inc.
 * Copyright (C) 2004-2015 TOWN, 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 = [[$l10n.TODO_TODO_ADD,"javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.todo.onLoadTodoDialog);","images/icon/icon_add.gif"], [$l10n.TODO_CATEGORY_ADD,"javascript:aipo.common.showDialog('$newUrl2','$!portlet.ID',aipo.todo.onLoadCategoryDialog);","images/icon/icon_add.gif"]])
#set ($menues = [[$l10n.TODO_ALL_CATEGORY, "list","$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoListScreen').addQueryData('tab','list').addQueryData('reset_keyword_params','true')"]])
#set ($menues2 = [[$l10n.TODO_CATEGORY_LIST, "category","$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoCategoryListScreen').addQueryData('reset_params','true').addQueryData('reset_keyword_params','true')"]])
#set ($menues3 = [[$l10n.TODO_FINISH_TODO, "complete", "$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoListScreen').addQueryData('tab','complete').addQueryData('reset_params','true').addQueryData('reset_keyword_params','true')"]])

## ---------------------------------------------------------------------------
<div id="auiWidgetsArea" #if("${clientVer}" == "4") style="position:static" #elseif("${client}" == "IPHONE") style="position:fixed" #end>
<div class="auiWidget clearfix">
#AUIbuttonAction($l10n.TODO_TODO_ADD "javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.todo.onLoadTodoDialog);")
</div>
<div class="auiWidget clearfix">
##AUIwidgetViewPageMenuList($menues $!result.currentTab)
<input type="hidden" id="topic" value="2" />
<ul>
<li #if (!$result.issetFilter("category") && !$categoryEtc && $!result.currentTab != "complete") class="active" #end><a href="javascript:void(0)" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoListScreen").addQueryData("filter","").addQueryData("filtertype","category").addQueryData('tab','list').addQueryData('reset_keyword_params','true'))','$!portlet.ID');">$l10n.TODO_ALL_CATEGORY</a></li>
#foreach($record in $!result.CategoryList )
<li #if ($!result.issetFilter("category",$!record.CategoryId.toString())) class="active" #end><a href="javascript:void(0)" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","ToDoListScreen").addQueryData("filter",$!record.CategoryId).addQueryData("filtertype","category").addQueryData('tab','list').addQueryData('reset_keyword_params','true'))','$!portlet.ID');">$!{record.CategoryName}</a></li>
#end
</ul>
<div style="margin:0.5em 0;">
<a href="javascript:void(0);" onclick="aipo.viewPage('$!jslink.getPortletById($!portlet.ID).addQueryData('template','ToDoCategoryListScreen')', '$!portlet.ID');">$l10n.TODO_MANAGEMENT</a>
</div>
#if("${client}" != "IPHONE")
</div>
<div class="auiWidget clearfix">
#else
<div style="margin:0.5em 0;">
#end
#AUIwidgetViewPageMenuList($menues3 $!result.currentTab)
#if("${client}" == "IPHONE")
</div>
#end
</div>
</div>
