alecpl
2010-11-03 c50d8872ced7c09dd9fcf5b3bf460c31e5b0c0ce
- Add missing confirmation/error messages on contact/group/message actions (#1486845)
- Add 'loading' message on message move/copy/delete/mark actions


11 files modified
105 ■■■■ changed files
CHANGELOG 2 ●●●●● patch | view | raw | blame | history
program/js/app.js 30 ●●●●● patch | view | raw | blame | history
program/localization/en_US/messages.inc 15 ●●●● patch | view | raw | blame | history
program/localization/pl_PL/messages.inc 13 ●●●●● patch | view | raw | blame | history
program/steps/addressbook/delete.inc 7 ●●●● patch | view | raw | blame | history
program/steps/addressbook/groups.inc 20 ●●●●● patch | view | raw | blame | history
program/steps/mail/copy.inc 3 ●●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 3 ●●●● patch | view | raw | blame | history
program/steps/mail/mark.inc 3 ●●●●● patch | view | raw | blame | history
program/steps/mail/move_del.inc 6 ●●●●● patch | view | raw | blame | history
program/steps/mail/show.inc 3 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -60,6 +60,8 @@
- Improve performance of message cache status checking with skip_disabled=true
- Support contact's email addresses up to 255 characters long (#1487095)
- Add option to place replies in the folder of the message being replied to (#1485945)
- Add missing confirmation/error messages on contact/group/message actions (#1486845)
- Add 'loading' message on message move/copy/delete/mark actions
RELEASE 0.4.2
-------------
program/js/app.js
@@ -2362,6 +2362,7 @@
      return;
    var a_uids = [],
      lock = this.display_message(this.get_label('copyingmessage'), 'loading'),
      add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
    if (this.env.uid)
@@ -2374,7 +2375,7 @@
    }
    // send request to server
    this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, false);
    this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock);
  };
  // move selected messages to the specified mailbox
@@ -2456,7 +2457,7 @@
  // @private
  this._with_selected_messages = function(action, lock, add_url)
  {
    var a_uids = [], count = 0;
    var a_uids = [], count = 0, msg;
    if (this.env.uid)
      a_uids[0] = this.env.uid;
@@ -2500,6 +2501,11 @@
      this.delete_excessive_thread_rows();
    add_url += '&_uid='+this.uids_to_list(a_uids);
    if (!lock) {
      msg = action == 'moveto' ? 'movingmessage' : 'deletingmessage';
      lock = this.display_message(this.get_label(msg), 'loading');
    }
    // send request to server
    this.http_post(action, '_mbox='+urlencode(this.env.mailbox)+add_url, lock);
@@ -2564,13 +2570,14 @@
    for (var i=0; i<a_uids.length; i++)
      this.set_message(a_uids[i], 'unread', (flag=='unread' ? true : false));
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag;
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag,
      lock = this.display_message(this.get_label('markingmessage'), 'loading');
    // also send search request to get the right messages
    if (this.env.search_request)
      url += '&_search='+this.env.search_request;
    this.http_post('mark', url);
    this.http_post('mark', url, lock);
    for (var i=0; i<a_uids.length; i++)
      this.update_thread_root(a_uids[i], flag);
@@ -2583,13 +2590,14 @@
    for (var i=0; i<a_uids.length; i++)
      this.set_message(a_uids[i], 'flagged', (flag=='flagged' ? true : false));
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag;
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag,
      lock = this.display_message(this.get_label('markingmessage'), 'loading');
    // also send search request to get the right messages
    if (this.env.search_request)
      url += '&_search='+this.env.search_request;
    this.http_post('mark', url);
    this.http_post('mark', url, lock);
  };
  // mark all message rows as deleted/undeleted
@@ -2628,13 +2636,14 @@
    for (var i=0, len=a_uids.length; i<len; i++)
      this.set_message(a_uids[i], 'deleted', false);
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag=undelete';
    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag=undelete',
      lock = this.display_message(this.get_label('markingmessage'), 'loading');
    // also send search request to get the right messages
    if (this.env.search_request)
      url += '&_search='+this.env.search_request;
    this.http_post('mark', url);
    this.http_post('mark', url, lock);
    return true;
  };
