diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-11-03 12:04:19 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-11-03 12:04:19 +0100 |
commit | cf57b2b130c459a1cc8d374e4c66ec93a81c7223 (patch) | |
tree | 7ee9d6290ccaf6f9960a0e9949d40577ced35105 /program/steps/addressbook | |
parent | 086b153ae274e528e709d179795d0bafd5f382bd (diff) |
Fix count display after inserting a new contact
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r-- | program/steps/addressbook/save.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 887e49827..901ea0190 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -179,18 +179,24 @@ else { $insert_id = $plugin['result']; if ($insert_id) { + $CONTACTS->reset(); + // add new contact to the specified group if ($CONTACTS->groups && $CONTACTS->group_id) { $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array( 'group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source)); + $counts = $CONTACTS->count(); + if (!$plugin['abort']) { - if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum)) + if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($counts->count + 1 > $maxnum)) $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); $CONTACTS->add_to_group($gid, $plugin['ids']); } } + else + $counts = $CONTACTS->count(); if ((string)$source === (string)$orig_source) { // add contact row or jump to the page where it should appear @@ -202,7 +208,7 @@ else { // update record count display $CONTACTS->reset(); - $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text()); + $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts)); } else { // re-set iframe |