#321 첨부파일 목록 표시 향상

- 글 제목 표시하도록 수정
- 첨부파일마다 모듈명을 출력하지 않고 묶어서 출력하도록 수정
- 코멘트에 첨부된 파일의 경우 '이동'링크 클릭 시 document_srl을 찾지 못하는 문제 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3304 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2007-12-11 10:12:30 +00:00
parent 36d8a48f9d
commit 548c58b30a
3 changed files with 73 additions and 2 deletions

View file

@ -54,12 +54,63 @@
}
}
// 목록의 loop를 돌면서 document를 구하기
$file_count = count($output->data);
if($file_count) {
$document_srl_list = array();
foreach($output->data as $val) {
$comment_srl = $val->upload_target_srl;
if(!in_array($comment_srl, $document_srl_list)) $document_srl_list[] = $comment_srl;
}
// comment를 먼저 구해서 document_srl을 구함
if(count($document_srl_list)) {
$args->comment_srls = implode(',', $document_srl_list);
$comment_output = executeQuery('comment.getComments', $args);
if($comment_output->data && !is_array($comment_output->data)) {
$comment_output->data = array($comment_output->data);
}
if($comment_output->data) {
for($i = 0; $i < count($comment_output->data); $i++) {
$comment_info = $comment_output->data[$i];
$comment_list[$comment_info->comment_srl] = $comment_info;
}
foreach($output->data as $val) {
$val->target_document_srl = $comment_list[$val->upload_target_srl]->document_srl;
}
foreach($comment_output->data as $val) {
$document_srl = $val->document_srl;
if(!in_array($document_srl, $document_srl_list)) $document_srl_list[] = $document_srl;
}
}
}
// document를 구함
if(count($document_srl_list)) {
$args->document_srls = implode(',', $document_srl_list);
$document_output = executeQuery('document.getDocuments', $args);
if($document_output->data && !is_array($document_output->data)) {
$document_output->data = array($document_output->data);
}
for($i = 0; $i < count($document_output->data); $i++) {
$document_info = $document_output->data[$i];
$document_list[$document_info->document_srl] = $document_info;
}
}
}
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('file_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
Context::set('document_list', $document_list);
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl');

View file

@ -0,0 +1,5 @@
@charset "utf-8";
.adminTable tr.bg1 td {
background-color: #FAFAFA;
}

View file

@ -1,5 +1,6 @@
<!--%import("filter/delete_checked.xml")-->
<!--%import("js/file_admin.js")-->
<!--%import("css/file_list.css")-->
<!--#include("header.html")-->
<div class="tableSummaryType1">
@ -45,11 +46,25 @@
</thead>
<tbody>
<!--@foreach($file_list as $no => $val)-->
<!--@if($val->upload_target_srl != $cur_upload_target_srl)-->
<!--@if($val->target_document_srl)-->
{@ $document_srl = $val->target_document_srl}
{@ $move_uri = './?document_srl='.$document_srl.'#comment_'.$val->upload_target_srl}
<!--@else-->
{@ $document_srl = $val->upload_target_srl}
{@ $move_uri = './?document_srl='.$val->upload_target_srl}
<!--@end-->
{@ $cur_upload_target_srl = $val->upload_target_srl}
<tr class="bg1">
<td colspan="9">
<a href="./?mid={$module_list[$val->module_srl]->mid}" onclick="window.open(this.href);return false;" class="blue">{$module_list[$val->module_srl]->browser_title}</a> - <a href="{$move_uri}" onclick="window.open(this.href);return false;">{htmlspecialchars($document_list[$document_srl]->title)}</a>
</td>
</tr>
<!--@end-->
<tr>
<td class="tahoma">{$no}</td>
<td><input type="checkbox" name="cart" value="{$val->file_srl}" /></td>
<td class="left subject">
<a href="./?mid={$module_list[$val->module_srl]->mid}" onclick="window.open(this.href);return false;" class="blue">{$module_list[$val->module_srl]->browser_title}</a><br />
<a href="{$val->download_url}" class="red">{htmlspecialchars($val->source_filename)}</a>
</td>
<td class="tahoma">{$val->file_size}</td>
@ -63,7 +78,7 @@
<td class="tahoma">{$val->download_count}</td>
<td class="tahoma">{zdate($val->regdate,"Y-m-d")}</td>
<td class="tahoma">{$val->ipaddress}</td>
<td class="blue"><a href="./?document_srl={$val->upload_target_srl}" onclick="window.open(this.href);return false;">{$lang->cmd_move}</a></td>
<td class="blue"><a href="{$move_uri}" onclick="window.open(this.href);return false;">{$lang->cmd_move}</a></td>
</tr>
<!--@end-->
</tbody>