diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index e21b9cf1f7..c138cb1d85 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -192,14 +192,14 @@ class mail_ui 'acceptedTypes' => 'mail', 'icon' => 'move', 'caption' => 'Move to', - 'onExecute' => 'javaScript:mail_move' + 'onExecute' => 'javaScript:app.mail.mail_move' ), 'drop_copy_mail' => array( 'type' => 'drop', 'acceptedTypes' => 'mail', 'icon' => 'copy', 'caption' => 'Copy to', - 'onExecute' => 'javaScript:mail_copy' + 'onExecute' => 'javaScript:app.mail.mail_copy' ), 'drop_cancel' => array( 'caption' => 'Cancel', @@ -1510,7 +1510,7 @@ unset($query['actions']); */ function ajax_setFolderStatus($_folder) { - error_log(__METHOD__.__LINE__.array2string($_folder)); + //error_log(__METHOD__.__LINE__.array2string($_folder)); if ($_folder) { $del = $this->mail_bo->getHierarchyDelimiter(false); @@ -1533,7 +1533,7 @@ unset($query['actions']); } } } - error_log(__METHOD__.__LINE__.array2string($oA)); + //error_log(__METHOD__.__LINE__.array2string($oA)); if ($oA) { $response = egw_json_response::get(); @@ -1673,4 +1673,33 @@ unset($query['actions']); $response = egw_json_response::get(); $response->call('egw_refresh',lang('deleted %1 messages in %2',count($_messageList['msg']),$folder),'mail'); } + + /** + * move messages + * + * @param array _folderName target folder + * @param array _messageList list of UID's + * + * @return xajax response + */ + function ajax_moveMessages($_folderName, $_messageList) + { + if(mail_bo::$debug); error_log(__METHOD__."->".$_folderName.':'.print_r($_messageList,true)); + + } + + /** + * copy messages + * + * @param array _folderName target folder + * @param array _messageList list of UID's + * + * @return xajax response + */ + function ajax_copyMessages($_folderName, $_messageList) + { + if(mail_bo::$debug); error_log(__METHOD__."->".$_folderName.':'.print_r($_messageList,true)); + + } + } diff --git a/mail/js/app.js b/mail/js/app.js index fa9425693a..d66b0dec7b 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -491,13 +491,30 @@ mail_setRowClass: function(_actionObjects,_class) { }, // Tree widget stubs -mail_dragStart: function(action,sender) { - console.log(action,sender); +mail_dragStart: function(action,_senders) { + //console.log(action,_senders); + return $j("
" + _senders.length + " Mails selected
") }, -mail_move: function(action,sender) { - console.log(action,sender); +mail_move: function(_action,_senders,_target) { + //console.log(_action,_senders,_target); + var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5); + var messages = this.mail_getFormData(_senders); + //alert('mail_move('+messages.msg.join(',')+' --> '+target+')'); + // TODO: Write move/copy function which cares about doing the same stuff + // as the "onNodeSelect" function! + var request = new egw_json_request('mail.mail_ui.ajax_moveMessages',[target, messages]); + request.sendRequest(false); + this.mail_refreshMessageGrid() }, -mail_copy: function(action,sender) { - console.log(action,sender); +mail_copy: function(_action,_senders,_target) { + //console.log(_action,_senders,_target); + var target = _action.id == 'drop_copy_mail' ? _target.id : _action.id.substr(5); + var messages = this.mail_getFormData(_senders); + //alert('mail_copy('+messages.msg.join(',')+' --> '+target+')'); + // TODO: Write move/copy function which cares about doing the same stuff + // as the "onNodeSelect" function! + var request = new egw_json_request('mail.mail_ui.ajax_copyMessages',[target, messages]); + request.sendRequest(false); + this.mail_refreshMessageGrid() } });