#*
 * 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","MsgboardTopicFormScreen").addQueryData("entityid","new")))
#set ($newUrl2 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","MsgboardCategoryFormScreen").addQueryData("entityid","new")))
#set ($submenulist = [["トピックを追加する","javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.msgboard.onLoadMsgboardDialog);","images/icon/icon_add.gif"], ["カテゴリを追加する","javascript:aipo.common.showDialog('$newUrl2','$!portlet.ID',aipo.msgboard.onLoadCategoryDialog);","images/icon/icon_add.gif"]])
#set ($tabs = [["トピック一覧", "",""]])
#set ($indicator_id = "indicator-list-")
## ---------------------------------------------------------------------------
#ALsubmenubar($submenulist "")
#ALajaxtabheader($tabs "")
#ALspacebothheader()
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")
##ALajaxlistformheader('トピック')
#ALajaxlistformheaderonsubmit('トピック' "aipo.msgboard.onChangeSearch('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID))','$!portlet.ID');")
#ALtableheaderSimpleWide()
#ALtdcaption('カテゴリ')
#ALtditemheaderAtt("style='width: 80%;'")
#ALselectpdheader("topic" "99%" "aipo.msgboard.onChangeFilter('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID))','$!portlet.ID');")
<option value="null">（全体）</option>
#foreach( $record in $result.CategoryList )
<option value="$!record.CategoryId" #if ($!result.CurrentFilter && $!result.CurrentFilter == $!record.CategoryId.toString()) selected="selected" #end>$!record.CategoryName</option>
#end
#ALselectfooter()
#ALtditemfooter()
#ALtdcaption('検索')
#ALtditemheaderAtt("style='width: 80%;'")
<input class="text"  type="text" name="q" id="q" #if ($!result.CurrentSearch) value="$!result.CurrentSearchWithSanitize" #end>
#ALsubmit("submit" "検索")
#ALtditemfooter()


#ALtablefooter()

#if(!$result.List || $result.List.size() == 0)
<div class="message">指定された条件に該当するトピックはありません。</div>
#else
#ALajaxpageview('MsgboardTopicListScreen' $result)
#ALtableheaderWide()
<tr>
#ALtdheadThin("#ALswitchCheckbox()")
#ALtdheadW33("#ALajaxsort('topic_name' 'トピック名' $result 'MsgboardTopicListScreen')")
#ALtdheadW33("#ALajaxsort('category_name' 'カテゴリ' $result 'MsgboardTopicListScreen')")
#ALtdheadW33("#ALajaxsort('owner_name' '作成者' $result 'MsgboardTopicListScreen')")
#ALtdheadW33("#ALajaxsort('update_user' '更新者' $result 'MsgboardTopicListScreen')")
#ALtdheadThin("#ALajaxsort('update_date' '更新日' $result 'MsgboardTopicListScreen')")
</tr>
#foreach ($record in $result.List)
<tr>
#ALtdcellheader()
#if($!result.isMatch($!{result.UserId} , $!{record.OwnerId.Value}))
<input name="check$!record.TopicId" type="checkbox" value="$!record.TopicId" />
#else
<input type="checkbox" disabled="disabled" />
#end
#ALtdcellfooter()
#ALtdcellheader()
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","MsgboardTopicDetailScreen").addQueryData("entityid",$record.TopicId))','$!portlet.ID',aipo.msgboard.onLoadMsgboardDialog);">$!record.TopicName  #if($record.ReplyCount.toString() != "0")（$record.ReplyCount）#end</a>
#if($record.isNew()) &nbsp;&nbsp;<img src="images/msgboard/msgboard_new_topic.gif" alt="新着" title="新着"> #end
#ALtdcellfooter()
#ALtdcellheader()
#if ($!record.CategoryId.toString() != "1")
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","MsgboardCategoryDetailScreen").addQueryData("entityid",$!record.CategoryId))');">$!record.CategoryName</a>
#if(! ${record.isPublic()})
<img class="img_icon" src="images/msgboard/msgboard_secret.gif" alt="非公開" title="非公開" />
#end
#else
$!record.CategoryName
#end
#ALtdcellfooter()
#ALtdcell("$!{record.OwnerName}")
#ALtdcell("$!{record.UpdateUser}")
#ALtdcellAtt("$!{record.UpdateDate.Month}月$!{record.UpdateDate.Day}日$!{record.UpdateDate.Hour}時$!{record.UpdateDate.Minute}分" 'nowrap')
</tr>
#end
#ALtablefooter()
#ALbuttonheaderRight()
選択した トピックを #ALajaxbuttonCheckboxDelete('削除する' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','MsgboardTopicFormJSONScreen').addQueryData('mode','multi_delete')" "$indicator_id" "$!portlet.ID" "aipo.msgboard.onReceiveMessage")
#end
#ALbuttonfooterRight()
#ALajaxpageviewFooter('MsgboardTopicListScreen' $result)
#ALformfooter()
#ALspacebothfooter()
#ALajaxtabfooter()
