Permalink
Browse files

Added Drafts support (Feature #1326839) (richs)

  • Loading branch information...
thomascube committed Jun 19, 2006
1 parent a8435bd commit 1966c53255495890dd7f25c31bac73d97ecc3291
Showing with 410 additions and 127 deletions.
  1. +4 −0 CHANGELOG
  2. +5 −1 config/main.inc.php.dist
  3. +5 −5 program/include/rcube_imap.inc
  4. +62 −10 program/js/app.js
  5. +2 −0 program/localization/cn/labels.inc
  6. +4 −0 program/localization/cn/messages.inc
  7. +2 −0 program/localization/de_CH/labels.inc
  8. +4 −0 program/localization/de_CH/messages.inc
  9. +2 −0 program/localization/de_DE/labels.inc
  10. +4 −0 program/localization/de_DE/messages.inc
  11. +2 −0 program/localization/el/labels.inc
  12. +4 −0 program/localization/el/messages.inc
  13. +2 −0 program/localization/en_GB/labels.inc
  14. +4 −0 program/localization/en_GB/messages.inc
  15. +2 −1 program/localization/en_US/labels.inc
  16. +4 −0 program/localization/en_US/messages.inc
  17. +2 −0 program/localization/es/labels.inc
  18. +4 −0 program/localization/es/messages.inc
  19. +2 −0 program/localization/fr/labels.inc
  20. +4 −0 program/localization/fr/messages.inc
  21. +2 −0 program/localization/it/labels.inc
  22. +4 −0 program/localization/it/messages.inc
  23. +2 −0 program/localization/ja/labels.inc
  24. +4 −0 program/localization/ja/messages.inc
  25. +2 −0 program/localization/pt_BR/labels.inc
  26. +4 −0 program/localization/pt_BR/messages.inc
  27. +2 −0 program/localization/pt_PT/labels.inc
  28. +4 −0 program/localization/pt_PT/messages.inc
  29. +2 −0 program/localization/ru/labels.inc
  30. +4 −0 program/localization/ru/messages.inc
  31. +112 −17 program/steps/mail/compose.inc
  32. +4 −1 program/steps/mail/func.inc
  33. +125 −90 program/steps/mail/sendmail.inc
  34. BIN skins/default/images/buttons/drafts_act.png
  35. BIN skins/default/images/buttons/drafts_pas.png
  36. BIN skins/default/images/icons/folder-drafts.png
  37. +7 −2 skins/default/mail.css
  38. +8 −0 skins/default/templates/compose.html
View
@@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
+2006/06/19
+----------
+- Added Drafts support (Feature #1326839) (richs)
+
2006/06/02
----------
- Updated Estonian localization and moved from ee to et
View
@@ -117,6 +117,10 @@ $rcmail_config['product_name'] = 'RoundCube Webmail';
// only list folders within this path
$rcmail_config['imap_root'] = '';
+// store draft message is this mailbox
+// leave blank if draft messages should not be stored
+$rcmail_config['drafts_mbox'] = 'Drafts';
+
// store sent message is this mailbox
// leave blank if sent messages should not be stored
$rcmail_config['sent_mbox'] = 'Sent';
@@ -202,4 +206,4 @@ $rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_delet
// end of config file
-?>
+?>
@@ -1840,14 +1840,14 @@ class rcube_imap
return array_merge($a_defaults, $a_out);
}
- function get_id($uid)
+ function get_id($uid, $mbox_name=NULL)
{
- return $this->_uid2id($uid);
+ return $this->_uid2id($uid, $mbox_name);
}
- function get_uid($id)
+ function get_uid($id,$mbox_name=NULL)
{
- return $this->_id2uid($id);
+ return $this->_id2uid($id, $mbox_name);
}
function _uid2id($uid, $mbox_name=NULL)
@@ -2086,4 +2086,4 @@ function quoted_printable_encode($input="", $line_max=76, $space_conv=false)
return trim($output);
}
-?>
+?>
View
@@ -146,6 +146,8 @@ function rcube_webmail()
this.enable_command('add-attachment', 'send-attachment', 'send', true);
if (this.env.spellcheck)
this.enable_command('spellcheck', true);
+ if (this.env.drafts_mailbox)
+ this.enable_command('savedraft', true);
}
if (this.env.messagecount)
@@ -676,7 +678,17 @@ function rcube_webmail()
{
var uid = this.get_single_uid();
if (uid && (!this.env.uid || uid != this.env.uid))
- this.show_message(uid);
+ {
+ if (this.env.mailbox==this.env.drafts_mailbox)
+ {
+ this.set_busy(true);
+ location.href = this.env.comm_path+'&_action=compose&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
+ }
+ else
+ {
+ this.show_message(uid);
+ }
+ }
}
else if (this.task=='addressbook')
{
@@ -833,9 +845,14 @@ function rcube_webmail()
case 'compose':
var url = this.env.comm_path+'&_action=compose';
-
+
+ if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox)
+ {
+ var uid = this.get_single_uid();
+ url += '&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
+ }
// modify url if we're in addressbook
- if (this.task=='addressbook')
+ else if (this.task=='addressbook')
{
url = this.get_task_url('mail', url);
var a_cids = new Array();
@@ -886,6 +903,19 @@ function rcube_webmail()
this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
break;
+ case 'savedraft':
+ if (!this.gui_objects.messageform)
+ break;
+
+ // if saving Drafts is disabled in main.inc.php
+ if (!this.env.drafts_mailbox)
+ break;
+
+ this.set_busy(true, 'savingmessage');
+ var form = this.gui_objects.messageform;
+ form.submit();
+ break;
+
case 'send':
if (!this.gui_objects.messageform)
break;
@@ -896,6 +926,7 @@ function rcube_webmail()
// all checks passed, send message
this.set_busy(true, 'sendingmessage');
var form = this.gui_objects.messageform;
+ form._draft.value='';
form.submit();
break;
@@ -1171,7 +1202,15 @@ function rcube_webmail()
// row was double clicked
if (this.task=='mail' && this.list_rows && this.list_rows[id].clicked && this.in_selection(id))
{
- this.show_message(id);
+ if (this.env.mailbox==this.env.drafts_mailbox)
+ {
+ this.set_busy(true);
+ location.href = this.env.comm_path+'&_action=compose&_draft_uid='+id+'&_mbox='+escape(this.env.mailbox);
+ }
+ else
+ {
+ this.show_message(id);
+ }
return false;
}
else if (this.task=='addressbook')
@@ -1293,8 +1332,18 @@ function rcube_webmail()
// enable/disable commands for message
if (this.task=='mail')
{
- this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
- this.enable_command('delete', 'moveto', this.selection.length>0 ? true : false);
+ if (this.env.mailbox==this.env.drafts_mailbox)
+ {
+ //alert(this.env.mailbox);
+ //this.disable_command('reply', 'reply-all', 'forward', 'print', 'moveto');
+ this.enable_command('show', selected);
+ this.enable_command('delete', this.selection.length>0 ? true : false);
+ }
+ else
+ {
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
+ this.enable_command('delete', 'moveto', this.selection.length>0 ? true : false);
+ }
}
else if (this.task=='addressbook')
{
@@ -1907,12 +1956,15 @@ function rcube_webmail()
var message = input_message ? input_message.value : '';
var sig, p;
+ if (!this.env.identity)
+ this.env.identity = id
+
// remove the 'old' signature
if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
{
sig = this.env.signatures[this.env.identity];
- if (sig.indexOf('-- ')!=0)
- sig = '-- \n'+sig;
+ if (sig.indexOf('--')!=0)
+ sig = '--\n'+sig;
p = message.lastIndexOf(sig);
if (p>=0)
@@ -1923,8 +1975,8 @@ function rcube_webmail()
if (this.env.signatures && this.env.signatures[id])
{
sig = this.env.signatures[id];
- if (sig.indexOf('-- ')!=0)
- sig = '-- \n'+sig;
+ if (sig.indexOf('--')!=0)
+ sig = '--\n'+sig;
message += '\n'+sig;
}
@@ -33,6 +33,7 @@ $labels['addressbook'] = '地址薄';
// mailbox names
$labels['inbox'] = '收件箱';
+$labels['drafts'] = '草稿';
$labels['sent'] = '发件箱';
$labels['trash'] = '垃圾桶';
$labels['drafts'] = '草稿';
@@ -113,6 +114,7 @@ $labels['quota'] = '空间使用';
// message compose
$labels['compose'] = '写新邮件';
+$labels['savemessage'] = '保存这份草稿';
$labels['sendmessage'] = '立刻发送邮件';
$labels['addattachment'] = '添加附件';
@@ -41,6 +41,10 @@ $messages['sendingmessage'] = '正在发送邮件...';
$messages['messagesent'] = '邮件发送成功';
+$messages['savingmessage'] = '挽救消息...';
+
+$messages['messagesaved'] = '消息被保存对草稿';
+
$messages['successfullysaved'] = '保存成功';
$messages['addedsuccessfully'] = '联系信息成功增加到地址薄';
@@ -34,6 +34,7 @@ $labels['addressbook'] = 'Adressbuch';
// mailbox names // E-Mail-Ordnernamen
$labels['inbox'] = 'Posteingang';
+$labels['drafts'] = 'Entwürfe';
$labels['sent'] = 'Gesendet';
$labels['trash'] = 'Gelöscht';
$labels['drafts'] = 'Vorlagen';
@@ -120,6 +121,7 @@ $labels['resetsearch'] = 'Löschen';
// message compose // Nachrichten erstellen
$labels['compose'] = 'Neue Nachricht verfassen';
+$labels['savemessage'] = 'Außer diesem Entwurf';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
@@ -38,6 +38,10 @@ $messages['sendingmessage'] = 'Nachricht wird gesendet...';
$messages['messagesent'] = 'Nachricht erfolgreich gesendet';
+$messages['savingmessage'] = 'Einsparunganzeige...';
+
+$messages['messagesaved'] = 'Anzeige gespeichert zu den Entwürfen';
+
$messages['successfullysaved'] = 'Erfolgreich gespeichert';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt';
@@ -35,6 +35,7 @@ $labels['addressbook'] = 'Adressbuch';
// mailbox names // E-Mail-Ordnernamen
$labels['inbox'] = 'Posteingang';
+$labels['drafts'] = 'Entwürfe';
$labels['sent'] = 'Gesendet';
$labels['trash'] = 'Gelöscht';
$labels['drafts'] = 'Entwürfe';
@@ -121,6 +122,7 @@ $labels['resetsearch'] = 'Löschen';
// message compose // Nachrichten erstellen
$labels['compose'] = 'Neue Nachricht verfassen';
+$labels['savemessage'] = 'Außer diesem Entwurf';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
@@ -40,6 +40,10 @@ $messages['sendingmessage'] = 'Nachricht wird gesendet...';
$messages['messagesent'] = 'Nachricht erfolgreich gesendet';
+$messages['savingmessage'] = 'Einsparunganzeige...';
+
+$messages['messagesaved'] = 'Anzeige gespeichert zu den Entwürfen';
+
$messages['successfullysaved'] = 'Erfolgreich gespeichert';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt';
@@ -34,6 +34,7 @@ $labels['addressbook'] = 'Βιβλίο διευθύνσεων';
// mailbox names
$labels['inbox'] = 'Εισερχόμενα';
+$labels['drafts'] = 'Σχέδια';
$labels['sent'] = 'Απεσταλμένα';
$labels['trash'] = 'Κάδος αχρήστων';
$labels['drafts'] = 'Προσχέδια';
@@ -113,6 +114,7 @@ $labels['unread'] = 'Αδιάβαστα';
// message compose
$labels['compose'] = 'Σύνθεση μηνύματος';
+$labels['savemessage'] = 'Εκτός από αυτό το σχέδιο';
$labels['sendmessage'] = 'Αποστολή του μηνύματος τώρα';
$labels['addattachment'] = 'Επισύναψη αρχείου';
$labels['attachments'] = 'Συνημμένα';
@@ -42,6 +42,10 @@ $messages['sendingmessage'] = 'Αποστολή μηνύματος...';
$messages['messagesent'] = 'Το μήνυμα στάλθηκε επιτυχώς';
+$messages['savingmessage'] = 'Μήνυμα αποταμίευσης...';
+
+$messages['messagesaved'] = 'Μήνυμα που σώζεται στα σχέδια';
+
$messages['successfullysaved'] = 'Αποθηκεύτηκε επιτυχώς';
$messages['addedsuccessfully'] = 'Η επαφή προστέθηκε επιτυχώς στο βιβλίο διευθύνσεων';
@@ -33,6 +33,7 @@ $labels['addressbook'] = 'Address Book';
// mailbox names
$labels['inbox'] = 'Inbox';
+$labels['drafts'] = 'Drafts';
$labels['sent'] = 'Sent';
$labels['trash'] = 'Deleted Items';
$labels['drafts'] = 'Drafts';
@@ -115,6 +116,7 @@ $labels['quota'] = 'Disk usage';
// message compose
$labels['compose'] = 'Compose a message';
+$labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now';
$labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset';
@@ -38,6 +38,10 @@ $messages['loadingdata'] = 'Loading data...';
$messages['messagesent'] = 'Message sent successfully';
+$messages['savingmessage'] = 'Saving message...';
+
+$messages['messagesaved'] = 'Message saved to Drafts';
+
$messages['successfullysaved'] = 'Successfully saved';
$messages['addedsuccessfully'] = 'Contact added successfully to address book';
@@ -33,9 +33,9 @@ $labels['addressbook'] = 'Address Book';
// mailbox names
$labels['inbox'] = 'Inbox';
+$labels['drafts'] = 'Drafts';
$labels['sent'] = 'Sent';
$labels['trash'] = 'Trash';
-$labels['drafts'] = 'Drafts';
$labels['junk'] = 'Junk';
// message listing
@@ -120,6 +120,7 @@ $labels['resetsearch'] = 'Reset search';
// message compose
$labels['compose'] = 'Compose a message';
+$labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now';
$labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset';
@@ -40,6 +40,10 @@ $messages['sendingmessage'] = 'Sending message...';
$messages['messagesent'] = 'Message sent successfully';
+$messages['savingmessage'] = 'Saving message...';
+
+$messages['messagesaved'] = 'Message saved to Drafts';
+
$messages['successfullysaved'] = 'Successfully saved';
$messages['addedsuccessfully'] = 'Contact added successfully to address book';
@@ -37,6 +37,7 @@ $labels['addressbook'] = 'Contactos';
// mailbox names
$labels['inbox'] = 'Entrada';
+$labels['drafts'] = 'Bosquejos';
$labels['sent'] = 'Enviados';
$labels['trash'] = 'Papelera';
$labels['drafts'] = 'Borradores';
@@ -118,6 +119,7 @@ $labels['quota'] = 'Uso de disco';
// message compose
$labels['compose'] = 'Escribir un mensaje';
+$labels['savemessage'] = 'Excepto este bosquejo';
$labels['sendmessage'] = 'Enviar ahora el mensaje';
$labels['addattachment'] = 'Añadir un fichero';
$labels['charset'] = 'Codigo';
@@ -47,6 +47,10 @@ $messages['sendingmessage'] = 'Enviando mensaje...';
$messages['messagesent'] = 'Mensaje enviado correctamente';
+$messages['savingmessage'] = 'Mensaje del ahorro...';
+
+$messages['messagesaved'] = 'Mensaje ahorrado a los bosquejos';
+
$messages['successfullysaved'] = 'guardado correctamente';
$messages['addedsuccessfully'] = 'Contacto añadido correctamente a la libreta de direcciones';
Oops, something went wrong.

0 comments on commit 1966c53

Please sign in to comment.