#*
 * 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 ($tabs = [["共有ファイル", "", ""]])
#set ($newUrl1 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetFileFormScreen").addQueryData("entityid","new")))
#set ($newUrl2 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetFolderFormScreen").addQueryData("entityid","new").addQueryData("mode","new")))
#set ($indicator_id = "indicator-list-")
##set ($submenulist = [["ファイルを追加する","javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.cabinet.onLoadCabinetFileDialog);","images/cabinet/file_add.gif"], ["フォルダを追加する","javascript:aipo.common.showDialog('$newUrl2','$!portlet.ID',aipo.cabinet.onLoadCabinetFolderDialog);","images/cabinet/folder_add.gif"]])
##set ($submenulist = [["ファイル一覧を見る","$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doCabinet_list','1')","images/icon/icon_list.gif"], ["ファイルを追加する","javascript:aipo.common.showDialog('$!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetFileFormScreen").addQueryData("entityid","new")');","images/icon/icon_add.gif"]])
## ---------------------------------------------------------------------------
#ALajaxtabheader($tabs "")
#ALspacebothheader()
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")

#if($!result.isSearch())
<table cellSpacing=0 cellPadding=0 width="100%" border=0><tr>
<td class="item" align="left"><div style="padding:0px 0px 2px 0px;font-size:10pt;font-weight:bold;color:#5D6A70;">検索結果</div></td>
<td class="item" align="right"><a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doJob_list', '1')">[一覧へ戻る]</a>
</td></tr></table>
#end

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width:150px;" valign="top">
<div class="explorer_box" style="padding:2px 2px 2px 5px;width:150pt;overflow:scroll;">
#foreach($record in $!result.FolderHierarchyList)
#if($record.visible() && $record.isAuthorizedVisible())
#if($record.HierarchyIndex <= 0)
<nobr>#if($record.isOpened()) <img src="themes/$!theme/images/icon/folder_open.gif"/> #else <img src="themes/$!theme/images/icon/folder_close.gif"/> #end #if($result.SelectedFolderInfo.FolderId == $record.FolderId) <b>${record.FolderName}</b> #else
<a href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetListScreen").addQueryData('eventSubmit_doCabinet_list','1').addQueryData('folder_id' ,"$record.FolderId"))', '$!portlet.ID');" >${record.FolderName}</a>
#end</nobr><br/>
#else
#set($imgwidth = 16 * $record.HierarchyIndex)
<nobr><img src="images/blank.gif" height="10" width="$imgwidth"/>#if($record.isOpened())  <img src="themes/$!theme/images/icon/folder_open.gif"/> #else <img src="themes/$!theme/images/icon/folder_close.gif"/> #end #if($result.SelectedFolderInfo.FolderId == $record.FolderId) <b>${record.FolderName}</b> #else
<a href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetListScreen").addQueryData('eventSubmit_doCabinet_list','1').addQueryData('folder_id' ,"$record.FolderId"))', '$!portlet.ID');" >${record.FolderName}</a>
#end</nobr><br/>
#end
#end
#end
</div>
</td>
<td valign="top" style="padding:0px 0px 0px 5px">
#if($result.isAccessible())
<form name="cabinetlist$!portlet.ID" id="cabinetlist$!portlet.ID" action="#" method="post" onsubmit="aipo.cabinet.onSubmitSerchButton(this,'$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','CabinetFileSearchListScreen'))','$!portlet.ID'); return false;">
<input type="hidden" name="_name" value="ファイル" />
<input type="hidden" name="secid" value="$secid" />
<h4>
#if($result.SelectedFolderInfo.FolderId > 1)
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetFolderDetailScreen").addQueryData("mode","folder_detail"))');">$!{result.SelectedFolderInfo.FolderName}</a>
#else
$!{result.SelectedFolderInfo.FolderName}
#end
</h4>
##<div style="padding:0px 0px 5px 0px">
#ALtableheaderSimpleWide()
#ALtdcaption('検索')
#ALtditemheader()
#ALtextfield('sword' "$!result.SearchWord" "120px" 100 'active')
#ALsubmitJS('submit' ' 検索する ' 'setHiddenValue(this)')
<span class="middle">（タイトル・ファイル名・メモで検索します）</span>
#ALtditemfooter()
#ALtablefooter()
<div id="listmessageDiv"></div>
##</div>
#if($result.List.size() == 0)
<div class="message">指定された条件に該当するファイルはありません。</div>
#else
#ALajaxpageview('CabinetListScreen' $result)
#ALtableheader("100%")
<tr>
#if($result.isEditable()) #ALtdheadThin("#ALswitchCheckbox()") #end
#ALtdheadW33("#ALajaxsort('file_title' 'タイトル' $result 'CabinetListScreen')")
#ALtdheadW33("#ALajaxsort('file_name' 'ファイル名' $result 'CabinetListScreen')")
#ALtdheadW25("#ALajaxsort('update_date' '更新日時' $result 'CabinetListScreen')")
#ALtdheadThin("#ALajaxsort('file_size' 'サイズ（KB）' $result 'CabinetListScreen')")
#if($result.isEditable()) #ALtdheadThin(' ') #end
</tr>
#foreach ($record in $result.List)
<tr>
#if($result.isEditable()) #ALtdcellAtt("<input name='check$!record.FileId' type='checkbox' value='$!record.FileId'/>" 'align="center"') #end
#ALtdcellheader()
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","CabinetFileDetailScreen").addQueryData("entityid",$record.FileId))');">$!record.FileTitle</a>
#ALtdcellfooter()
#ALtdcellheader()
<a href="$jslink.getTemplate("CabinetFileRawScreen").addQueryData("entityid", ${record.FileId})">$record.WbrFileName</a>
#ALtdcellfooter()
#ALtdcell($record.UpdateDate)
<td class="item" align="right">$record.FileSize</td>
#if($result.isEditable())<td class="item" nowrap="nowrap">#ALajaxbuttonLink('編集' $!jslink.getPortletById($!portlet.ID).addQueryData('template','CabinetFileFormScreen').addQueryData('entityid', ${record.FileId}) "themes/$!theme/images/icon/icon_edit.gif")</td>#end
</tr>
#end
#ALtablefooter()
#if($result.isEditable())
#ALbuttonheaderRight()
選択した ファイル を #ALajaxbuttonCheckboxDelete('削除する' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','CabinetFileFormJSONScreen').addQueryData('mode','multi_delete')" "$indicator_id" "$!portlet.ID" "aipo.cabinet.onListReceiveMessage")
#ALbuttonfooterRight()
#end
#ALajaxpageviewFooter('CabinetListScreen' $result)
#end
#ALformfooter()
#else
このフォルダを表示する権限がありません。
#end
</td></tr></table>
#ALspacebothfooter()
#ALajaxtabfooter()