@@ -2671,7 +2680,8 @@
        this.delete_excessive_thread_rows();
    }
    add_url = '&_from='+(this.env.action ? this.env.action : '');
    add_url = '&_from='+(this.env.action ? this.env.action : ''),
      lock = this.display_message(this.get_label('markingmessage'), 'loading');
    // ??
    if (r_uids.length)
@@ -2686,7 +2696,7 @@
    if (this.env.search_request)
      add_url += '&_search='+this.env.search_request;
    this.http_post('mark', '_uid='+this.uids_to_list(a_uids)+'&_flag=delete'+add_url);
    this.http_post('mark', '_uid='+this.uids_to_list(a_uids)+'&_flag=delete'+add_url, lock);
    return true;  
  };
program/localization/en_US/messages.inc
@@ -87,8 +87,10 @@
$messages['copyerror'] = 'Could not copy any addresses';
$messages['sourceisreadonly'] = 'This address source is read only';
$messages['errorsavingcontact'] = 'Could not save the contact address';
$messages['movingmessage'] = 'Moving message...';
$messages['copyingmessage'] = 'Copying message...';
$messages['movingmessage'] = 'Moving message(s)...';
$messages['copyingmessage'] = 'Copying message(s)...';
$messages['deletingmessage'] = 'Deleting message(s)...';
$messages['markingmessage'] = 'Marking message(s)...';
$messages['receiptsent'] = 'Successfully sent a read receipt';
$messages['errorsendingreceipt'] = 'Could not send the receipt';
$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
@@ -116,5 +118,14 @@
$messages['toomanyrecipients'] = 'Too many recipients. Reduce the number of recipients to $max.';
$messages['maxgroupmembersreached'] = 'The number of group members exceeds the maximum of $max';
$messages['internalerror'] = 'An internal error occured. Please try again';
$messages['contactdelerror'] = 'Could not delete contact(s)';
$messages['contactdeleted'] = 'Contact(s) deleted successfully';
$messages['groupdeleted'] = 'Group deleted successfully';
$messages['grouprenamed'] = 'Group renamed successfully';
$messages['groupcreated'] = 'Group created successfully';
$messages['messagedeleted'] = 'Message(s) deleted successfully';
$messages['messagemoved'] = 'Message(s) moved successfully';
$messages['messagecopied'] = 'Message(s) copied successfully';
$messages['messagemarked'] = 'Message(s) marked successfully';
?>
program/localization/pl_PL/messages.inc
@@ -94,6 +94,8 @@
$messages['errorsavingcontact'] = 'Nie można było zapisać adresu kontaktu';
$messages['movingmessage'] = 'Przenoszenie wiadomości...';
$messages['copyingmessage'] = 'Kopiowanie wiadomości...';
$messages['deletingmessage'] = 'Usuwanie wiadomości...';
$messages['markingmessage'] = 'Oznaczanie wiadomości...';
$messages['receiptsent'] = 'Pomyślnie wysłano potwierdzenie dostarczenia';
$messages['errorsendingreceipt'] = 'Nie można wysłać potwierdzenia';
$messages['nodeletelastidentity'] = 'Nie można skasować tej tożsamości, ponieważ jest ostatnią.';
@@ -120,6 +122,15 @@
$messages['emailformaterror'] = 'Błędny adres e-mail: $email';
$messages['toomanyrecipients'] = 'Zbyt wielu odbiorców. Zmniejsz ich liczbę do $max.';
$messages['maxgroupmembersreached'] = 'Liczba członków grupy nie może być większa niż $max';
$messages['internalerror'] = 'Wystąpił wewnętrzny błąd systemu. Spróbuj jeszcze raz'
$messages['internalerror'] = 'Wystąpił wewnętrzny błąd systemu. Spróbuj jeszcze raz';
$messages['contactdelerror'] = 'Usuwanie kontaktów nie powiodło się';
$messages['contactdeleted'] = 'Kontakt(y) został(y) usunięte';
$messages['groupdeleted'] = 'Grupa została usunięta';
$messages['grouprenamed'] = 'Nazwa grupy została zmieniona';
$messages['groupcreated'] = 'Grupa została utworzona';
$messages['messagedeleted'] = 'Wiadomości zostały usunięte';
$messages['messagemoved'] = 'Wiadomości zostały przeniesione';
$messages['messagecopied'] = 'Wiadomości zostały skopiowane';
$messages['messagemarked'] = 'Wiadomości zostały oznaczone';
?>
program/steps/addressbook/delete.inc
@@ -29,9 +29,11 @@
  $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : $plugin['result'];
  if (!$deleted) {
    // send error message
    exit;
        $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error');
        $OUTPUT->command('list_contacts');
  }
    else {
        $OUTPUT->show_message('contactdeleted', 'confirmation');
  // count contacts for this user
  $result = $CONTACTS->count();
@@ -44,6 +46,7 @@
  $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size);
  if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages)
    rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted));
    }
  // send response
  $OUTPUT->send();
