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}

- + +