mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Fix #1877 allow moving archived messages back to the inbox
This commit is contained in:
parent
8b6e1949b0
commit
afdc450b00
7 changed files with 64 additions and 9 deletions
|
|
@ -261,8 +261,7 @@ class communicationController extends communication
|
|||
}
|
||||
|
||||
/**
|
||||
* store a specific message into the archive
|
||||
* @return void|Object (success : void, fail : Object)
|
||||
* Move a message to the archive.
|
||||
*/
|
||||
function procCommunicationStoreMessage()
|
||||
{
|
||||
|
|
@ -283,7 +282,7 @@ class communicationController extends communication
|
|||
// get the message
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message || $message->message_type != 'R')
|
||||
if(!$message || $message->receiver_srl !== $logged_info->member_srl || $message->message_type != 'R')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
|
@ -297,7 +296,47 @@ class communicationController extends communication
|
|||
return $output;
|
||||
}
|
||||
$this->updateFlagFile($logged_info->member_srl);
|
||||
$this->setMessage('success_registed');
|
||||
$this->setMessage('msg_success_moved');
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore an archived message to the inbox.
|
||||
*/
|
||||
function procCommunicationRestoreMessage()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Check variable
|
||||
$message_srl = Context::get('message_srl');
|
||||
if(!$message_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
// get the message
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message || $message->receiver_srl !== $logged_info->member_srl || $message->message_type != 'T')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->message_srl = $message_srl;
|
||||
$args->receiver_srl = $logged_info->member_srl;
|
||||
$args->message_type = 'R';
|
||||
$output = executeQuery('communication.setMessageStored', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
$this->updateFlagFile($logged_info->member_srl);
|
||||
$this->setMessage('msg_success_moved');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<action name="procCommunicationUpdateAllowMessage" type="controller" permission="member" />
|
||||
<action name="procCommunicationSendMessage" type="controller" permission="member" ruleset="sendMessage" />
|
||||
<action name="procCommunicationStoreMessage" type="controller" permission="member" />
|
||||
<action name="procCommunicationRestoreMessage" type="controller" permission="member" />
|
||||
<action name="procCommunicationDeleteMessage" type="controller" permission="member" />
|
||||
<action name="procCommunicationDeleteMessages" type="controller" permission="member" />
|
||||
<action name="procCommunicationAddFriend" type="controller" permission="member" ruleset="addFriend" />
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ $lang->cmd_view_friend = 'Friends';
|
|||
$lang->cmd_add_friend = 'Add Friend';
|
||||
$lang->cmd_message_box = 'Message Box';
|
||||
$lang->cmd_view_message_box = 'Message Box';
|
||||
$lang->cmd_store = 'Save';
|
||||
$lang->cmd_store = 'Move to Archive';
|
||||
$lang->cmd_restore_to_inbox = 'Move to Inbox';
|
||||
$lang->cmd_view_selected_frend_group = 'View only selected group';
|
||||
$lang->cmd_add_friend_group = 'Add Friend Group';
|
||||
$lang->cmd_rename_friend_group = 'Rename Friend Group';
|
||||
|
|
@ -31,6 +32,7 @@ $lang->msg_no_self_friend = 'You cannot add yourself as a friend.';
|
|||
$lang->msg_no_message = 'There is no message.';
|
||||
$lang->msg_cannot_send_to_yourself = 'Cannot send a message to yourself.';
|
||||
$lang->message_received = 'You have a new message.';
|
||||
$lang->msg_success_moved = 'Successfully moved.';
|
||||
$lang->msg_title_is_null = 'Please enter the title of message.';
|
||||
$lang->msg_content_is_null = 'Please enter the content.';
|
||||
$lang->msg_allow_message_to_friend = 'Failed to send a message because the recipient accepts messages from friends only.';
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ $lang->cmd_add_friend = '친구 등록';
|
|||
$lang->cmd_message_box = '쪽지함';
|
||||
$lang->cmd_view_message_box = '쪽지함 보기';
|
||||
$lang->cmd_store = '보관함 이동';
|
||||
$lang->cmd_restore_to_inbox = '받은 쪽지함 이동';
|
||||
$lang->cmd_view_selected_frend_group = '선택된 그룹만 보기';
|
||||
$lang->cmd_add_friend_group = '친구 그룹 생성';
|
||||
$lang->cmd_rename_friend_group = '친구 그룹 이름 변경';
|
||||
|
|
@ -31,6 +32,7 @@ $lang->msg_no_self_friend = '자신을 친구로 등록할 수 없습니다.';
|
|||
$lang->msg_no_message = '쪽지가 없습니다.';
|
||||
$lang->msg_cannot_send_to_yourself = '자기 자신에게 쪽지를 보낼 수 없습니다.';
|
||||
$lang->message_received = '쪽지가 왔습니다.';
|
||||
$lang->msg_success_moved = '이동했습니다.';
|
||||
$lang->msg_title_is_null = '쪽지 제목을 입력해주세요.';
|
||||
$lang->msg_content_is_null = '내용을 입력해주세요.';
|
||||
$lang->msg_allow_message_to_friend = '친구에게만 쪽지 발송을 허용한 사용자라서 쪽지 발송을 하지 못했습니다.';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<table name="member_message" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="message_type" default="T" />
|
||||
<column name="message_type" var="message_type" default="T" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="message_srl" var="message_srl" notnull="notnull" filter="number" />
|
||||
|
|
|
|||
|
|
@ -27,10 +27,20 @@ function completeDeleteMessage(ret_obj) {
|
|||
/* 개별 쪽지 보관 */
|
||||
function doStoreMessage(message_srl) {
|
||||
if(!message_srl) return;
|
||||
var params = { message_srl: message_srl };
|
||||
exec_json('communication.procCommunicationStoreMessage', params, function(data) {
|
||||
alert(data.message);
|
||||
location.href = current_url.setQuery('message_type', 'T');
|
||||
});
|
||||
}
|
||||
|
||||
var params = new Array();
|
||||
params['message_srl'] = message_srl;
|
||||
exec_xml('communication', 'procCommunicationStoreMessage', params, completeStoreMessage);
|
||||
function doRestoreMessage(message_srl) {
|
||||
if(!message_srl) return;
|
||||
var params = { message_srl: message_srl };
|
||||
exec_json('communication.procCommunicationRestoreMessage', params, function(data) {
|
||||
alert(data.message);
|
||||
location.href = current_url.setQuery('message_type', 'R');
|
||||
});
|
||||
}
|
||||
|
||||
function completeStoreMessage(ret_obj) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
<div class="btnArea btn-group" cond="$message" style="margin-bottom:20px">
|
||||
<button class="btn" cond="$message->message_type != 'S' && $message->member_srl != $logged_info->member_srl" type="button" onclick="doSendMessage('{$message->sender_srl}','{$message->message_srl}');">{$lang->cmd_reply_message}</button>
|
||||
<button class="btn" cond="$message->message_type == 'R'" type="button" onclick="doStoreMessage('{$message->message_srl}');">{$lang->cmd_store}</button>
|
||||
<button class="btn" cond="$message->message_type == 'T'" type="button" onclick="doRestoreMessage('{$message->message_srl}');">{$lang->cmd_restore_to_inbox}</button>
|
||||
<button class="btn" type="button" onclick="doDeleteMessage('{$message->message_srl}');">{$lang->cmd_delete}</button>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue