diff --git a/modules/communication/communication.model.php b/modules/communication/communication.model.php index 78c6d2e41..976e2d902 100644 --- a/modules/communication/communication.model.php +++ b/modules/communication/communication.model.php @@ -255,6 +255,12 @@ class communicationModel extends communication $query_id = 'communication.getStoredMessages'; break; + case 'N' : + $args->member_srl = $logged_info->member_srl; + $args->readed = 'N'; + $query_id = 'communication.getReadedMessages'; + break; + default : $args->member_srl = $logged_info->member_srl; $args->message_type = 'S'; @@ -268,23 +274,7 @@ class communicationModel extends communication $args->list_count = 20; $args->page_count = 10; - return executeQuery($query_id, $args, $columnList); - } - - function getReadedMessages($readed = 'N', $columnList = array()) - { - $logged_info = Context::get('logged_info'); - - $args = new stdClass(); - $args->member_srl = $logged_info->member_srl; - $args->readed = $readed; - $args->sort_index = 'message.list_order'; - $args->page = Context::get('page'); - $args->list_count = 20; - $args->page_count = 10; - $output = executeQueryArray('communication.getReadedMessages', $args, $columnList); - - return $output; + return executeQueryArray($query_id, $args, $columnList); } /** diff --git a/modules/communication/communication.view.php b/modules/communication/communication.view.php index 6f4eb55da..86cb48109 100644 --- a/modules/communication/communication.view.php +++ b/modules/communication/communication.view.php @@ -46,19 +46,19 @@ class communicationView extends communication /** * Display message box - * @return void|Object (void : success, Object : fail) + * @return object (Object : fail) */ function dispCommunicationMessages() { if($this->config->enable_message == 'N') { - return $this->stop('msg_invalid_request'); + return new Object(-1, 'msg_invalid_request'); } // Error appears if not logged-in if(!Context::get('is_logged')) { - return $this->stop('msg_not_logged'); + return new Object(-1, 'msg_not_logged'); } $logged_info = Context::get('logged_info'); @@ -67,7 +67,7 @@ class communicationView extends communication $message_srl = Context::get('message_srl'); $message_type = Context::get('message_type'); - if(!in_array($message_type, array('R', 'S', 'T'))) + if(!in_array($message_type, array('R', 'S', 'T', 'N'))) { $message_type = 'R'; Context::set('message_type', $message_type); @@ -86,21 +86,28 @@ class communicationView extends communication case 'R': if($message->receiver_srl != $logged_info->member_srl) { - return $this->stop('msg_invalid_request'); + return new Object(-1, 'msg_invalid_request'); } break; case 'S': if($message->sender_srl != $logged_info->member_srl) { - return $this->stop('msg_invalid_request'); + return new Object(-1, 'msg_invalid_request'); } break; case 'T': if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl) { - return $this->stop('msg_invalid_request'); + return new Object(-1, 'msg_invalid_request'); + } + break; + + case 'N': + if($message->receiver_srl != $logged_info->member_srl) + { + return new Object(-1, 'msg_invalid_request'); } break; } @@ -165,33 +172,6 @@ class communicationView extends communication $this->setTemplateFile('new_message'); } - function dispCommunicationUnreadList() - { - $oCommunicationModel = getModel('communication'); - - if($this->config->enable_message == 'N') - { - return $this->stop('msg_invalid_request'); - } - - if(!Context::get('is_logged')) - { - return $this->stop('msg_not_logged'); - } - - $columnList = array('message_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date'); - $output = $oCommunicationModel->getReadedMessages('N', $columnList); - - // set a template file - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('message_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('messages'); - } - /** * Display message sending * @return void|Object (void : success, Object : fail) diff --git a/modules/communication/conf/module.xml b/modules/communication/conf/module.xml index 6b1553b9c..aa4d13f61 100644 --- a/modules/communication/conf/module.xml +++ b/modules/communication/conf/module.xml @@ -9,7 +9,6 @@ - diff --git a/modules/communication/lang/ko.php b/modules/communication/lang/ko.php index b21a6ddab..f03f29d31 100644 --- a/modules/communication/lang/ko.php +++ b/modules/communication/lang/ko.php @@ -8,6 +8,7 @@ $lang->allow_message_type['F'] = '친구만 허용'; $lang->message_box['R'] = '받은 쪽지함'; $lang->message_box['S'] = '보낸 쪽지함'; $lang->message_box['T'] = '보관함'; +$lang->message_box['N'] = '읽지 않은 쪽지함'; $lang->readed_date = '읽은 시간'; $lang->sender = '보낸이'; $lang->receiver = '받는이'; @@ -19,7 +20,6 @@ $lang->cmd_view_friend = '친구 보기'; $lang->cmd_add_friend = '친구 등록'; $lang->cmd_message_box = '쪽지함'; $lang->cmd_view_message_box = '쪽지함 보기'; -$lang->cmd_view_unread_message_box = '읽지않은 쪽지함 보기'; $lang->cmd_store = '보관함 이동'; $lang->cmd_view_selected_frend_group = '선택된 그룹만 보기'; $lang->cmd_add_friend_group = '친구 그룹 생성'; diff --git a/modules/communication/skins/default/messages.html b/modules/communication/skins/default/messages.html index f0c1d9f33..bda1afdfc 100644 --- a/modules/communication/skins/default/messages.html +++ b/modules/communication/skins/default/messages.html @@ -5,7 +5,6 @@
-