summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js26
-rw-r--r--program/localization/de_CH/labels.inc1
-rw-r--r--program/localization/de_DE/labels.inc1
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/addressbook/groups.inc6
5 files changed, 33 insertions, 2 deletions
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; n<selection.length; n++) {
+ id = selection[n];
+ this.contact_list.remove_row(id, (n == selection.length-1));
+ }
+ }
+ }
+
+
+
// handler for keyboard events on the input field
this.add_input_keydown = function(e)
{
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 792fb8dad..7ff3ae782 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -284,6 +284,7 @@ $labels['exportvcards'] = 'Kontakte im vCard-Format exportieren';
$labels['newcontactgroup'] = 'Neue Adressgruppe erstellen';
$labels['grouprename'] = 'Gruppe umbenennen';
$labels['groupdelete'] = 'Gruppe löschen';
+$labels['groupremoveselected'] = 'Gewählte Kontakte aus Gruppe entfernen';
$labels['previouspage'] = 'Eine Seite zurück';
$labels['firstpage'] = 'Erste Seite';
$labels['nextpage'] = 'Nächste Seite';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index bb90aedf2..470af7d7b 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -284,6 +284,7 @@ $labels['exportvcards'] = 'Kontakte im vCard-Format exportieren';
$labels['newcontactgroup'] = 'Neue Kontaktgruppe erstellen';
$labels['grouprename'] = 'Gruppe umbenennen';
$labels['groupdelete'] = 'Gruppe löschen';
+$labels['groupremoveselected'] = 'Gewählte Kontakte aus Gruppe entfernen';
$labels['previouspage'] = 'Seite zurück';
$labels['firstpage'] = 'Erste Seite';
$labels['nextpage'] = 'Nächste Seite';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 4c7120889..277f1a954 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -334,6 +334,7 @@ $labels['exportvcards'] = 'Export contacts in vCard format';
$labels['newcontactgroup'] = 'Create new contact group';
$labels['grouprename'] = 'Rename group';
$labels['groupdelete'] = 'Delete group';
+$labels['groupremoveselected'] = 'Remove selected contacts from group';
$labels['previouspage'] = 'Show previous page';
$labels['firstpage'] = 'Show first page';
diff --git a/program/steps/addressbook/groups.inc b/program/steps/addressbook/groups.inc
index 415cd0766..3bdd89fa7 100644
--- a/program/steps/addressbook/groups.inc
+++ b/program/steps/addressbook/groups.inc
@@ -64,10 +64,12 @@ else if ($RCMAIL->action == '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');
+ }
}
}