From 67887f51b8d21b31762b5a66c72ae752e5c53975 Mon Sep 17 00:00:00 2001 From: bnu Date: Tue, 11 Dec 2018 11:18:37 +0900 Subject: [PATCH] =?UTF-8?q?#2341=20=EB=AA=A8=EB=B0=94=EC=9D=BC=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=AA=BD=EC=A7=80=20=EB=8B=B5=EC=9E=A5=EC=97=90=20?= =?UTF-8?q?=EC=9C=84=EC=A7=80=EC=9C=85=20=EC=97=90=EB=94=94=ED=84=B0=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20-=20=EC=AA=BD=EC=A7=80=20=EB=B0=9C?= =?UTF-8?q?=EC=8B=A0=20=ED=9B=84=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communication.controller.php | 11 +++++++--- .../communication/communication.mobile.php | 17 ++++++++++++++ .../m.skins/default/js/communication.js | 22 ++++++++++++++----- .../m.skins/default/send_message.html | 9 ++++---- .../skins/default/send_message.html | 3 ++- 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index 88a04b26ac..7abfd9f848 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -125,6 +125,8 @@ function procCommunicationSendMessage() return $output; } + $message_srl = $output->get('message_srl'); + // send an e-mail if($send_mail == 'Y') { @@ -140,7 +142,7 @@ function procCommunicationSendMessage() if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { - if(Context::get('is_popup') != 'Y') + if(Context::get('is_popup') === 'Y') { global $lang; htmlHeader(); @@ -153,7 +155,7 @@ function procCommunicationSendMessage() else { $this->setMessage('success_sended'); - $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('act', 'dispCommunicationMessages', 'message_type', 'S', 'message_srl', $message_srl); $this->setRedirectUrl($returnUrl); } } @@ -262,7 +264,10 @@ function sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log = $oDB->commit(); - return new BaseObject(0, 'success_sended'); + $result = new BaseObject(0, 'success_sended'); + $result->add('message_srl', $message_srl); + + return $result; } /** diff --git a/modules/communication/communication.mobile.php b/modules/communication/communication.mobile.php index e131da444d..bd5ef2de0c 100644 --- a/modules/communication/communication.mobile.php +++ b/modules/communication/communication.mobile.php @@ -178,7 +178,24 @@ function dispCommunicationSendMessage() return $this->stop('msg_invalid_request'); } + $oEditorModel = getModel('editor'); + $option = new stdClass(); + $option->primary_key_name = 'receiver_srl'; + $option->content_key_name = 'new_content'; + $option->allow_fileupload = FALSE; + $option->enable_autosave = FALSE; + $option->enable_default_component = TRUE; + $option->enable_component = FALSE; + $option->resizable = FALSE; + $option->disable_html = TRUE; + $option->height = 150; + $option->skin = $this->communication_config->editor_skin; + $option->colorset = $this->communication_config->editor_colorset; + $editor = $oEditorModel->getEditor($logged_info->member_srl, $option); + Context::set('receiver_info', $receiver_info); + Context::set('editor', $editor); + $this->setTemplateFile('send_message'); } diff --git a/modules/communication/m.skins/default/js/communication.js b/modules/communication/m.skins/default/js/communication.js index e37272d415..65c0e810b3 100644 --- a/modules/communication/m.skins/default/js/communication.js +++ b/modules/communication/m.skins/default/js/communication.js @@ -13,10 +13,20 @@ function completeDeleteMessage(ret_obj) { location.href = current_url.setQuery('message_srl',''); } -function mergeContents() -{ - var $form = jQuery('#fo_comm'); - var content = $form.find('textarea[name=new_content]').val() + $form.find('input[name=source_content]').val(); - $form.find('input[name=content]').val(content); - $form.submit(); +function mergeContents(data) { + var $form = jQuery('#fo_comm') + var editotSequence = data.editor_sequence || null + var content = '' + var sourceContent = $form.find('input[name=source_content]').val() || '' + + if (editotSequence) { + content = editorGetContent(editotSequence) + } else { + content = $form.find('[name=new_content]').val() + } + + content += sourceContent + + $form.find('input[name=content]').val(content) + $form.submit() } diff --git a/modules/communication/m.skins/default/send_message.html b/modules/communication/m.skins/default/send_message.html index 1b7c1834ca..c3d4f1470d 100644 --- a/modules/communication/m.skins/default/send_message.html +++ b/modules/communication/m.skins/default/send_message.html @@ -9,13 +9,11 @@

{$lang->cmd_send_message}

- - + -
{$lang->cmd_back} - +
diff --git a/modules/communication/skins/default/send_message.html b/modules/communication/skins/default/send_message.html index 1adf2984ee..aabf5cfd23 100644 --- a/modules/communication/skins/default/send_message.html +++ b/modules/communication/skins/default/send_message.html @@ -8,7 +8,8 @@

{$lang->cmd_send_message}

- + +