summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/groups.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-11-03 14:19:48 +0000
committeralecpl <alec@alec.pl>2010-11-03 14:19:48 +0000
commitc50d8872ced7c09dd9fcf5b3bf460c31e5b0c0ce (patch)
tree33d773910562f4a078e0276e67b85a12a835a7f5 /program/steps/addressbook/groups.inc
parent8f558fc624e4cef86487b9ecc8e4cdfd09cd44dc (diff)
- Add missing confirmation/error messages on contact/group/message actions (#1486845)
- Add 'loading' message on message move/copy/delete/mark actions
Diffstat (limited to 'program/steps/addressbook/groups.inc')
-rw-r--r--program/steps/addressbook/groups.inc32
1 files changed, 18 insertions, 14 deletions
diff --git a/program/steps/addressbook/groups.inc b/program/steps/addressbook/groups.inc
index 66619fa7d..f8bd0d7f2 100644
--- a/program/steps/addressbook/groups.inc
+++ b/program/steps/addressbook/groups.inc
@@ -29,10 +29,10 @@ $source = get_input_value('_source', RCUBE_INPUT_GPC);
if ($RCMAIL->action == 'group-addmembers') {
if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) {
$plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source));
-
+
$CONTACTS->set_group($gid);
$num2add = count(explode(',', $plugin['ids']));
-
+
if (!$plugin['abort']) {
if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + $num2add > $maxnum)) {
$OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
@@ -44,26 +44,26 @@ if ($RCMAIL->action == 'group-addmembers') {
$result = $plugin['result'];
}
- if ($result)
+ 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');
}
}
else if ($RCMAIL->action == 'group-delmembers') {
if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) {
$plugin = $RCMAIL->plugins->exec_hook('group_delmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source));
-
+
if (!$plugin['abort'])
$result = $CONTACTS->remove_from_group($gid, $plugin['ids']);
else
$result = $plugin['result'];
- if ($result)
+ 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');
}
}
@@ -76,10 +76,10 @@ else if ($RCMAIL->action == 'group-create') {
else
$created = $plugin['result'];
}
-
+
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 @@ else if ($RCMAIL->action == 'group-rename') {
$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 @@ else if ($RCMAIL->action == 'group-delete') {
$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');
}