summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2009-03-05 21:11:55 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2009-03-11 12:51:51 +0000
commit8fd923e70c08c103a3b9aa644431e4ee8cd0b330 (patch)
treec69344a978609e5b7a92d8de4d30380bfb878bd3 /roundcubemail/program/js
parentbc3c5f3f9922ae33c3f0077b71650ec5749d72dc (diff)
Added functionality to copy messages from one mailbox to another.
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/app.js30
1 files changed, 29 insertions, 1 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 03984427d..fbe1dcd75 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -160,7 +160,7 @@ function rcube_webmail()
if (this.env.action=='show' || this.env.action=='preview')
{
- this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', 'load-headers', true);
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'copyto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', 'load-headers', true);
if (this.env.next_uid)
{
this.enable_command('nextmessage', true);
@@ -725,6 +725,11 @@ function rcube_webmail()
this.copy_contact(null, props);
break;
+ case 'copyto':
+ if (this.task == 'mail')
+ this.copy_messages(props);
+ break;
+
case 'mark':
if (props)
this.mark_message(props);
@@ -1752,6 +1757,29 @@ function rcube_webmail()
this._with_selected_messages('moveto', lock, add_url, (this.env.flag_for_deletion ? false : true));
};
+ // copy selected messages to the specified mailbox
+ this.copy_messages = function(mbox)
+ {
+ // exit if current or no mailbox specified or if selection is empty
+ if (!mbox || mbox == this.env.mailbox || (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length)))
+ return;
+
+ var lock = false;
+ var add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
+
+ // show wait message
+ if (this.env.action=='show')
+ {
+ lock = true;
+ this.set_busy(true, 'copyingmessage');
+ }
+
+ // Hide message command buttons until a message is selected
+ this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', false);
+
+ this._with_selected_messages('copyto', lock, add_url, false);
+ };
+
// delete selected messages from the current mailbox
this.delete_messages = function()
{