program/steps/addressbook/groups.inc
@@ -46,8 +46,8 @@
    if ($result) 
      $OUTPUT->show_message('contactaddedtogroup');
    else if ($plugin['message'])
      $OUTPUT->show_message($plugin['message'], 'warning');
    else
      $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
  }
}
@@ -62,8 +62,8 @@
    if ($result) 
      $OUTPUT->show_message('contactremovedfromgroup');
    else if ($plugin['message'])
      $OUTPUT->show_message($plugin['message'], 'warning');
    else
      $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
  }
}
@@ -78,8 +78,8 @@
  }
  
  if ($created && $OUTPUT->ajax_call) {
    $created['source'] = $source;
    $OUTPUT->command('insert_contact_group', $created);
    $OUTPUT->show_message('groupcreated', 'confirmation');
    $OUTPUT->command('insert_contact_group', array('source' => $created));
  }
  else if (!$created) {
    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
@@ -96,8 +96,10 @@
      $newname = $plugin['result'];
  }
  if ($newname && $OUTPUT->ajax_call)
  if ($newname && $OUTPUT->ajax_call) {
    $OUTPUT->show_message('grouprenamed', 'confirmation');
    $OUTPUT->command('update_contact_group', array('source' => $source, 'id' => $gid, 'name' => $newname));
  }
  else if (!$newname)
    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
}
@@ -112,8 +114,10 @@
      $deleted = $plugin['result'];
  }
  if ($deleted)
  if ($deleted) {
    $OUTPUT->show_message('groupdeleted', 'confirmation');
    $OUTPUT->command('remove_group_item', array('source' => $source, 'id' => $gid));
  }
  else
    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
}
program/steps/mail/copy.inc
@@ -40,6 +40,9 @@
        $OUTPUT->show_message('errorcopying', 'error');
        $OUTPUT->send();
        exit;
    }
    else {
        $OUTPUT->show_message('messagecopied', 'confirmation');
    }
    rcmail_send_unread_count($target, true);
program/steps/mail/func.inc
@@ -131,7 +131,8 @@
  if (!$OUTPUT->ajax_call)
    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
      'movingmessage', 'copyingmessage', 'copy', 'move', 'quota');
      'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage',
      'copy', 'move', 'quota');
  $OUTPUT->set_pagetitle(rcmail_localize_foldername($mbox_name));
}
program/steps/mail/mark.inc
@@ -51,6 +51,9 @@
    $OUTPUT->send();
    exit;
  }
  else {
    $OUTPUT->show_message('messagemarked', 'confirmation');
  }
  if ($flag == 'DELETED' && $CONFIG['read_when_deleted'] && !empty($_POST['_ruid'])) {
    $ruids = get_input_value('_ruid', RCUBE_INPUT_POST);
program/steps/mail/move_del.inc
@@ -43,6 +43,9 @@
        $OUTPUT->send();
        exit;
    }
    else {
      $OUTPUT->show_message('messagemoved', 'confirmation');
    }
    $addrows = true;
}
@@ -61,6 +64,9 @@
        $OUTPUT->send();
        exit;
    }
    else {
      $OUTPUT->show_message('messagedeleted', 'confirmation');
    }
    
    $addrows = true;
}
program/steps/mail/show.inc
@@ -66,7 +66,8 @@
    $OUTPUT->set_env('list_post', true);
  if (!$OUTPUT->ajax_call)
    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
      'movingmessage', 'deletingmessage');
  // check for unset disposition notification
  if ($MESSAGE->headers->mdn_to &&