Aleksander Machniak
2013-03-26 321d8b06fb32d6fa6bc991f7fbb95d63bdb70390
Refresh current folder in opener window after draft save or message sent (#1488997)
3 files modified
23 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/js/app.js 20 ●●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Refresh current folder in opener window after draft save or message sent (#1488997)
- Fix saving draft just after entering compose window (#1489012)
- Fix javascript error in IE9 when loading form with placeholders into an iframe (#1489008)
- Fix handling of some conditional comment tags in HTML message (#1489004)
program/js/app.js
@@ -3345,6 +3345,14 @@
  this.set_draft_id = function(id)
  {
    var rc;
    if (!this.env.draft_id && id && (rc = this.opener())) {
      // refresh the drafts folder in opener window
      if (rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == this.env.drafts_mailbox)
        rc.command('checkmail');
    }
    this.env.draft_id = id;
    $("input[name='_draft_saveid']").val(id);
  };
@@ -3721,15 +3729,19 @@
    this.env.search_id = null;
  };
  this.sent_successfully = function(type, msg)
  this.sent_successfully = function(type, msg, target)
  {
    this.display_message(msg, type);
    if (this.env.extwin) {
      var opener_rc = this.opener();
      var rc = this.opener();
      this.lock_form(this.gui_objects.messageform);
      if (opener_rc)
        opener_rc.display_message(msg, type);
      if (rc) {
        rc.display_message(msg, type);
        // refresh the folder where sent message was saved
        if (target && rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == target)
          rc.command('checkmail');
      }
      setTimeout(function(){ window.close() }, 1000);
    }
    else {
program/steps/mail/sendmail.inc
@@ -820,6 +820,6 @@
  if ($store_folder && !$saved)
    $OUTPUT->command('sent_successfully', 'error', rcube_label('errorsavingsent'));
  else
    $OUTPUT->command('sent_successfully', 'confirmation', rcube_label('messagesent'));
    $OUTPUT->command('sent_successfully', 'confirmation', rcube_label('messagesent'), $store_target);
  $OUTPUT->send('iframe');
}