Changeset 4172 in subversion


Ignore:
Timestamp:
Nov 3, 2010 10:19:48 AM (3 years ago)
Author:
alec
Message:
  • Add missing confirmation/error messages on contact/group/message actions (#1486845)
  • Add 'loading' message on message move/copy/delete/mark actions
Location:
trunk/roundcubemail
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r4169 r4172  
    6161- Support contact's email addresses up to 255 characters long (#1487095) 
    6262- Add option to place replies in the folder of the message being replied to (#1485945) 
     63- Add missing confirmation/error messages on contact/group/message actions (#1486845) 
     64- Add 'loading' message on message move/copy/delete/mark actions 
    6365 
    6466RELEASE 0.4.2 
  • trunk/roundcubemail/program/js/app.js

    r4148 r4172  
    23632363 
    23642364    var a_uids = [], 
     2365      lock = this.display_message(this.get_label('copyingmessage'), 'loading'), 
    23652366      add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : ''); 
    23662367 
     
    23752376 
    23762377    // send request to server 
    2377     this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, false); 
     2378    this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock); 
    23782379  }; 
    23792380 
     
    24262427    } 
    24272428    // if there isn't a defined trash mailbox or we are in it 
    2428     else if (!this.env.trash_mailbox || this.env.mailbox == this.env.trash_mailbox)  
     2429    else if (!this.env.trash_mailbox || this.env.mailbox == this.env.trash_mailbox) 
    24292430      this.permanently_remove_messages(); 
    24302431    // if there is a trash mailbox defined and we're not currently in it 
     
    24572458  this._with_selected_messages = function(action, lock, add_url) 
    24582459  { 
    2459     var a_uids = [], count = 0; 
     2460    var a_uids = [], count = 0, msg; 
    24602461 
    24612462    if (this.env.uid) 
     
    24872488    } 
    24882489 
    2489     // also send search request to get the right messages  
     2490    // also send search request to get the right messages 
    24902491    if (this.env.search_request) 
    24912492      add_url += '&_search='+this.env.search_request; 
     
    25012502 
    25022503    add_url += '&_uid='+this.uids_to_list(a_uids); 
     2504 
     2505    if (!lock) { 
     2506      msg = action == 'moveto' ? 'movingmessage' : 'deletingmessage'; 
     2507      lock = this.display_message(this.get_label(msg), 'loading'); 
     2508    } 
    25032509 
    25042510    // send request to server 
     
    25652571      this.set_message(a_uids[i], 'unread', (flag=='unread' ? true : false)); 
    25662572 
    2567     var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag; 
     2573    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag, 
     2574      lock = this.display_message(this.get_label('markingmessage'), 'loading'); 
    25682575 
    25692576    // also send search request to get the right messages 
     
    25712578      url += '&_search='+this.env.search_request; 
    25722579 
    2573     this.http_post('mark', url); 
     2580    this.http_post('mark', url, lock); 
    25742581 
    25752582    for (var i=0; i<a_uids.length; i++) 
     
    25842591      this.set_message(a_uids[i], 'flagged', (flag=='flagged' ? true : false)); 
    25852592 
    2586     var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag; 
     2593    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag, 
     2594      lock = this.display_message(this.get_label('markingmessage'), 'loading'); 
    25872595 
    25882596    // also send search request to get the right messages 
     
    25902598      url += '&_search='+this.env.search_request; 
    25912599 
    2592     this.http_post('mark', url); 
     2600    this.http_post('mark', url, lock); 
    25932601  }; 
    25942602 
     
    26292637      this.set_message(a_uids[i], 'deleted', false); 
    26302638 
    2631     var url = '_uid='+this.uids_to_list(a_uids)+'&_flag=undelete'; 
     2639    var url = '_uid='+this.uids_to_list(a_uids)+'&_flag=undelete', 
     2640      lock = this.display_message(this.get_label('markingmessage'), 'loading'); 
    26322641 
    26332642    // also send search request to get the right messages 
     
    26352644      url += '&_search='+this.env.search_request; 
    26362645 
    2637     this.http_post('mark', url); 
     2646    this.http_post('mark', url, lock); 
    26382647    return true; 
    26392648  }; 
     
    26722681    } 
    26732682 
    2674     add_url = '&_from='+(this.env.action ? this.env.action : ''); 
     2683    add_url = '&_from='+(this.env.action ? this.env.action : ''), 
     2684      lock = this.display_message(this.get_label('markingmessage'), 'loading'); 
    26752685 
    26762686    // ?? 
     
    26872697      add_url += '&_search='+this.env.search_request; 
    26882698 
    2689     this.http_post('mark', '_uid='+this.uids_to_list(a_uids)+'&_flag=delete'+add_url); 
    2690     return true;   
     2699    this.http_post('mark', '_uid='+this.uids_to_list(a_uids)+'&_flag=delete'+add_url, lock); 
     2700    return true; 
    26912701  }; 
    26922702 
  • trunk/roundcubemail/program/localization/en_US/messages.inc

    r4090 r4172  
    8888$messages['sourceisreadonly'] = 'This address source is read only'; 
    8989$messages['errorsavingcontact'] = 'Could not save the contact address'; 
    90 $messages['movingmessage'] = 'Moving message...'; 
    91 $messages['copyingmessage'] = 'Copying message...'; 
     90$messages['movingmessage'] = 'Moving message(s)...'; 
     91$messages['copyingmessage'] = 'Copying message(s)...'; 
     92$messages['deletingmessage'] = 'Deleting message(s)...'; 
     93$messages['markingmessage'] = 'Marking message(s)...'; 
    9294$messages['receiptsent'] = 'Successfully sent a read receipt'; 
    9395$messages['errorsendingreceipt'] = 'Could not send the receipt'; 
     
    117119$messages['maxgroupmembersreached'] = 'The number of group members exceeds the maximum of $max'; 
    118120$messages['internalerror'] = 'An internal error occured. Please try again'; 
     121$messages['contactdelerror'] = 'Could not delete contact(s)'; 
     122$messages['contactdeleted'] = 'Contact(s) deleted successfully'; 
     123$messages['groupdeleted'] = 'Group deleted successfully'; 
     124$messages['grouprenamed'] = 'Group renamed successfully'; 
     125$messages['groupcreated'] = 'Group created successfully'; 
     126$messages['messagedeleted'] = 'Message(s) deleted successfully'; 
     127$messages['messagemoved'] = 'Message(s) moved successfully'; 
     128$messages['messagecopied'] = 'Message(s) copied successfully'; 
     129$messages['messagemarked'] = 'Message(s) marked successfully'; 
    119130 
    120131?> 
  • trunk/roundcubemail/program/localization/pl_PL/messages.inc

    r4090 r4172  
    122122$messages['movingmessage'] = 'Przenoszenie wiadomości...'; 
    123123$messages['copyingmessage'] = 'Kopiowanie wiadomości...'; 
     124$messages['deletingmessage'] = 'Usuwanie wiadomości...'; 
     125$messages['markingmessage'] = 'Oznaczanie wiadomości...'; 
    124126$messages['receiptsent'] = 'Pomyślnie wysłano potwierdzenie dostarczenia'; 
    125127$messages['errorsendingreceipt'] = 'Nie moÅŒna wysłać potwierdzenia'; 
     
    166168$messages['internalerror'] = 'WystÄ 
    167169pił wewnętrzny błĠ
    168 d systemu. Spróbuj jeszcze raz' 
     170d systemu. Spróbuj jeszcze raz'; 
     171$messages['contactdelerror'] = 'Usuwanie kontaktów nie powiodło się'; 
     172$messages['contactdeleted'] = 'Kontakt(y) został(y) usunięte'; 
     173$messages['groupdeleted'] = 'Grupa została usunięta'; 
     174$messages['grouprenamed'] = 'Nazwa grupy została zmieniona'; 
     175$messages['groupcreated'] = 'Grupa została utworzona'; 
     176$messages['messagedeleted'] = 'Wiadomości zostały usunięte'; 
     177$messages['messagemoved'] = 'Wiadomości zostały przeniesione'; 
     178$messages['messagecopied'] = 'Wiadomości zostały skopiowane'; 
     179$messages['messagemarked'] = 'Wiadomości zostały oznaczone'; 
    169180 
    170181?> 
  • trunk/roundcubemail/program/steps/addressbook/delete.inc

    r4025 r4172  
    2424    preg_match('/^[a-zA-Z0-9\+\/=_-]+(,[a-zA-Z0-9\+\/=_-]+)*$/', $cid) 
    2525) { 
    26   $plugin = $RCMAIL->plugins->exec_hook('contact_delete', array( 
    27     'id' => $cid, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); 
     26    $plugin = $RCMAIL->plugins->exec_hook('contact_delete', array( 
     27        'id' => $cid, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); 
    2828 
    29   $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : $plugin['result']; 
     29    $deleted = !$plugin['abort'] ? $CONTACTS->delete($cid) : $plugin['result']; 
    3030 
    31   if (!$deleted) { 
    32     // send error message 
    33     exit; 
    34   } 
     31    if (!$deleted) { 
     32        $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error'); 
     33        $OUTPUT->command('list_contacts'); 
     34    } 
     35    else { 
     36        $OUTPUT->show_message('contactdeleted', 'confirmation'); 
    3537 
    36   // count contacts for this user 
    37   $result = $CONTACTS->count(); 
     38        // count contacts for this user 
     39        $result = $CONTACTS->count(); 
    3840 
    39   // update message count display 
    40   $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size)); 
    41   $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result->count)); 
     41        // update message count display 
     42        $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size)); 
     43        $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result->count)); 
    4244 
    43   // add new rows from next page (if any) 
    44   $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size); 
    45   if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages) 
    46     rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted)); 
     45        // add new rows from next page (if any) 
     46        $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size); 
     47        if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages) 
     48            rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted)); 
     49    } 
    4750 
    48   // send response 
    49   $OUTPUT->send(); 
     51    // send response 
     52    $OUTPUT->send(); 
    5053} 
    5154 
  • trunk/roundcubemail/program/steps/addressbook/groups.inc

    r4025 r4172  
    3030  if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) { 
    3131    $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source)); 
    32      
     32 
    3333    $CONTACTS->set_group($gid); 
    3434    $num2add = count(explode(',', $plugin['ids'])); 
    35      
     35 
    3636    if (!$plugin['abort']) { 
    3737      if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + $num2add > $maxnum)) { 
     
    4545    } 
    4646 
    47     if ($result)  
     47    if ($result) 
    4848      $OUTPUT->show_message('contactaddedtogroup'); 
    49     else if ($plugin['message']) 
    50       $OUTPUT->show_message($plugin['message'], 'warning'); 
     49    else 
     50      $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 
    5151  } 
    5252} 
     
    5555  if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) { 
    5656    $plugin = $RCMAIL->plugins->exec_hook('group_delmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source)); 
    57      
     57 
    5858    if (!$plugin['abort']) 
    5959      $result = $CONTACTS->remove_from_group($gid, $plugin['ids']); 
     
    6161      $result = $plugin['result']; 
    6262 
    63     if ($result)  
     63    if ($result) 
    6464      $OUTPUT->show_message('contactremovedfromgroup'); 
    65     else if ($plugin['message']) 
    66       $OUTPUT->show_message($plugin['message'], 'warning'); 
     65    else 
     66      $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 
    6767  } 
    6868} 
     
    7777      $created = $plugin['result']; 
    7878  } 
    79    
     79 
    8080  if ($created && $OUTPUT->ajax_call) { 
    81     $created['source'] = $source; 
    82     $OUTPUT->command('insert_contact_group', $created); 
     81    $OUTPUT->show_message('groupcreated', 'confirmation'); 
     82    $OUTPUT->command('insert_contact_group', array('source' => $created)); 
    8383  } 
    8484  else if (!$created) { 
     
    9797  } 
    9898 
    99   if ($newname && $OUTPUT->ajax_call) 
     99  if ($newname && $OUTPUT->ajax_call) { 
     100    $OUTPUT->show_message('grouprenamed', 'confirmation'); 
    100101    $OUTPUT->command('update_contact_group', array('source' => $source, 'id' => $gid, 'name' => $newname)); 
     102  } 
    101103  else if (!$newname) 
    102104    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 
     
    113115  } 
    114116 
    115   if ($deleted) 
     117  if ($deleted) { 
     118    $OUTPUT->show_message('groupdeleted', 'confirmation'); 
    116119    $OUTPUT->command('remove_group_item', array('source' => $source, 'id' => $gid)); 
     120  } 
    117121  else 
    118122    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 
  • trunk/roundcubemail/program/steps/mail/copy.inc

    r3989 r4172  
    3535 
    3636    $copied = $IMAP->copy_message($uids, $target, $mbox); 
    37    
     37 
    3838    if (!$copied) { 
    3939        // send error message 
     
    4141        $OUTPUT->send(); 
    4242        exit; 
     43    } 
     44    else { 
     45        $OUTPUT->show_message('messagecopied', 'confirmation'); 
    4346    } 
    4447 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r4115 r4172  
    132132  if (!$OUTPUT->ajax_call) 
    133133    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 
    134       'movingmessage', 'copyingmessage', 'copy', 'move', 'quota'); 
     134      'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage', 
     135      'copy', 'move', 'quota'); 
    135136 
    136137  $OUTPUT->set_pagetitle(rcmail_localize_foldername($mbox_name)); 
  • trunk/roundcubemail/program/steps/mail/mark.inc

    r4160 r4172  
    5151    $OUTPUT->send(); 
    5252    exit; 
     53  } 
     54  else { 
     55    $OUTPUT->show_message('messagemarked', 'confirmation'); 
    5356  } 
    5457 
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r4084 r4172  
    4444        exit; 
    4545    } 
     46    else { 
     47      $OUTPUT->show_message('messagemoved', 'confirmation'); 
     48    } 
    4649 
    4750    $addrows = true; 
     
    5356 
    5457    $del = $IMAP->delete_message($uids, $mbox); 
    55    
     58 
    5659    if (!$del) { 
    5760        // send error message 
     
    6265        exit; 
    6366    } 
    64      
     67    else { 
     68      $OUTPUT->show_message('messagedeleted', 'confirmation'); 
     69    } 
     70 
    6571    $addrows = true; 
    6672} 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r4127 r4172  
    6767 
    6868  if (!$OUTPUT->ajax_call) 
    69     $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage'); 
     69    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 
     70      'movingmessage', 'deletingmessage'); 
    7071 
    7172  // check for unset disposition notification 
Note: See TracChangeset for help on using the changeset viewer.