diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index dfe95b9ff..be3c3190e 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -293,12 +293,23 @@ class boardController extends board } // generate document module controller object $oDocumentController = getController('document'); - - // delete the document - $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); - if(!$output->toBool()) + if($this->module_info->trash_use == 'Y') { - return $output; + // move the trash + $output = $oDocumentController->moveDocumentToTrash($oDocument); + if(!$output->toBool()) + { + return $output; + } + } + else + { + // delete the document + $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); + if(!$output->toBool()) + { + return $output; + } } // alert an message diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index b0c8c3414..be88e8b64 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -69,3 +69,5 @@ $lang->msg_admin_update_log = '관리자가 수정한 적이 있는 게시물입 $lang->msg_update_log_revert = '정말로 이 버전으로 되돌리시겠습니까?'; $lang->write_admin = '관리자작성'; $lang->revert_reason_update = '이 버전으로 되돌림'; +$lang->document_force_to_move = '삭제시 휴지통으로 강제이동'; +$lang->about_document_force_to_move = '게시글을 삭제시 휴지통으로 강제이동할지 않할지를 선택하는 옵션입니다.'; diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index 39a4ab1b3..bfad50a43 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -238,6 +238,18 @@

{$lang->msg_warning_update_log}

+
+ +
+ + +

{$lang->about_document_force_to_move}

