#*
 * 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 ($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-")
## ---------------------------------------------------------------------------
#macro(MsgboardajaxbuttonCheckboxDelete $name $url $indicator_id $portlet_id $rt)
<input name="ajaxbuttonCheckboxDelete" class="button" type="button" value="$name" onclick="aipo.msgboard.ajaxCheckboxDeleteSubmit(this, '$!utils.escapeXML($url)', '$indicator_id', '$portlet_id', $rt);" />
#end
## ---------------------------------------------------------------------------
#ALsubmenubar($submenulist "")
#ALajaxtabheader($tabs "")
#ALspacebothheader()
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")
<div id="listmessageDiv"></div>
#ALformheader('カテゴリ' $jslink $portlet)
#if($result.List.size() <= 0)
<div class="message">複数のトピックをグループ化することで、トピックを分類することができます。</div>
<div class="message">『カテゴリ追加』 ボタンを押して、追加してください。 </div>
#else
#ALajaxpageview('MsgboardCategoryListScreen' $result)
#ALtableheaderWide()
<tr>
#ALtdheadThin("#ALswitchCheckbox()")
#ALtdheadWide("#ALajaxsort('category_name' 'カテゴリ名' $result 'MsgboardCategoryListScreen')")
#ALtdheadWide("#ALajaxsort('create_user' '作成者' $result 'MsgboardCategoryListScreen')")
#ALtdheadThin(' ')
</tr>
#foreach ($record in $result.List)
<tr>
#if($!result.isMatch($!{result.UserId} , $!{record.OwnerId.Value}) || $!result.AuthorityDelete)
#ALtdcellAtt("<input name='check$!record.CategoryId' type='checkbox' value='$!record.CategoryId'/>" 'align="center"')
#else
#ALtdcellAtt("<input type='checkbox' disabled='disabled'/>" 'align="center"')	
#end
#ALtdcellheader()
<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 src="images/msgboard/msgboard_secret.gif" border="0" width="16" height="16" align="absmiddle" alt="非公開" title="非公開">
#end
#ALtdcellfooter()
#ALtdcell("$!{record.OwnerName}")
#ALtdcellheaderAtt("nowrap='nowrap'")
#if($!result.isMatch($!{result.UserId} , $!{record.OwnerId.Value}) || $!result.AuthorityEdit)
#ALajaxbuttonLinkCallback('編集' $!jslink.getPortletById($!portlet.ID).addQueryData('template','MsgboardCategoryFormScreen').addQueryData('entityid', $!record.CategoryId) 'images/icon/icon_edit.gif' $!portlet.ID 'aipo.msgboard.onLoadCategoryDialog')
#end
#ALtdcellfooter()
</tr>
#end

#ALtablefooter()
#ALbuttonheaderRight()
選択したカテゴリを #MsgboardajaxbuttonCheckboxDelete('削除する' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','MsgboardCategoryFormJSONScreen').addQueryData('mode','multi_delete')" "$indicator_id" "$!portlet.ID" "aipo.msgboard.onListReceiveMessage")<span class="caution">（カテゴリに含まれるトピックはすべて削除されます。）</span>
#ALbuttonfooterRight()
#ALajaxpageviewFooter('MsgboardCategoryListScreen' $result)
#end
#ALformfooter()
#ALspacebothfooter()
#ALtabfooter()
