From 63c57c4a6d161673fd1f477ef1f54b4e0d94e0c1 Mon Sep 17 00:00:00 2001 From: bnu Date: Sun, 24 Aug 2008 03:57:12 +0000 Subject: [PATCH] =?UTF-8?q?17117631=20=EA=B4=80=EB=A6=AC=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=EC=97=90=EC=84=9C=20=EB=8C=80=EC=83=81=EC=9D=84=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=ED=95=98=EC=A7=80=20=EB=AA=BB=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4453 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/file.admin.view.php | 46 ++++++++++++-------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/modules/file/file.admin.view.php b/modules/file/file.admin.view.php index 91a79ec99..ce364a3fc 100644 --- a/modules/file/file.admin.view.php +++ b/modules/file/file.admin.view.php @@ -60,48 +60,36 @@ $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; + if(!in_array($val->upload_target_srl, $document_srl_list)) $document_srl_list[] = $val->upload_target_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); - } + // comment의 첨부파일이면 document_srl을 추가로 구함 + if($document_srl_list) { + $oCommentModel = &getModel('comment'); + $comment_output = $oCommentModel->getComments($document_srl_list); - 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; + if($comment_output) { + foreach($comment_output as $val) { + $comment_list[$val->comment_srl] = $val->document_srl; } - foreach($output->data as $val) { - $val->target_document_srl = $comment_list[$val->upload_target_srl]->document_srl; + for($i=1; $i <= count($output->data); $i++) { + $output->data[$i]->target_document_srl = $comment_list[$output->data[$i]->upload_target_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; + foreach($comment_output as $val) { + if(!in_array($val->document_srl, $document_srl_list)) $document_srl_list[] = $val->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); - } + $document_output = executeQueryArray('document.getDocuments', $args); - for($i = 0; $i < count($document_output->data); $i++) { - $document_info = $document_output->data[$i]; - $document_list[$document_info->document_srl] = $document_info; + foreach($document_output->data as $document) { + $document_list[$document->document_srl] = $document; } } + } Context::set('total_count', $output->total_count); @@ -131,4 +119,4 @@ } } -?> +?> \ No newline at end of file