From 1ba07f070998d32d115d90d0d73db2dca59c4690 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 11 Apr 2012 12:52:51 +0000 Subject: Allow mass-removal of addresses from a group (#1487748) --- CHANGELOG | 3 ++- program/js/app.js | 26 ++++++++++++++++++++++++++ program/localization/de_CH/labels.inc | 1 + program/localization/de_DE/labels.inc | 1 + program/localization/en_US/labels.inc | 1 + program/steps/addressbook/groups.inc | 6 ++++-- skins/default/templates/addressbook.html | 1 + skins/larry/addressbook.css | 4 ++-- skins/larry/images/buttons.gif | Bin 13644 -> 14091 bytes skins/larry/images/buttons.png | Bin 33323 -> 34211 bytes skins/larry/mail.css | 4 ++-- skins/larry/styles.css | 6 +++++- skins/larry/templates/addressbook.html | 2 +- skins/larry/ui.js | 2 +- 14 files changed, 47 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 31ab964ed..17375a497 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,8 @@ CHANGELOG Roundcube Webmail =========================== -- Fix removing all folders on import to LDAP addressbook +- Allow mass-removal of addresses from a group (#1487748) +- Fix removing all contacts on import to LDAP addressbook - Fix so "Back" from compose/show doesn't reset search request (#1488238) - Add option to delete messages instead of moving to Trash when in Junk folder (#1486686) - Fix invisible cursor when replying to a html message (#1487073) diff --git a/program/js/app.js b/program/js/app.js index 025a366f1..963049b4e 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4016,6 +4016,10 @@ function rcube_webmail() } } + // if a group is currently selected, and there is at least one contact selected + // thend we can enable the group-remove-selected command + this.enable_command('group-remove-selected', typeof this.env.group != 'undefined' && list.selection.length > 0); + this.enable_command('compose', this.env.group || list.selection.length > 0); this.enable_command('edit', id && writable); this.enable_command('delete', list.selection.length && writable); @@ -4375,6 +4379,28 @@ function rcube_webmail() this.name_input.select().focus(); }; + //remove selected contacts from current active group + this.group_remove_selected = function() + { + ref.http_post('group-delmembers','_cid='+urlencode(this.contact_list.selection) + + '&_source='+urlencode(this.env.source) + + '&_gid='+urlencode(this.env.group)); + }; + + //callback after deleting contact(s) from current group + this.remove_group_contacts = function(props) + { + if('undefined' != typeof this.env.group && (this.env.group === props.gid)){ + var selection = this.contact_list.get_selection(); + for (var n=0; naction == 'group-delmembers') { else $result = $plugin['result']; - if ($result) + if ($result){ $OUTPUT->show_message('contactremovedfromgroup'); - else + $OUTPUT->command('remove_group_contacts',array('source' => $source, 'gid' => $gid)); + }else{ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); + } } } diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html index 4cab511f7..d8b7a3a2d 100644 --- a/skins/default/templates/addressbook.html +++ b/skins/default/templates/addressbook.html @@ -99,6 +99,7 @@