+
+
diff --git a/modules/document/lang/ko.php b/modules/document/lang/ko.php index d55188fe5..ffc3759c0 100644 --- a/modules/document/lang/ko.php +++ b/modules/document/lang/ko.php @@ -67,16 +67,6 @@ $lang->in_trash = '휴지통'; $lang->trash_nick_name = '옮긴사람'; $lang->trash_date = '삭제 날짜'; $lang->trash_description = '설명'; -$lang->search_target_trash_list['title'] = '제목'; -$lang->search_target_trash_list['content'] = '내용'; -$lang->search_target_trash_list['user_id'] = '아이디'; -$lang->search_target_trash_list['member_srl'] = '회원 번호'; -$lang->search_target_trash_list['user_name'] = '사용자 이름'; -$lang->search_target_trash_list['nick_name'] = '닉네임'; -$lang->search_target_trash_list['trash_member_srl'] = '삭제자 회원 번호'; -$lang->search_target_trash_list['trash_user_name'] = '삭제자 이름'; -$lang->search_target_trash_list['trash_date'] = '삭제일'; -$lang->search_target_trash_list['trash_ipaddress'] = '삭제자 IP 주소'; $lang->success_trashed = '휴지통으로 이동되었습니다.'; $lang->msg_not_selected_document = '선택한 문서가 없습니다.'; $lang->status = '상태'; diff --git a/modules/ncenterlite/ncenterlite.class.php b/modules/ncenterlite/ncenterlite.class.php index ccf755e2e..0a42f5b09 100644 --- a/modules/ncenterlite/ncenterlite.class.php +++ b/modules/ncenterlite/ncenterlite.class.php @@ -43,6 +43,7 @@ class ncenterlite extends ModuleObject array('communication.sendMessage', 'ncenterlite', 'controller', 'triggerAfterSendMessage', 'after'), array('document.updateVotedCount', 'ncenterlite', 'controller', 'triggerAfterVotedupdate', 'after'), array('moduleHandler.init', 'ncenterlite', 'controller', 'triggerAddMemberMenu', 'after'), + array('document.moveDocumentToTrash', 'ncenterlite', 'controller', 'triggerAfterMoveToTrash', 'after'), ); private $delete_triggers = array( array('moduleObject.proc', 'ncenterlite', 'controller', 'triggerBeforeModuleObjectProc', 'before') diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index 92d951029..fc1ef818f 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -432,6 +432,22 @@ class ncenterliteController extends ncenterlite return new Object(); } + function triggerAfterMoveToTrash(&$obj) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + if(empty($config->use)) + { + return new Object(); + } + + $args = new stdClass(); + $args->srl = $obj->document_srl; + $output = executeQuery('ncenterlite.deleteNotifyBySrl', $args); + return new Object(); + } + function triggerAfterModuleHandlerProc(&$oModule) { $vars = Context::getRequestVars(); diff --git a/modules/trash/lang/ko.php b/modules/trash/lang/ko.php index e1878e448..1af65ecb5 100644 --- a/modules/trash/lang/ko.php +++ b/modules/trash/lang/ko.php @@ -12,10 +12,18 @@ $lang->fail_empty = '휴지통을 비우지 못했습니다.'; $lang->success_restore = '복원했습니다.'; $lang->fail_restore = '복원하지 못했습니다.'; $lang->origin_module_type = '타입'; -$lang->remove_all_trash_item = '휴지통을 완전히 비웁니다. 실행 후에는 복원이 불가능합니다.'; +$lang->remove_all_trash_item = '선택한 항목의 휴지통 리스트들을 완전히 비웁니다. 실행 후에는 복원이 불가능합니다.'; $lang->title = '제목'; $lang->content = '내용'; $lang->trasher = '삭제자'; $lang->origin_info = '원문 정보'; $lang->delete_info = '삭제 정보'; $lang->cmd_restore = '복원'; +$lang->cmd_trash_list = '휴지통 목록'; +$lang->cmd_trash_type = '휴지통비우기 타입'; +$lang->trash_warning = '주의!'; +$lang->trash_nick_name = '옮긴사람'; +$lang->search_target_trash_list['title'] = '제목'; +$lang->search_target_trash_list['user_id'] = '삭제자 아이디'; +$lang->search_target_trash_list['nick_name'] = '삭제자 닉네임'; +$lang->search_target_trash_list['trash_ipaddress'] = '삭제자 IP 주소'; diff --git a/modules/trash/queries/getTrashList.xml b/modules/trash/queries/getTrashList.xml index b3728bc12..b73860acc 100644 --- a/modules/trash/queries/getTrashList.xml +++ b/modules/trash/queries/getTrashList.xml @@ -12,6 +12,12 @@ + + + + + + diff --git a/modules/trash/tpl/header.html b/modules/trash/tpl/header.html index bd7fd3cbc..529b65f20 100644 --- a/modules/trash/tpl/header.html +++ b/modules/trash/tpl/header.html @@ -1,2 +1,15 @@ -

{$lang->cmd_trash} {$lang->cmd_management}

+
+

{$lang->cmd_trash}

+
+ + + +
+

{$XE_VALIDATOR_MESSAGE}

+
+ diff --git a/modules/trash/tpl/trash_list.html b/modules/trash/tpl/trash_list.html index 0e027b0ad..48e9224f5 100644 --- a/modules/trash/tpl/trash_list.html +++ b/modules/trash/tpl/trash_list.html @@ -3,24 +3,36 @@ var confirm_restore_msg = '{$lang->confirm_restore}'; var no_text_comment = '{$lang->no_text_comment}'; -
-

{$lang->trash} {$lang->help}

-
-
-

{$XE_VALIDATOR_MESSAGE}

-
+
+
+

{$lang->cmd_trash_type}

+
+ + +
+
+

-  {$lang->remove_all_trash_item} +  {$lang->trash_warning}{$lang->remove_all_trash_item}

- {$lang->all}({number_format($total_count)}) + + {$lang->all}({number_format($total_count)}) + | + {$lang->document} + | + {$lang->comment}
{$lang->delete} {$lang->restore} @@ -72,8 +84,6 @@ var no_text_comment = '{$lang->no_text_comment}'; - - - +
diff --git a/modules/trash/trash.admin.controller.php b/modules/trash/trash.admin.controller.php index ea37bf41d..c33ab417b 100644 --- a/modules/trash/trash.admin.controller.php +++ b/modules/trash/trash.admin.controller.php @@ -47,16 +47,23 @@ class trashAdminController extends trash $isAll = Context::get('is_all'); $originModule = Context::get('origin_module'); $tmpTrashSrls = Context::get('cart'); + $is_type = Context::get('is_type'); $trashSrls = array(); if($isAll != 'true') { - if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls; - else $trashSrls = explode('|@|', $tmpTrashSrls); + if(is_array($tmpTrashSrls)) + { + $trashSrls = $tmpTrashSrls; + } + else + { + $trashSrls = explode('|@|', $tmpTrashSrls); + } } //module relation data delete... - $output = $this->_relationDataDelete($isAll, $trashSrls); + $output = $this->_relationDataDelete($isAll, $is_type, $trashSrls); if(!$output->toBool()) return new Object(-1, $output->message); if(!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty); @@ -70,15 +77,19 @@ class trashAdminController extends trash /** * Empty trash - private method * @param string $isAll + * @param string $is_type * @param array trashSrls * @return Object */ - function _relationDataDelete($isAll, &$trashSrls) + function _relationDataDelete($isAll, $is_type, &$trashSrls) { $oTrashModel = getModel('trash'); if($isAll == 'true') { - $output = $oTrashModel->getTrashAllList(array()); + $args = new stdClass(); + $args->originModule = $is_type; + $output = $oTrashModel->getTrashAllList($args); + if(!$output->toBool()) { return new Object(-1, $output->message); @@ -122,7 +133,7 @@ class trashAdminController extends trash if(!$output2->toBool()) return new Object(-1, $output2->message); } } - return new Object(0, $lang->success_deleted); + return new Object(0, lang('success_deleted')); } /** diff --git a/modules/trash/trash.admin.view.php b/modules/trash/trash.admin.view.php index a3c6e561d..269c24267 100644 --- a/modules/trash/trash.admin.view.php +++ b/modules/trash/trash.admin.view.php @@ -31,17 +31,30 @@ class trashAdminView extends trash $args->page = Context::get('page'); // /< Page $args->list_count = 30; // /< the number of posts to display on a single page $args->page_count = 5; // /< the number of pages that appear in the page navigation + $args->originModule = Context::get('originModule'); - $args->search_target = Context::get('search_target'); // /< search (title, contents ...) - $args->search_keyword = Context::get('search_keyword'); // /< keyword to search + $search_target = Context::get('search_target'); // /< search (title, contents ...) + $search_keyword = Context::get('search_keyword'); // /< keyword to search + + switch($search_target) + { + case 'title': + $args->s_title = $search_keyword; + break; + case 'user_id': + $args->s_user_id = $search_keyword; + break; + case 'nick_name': + $args->s_nick_name = $search_keyword; + break; + case 'trash_ipaddress': + $args->s_ipaddress = $search_keyword; + break; + } $oTrashModel = getModel('trash'); $output = $oTrashModel->getTrashList($args); - // for no text comment language and for document manange language - $oCommentModel = getModel('comment'); - $oDocumentModel = getModel('document'); - Context::set('trash_list', $output->data); Context::set('total_count', $output->total_count); Context::set('total_page', $output->total_page); @@ -110,7 +123,6 @@ class trashAdminView extends trash } $this->setTemplateFile('trash_view'); } - } /* End of file trash.admin.view.php */ /* Location: ./modules/trash/trash.admin.view.php */ diff --git a/modules/trash/trash.model.php b/modules/trash/trash.model.php index c56a59349..089eddd84 100644 --- a/modules/trash/trash.model.php +++ b/modules/trash/trash.model.php @@ -10,6 +10,30 @@ */ class trashModel extends trash { + private static $config = NULL; + + /** + * get Tresh Module Config + * + * @return trash config + */ + function getConfig() + { + if(self::$config === NULL) + { + $oModuleModel = getModel('module'); + $config = $oModuleModel->getModuleConfig('trash'); + if(!$config) + { + $config = new stdClass(); + } + + self::$config = $config; + } + + return self::$config; + } + /** * Get one trash object * @param int $trashSrl