Fix bug where max_group_members was ignored when adding a new contact (#1490214)
Also fix list refresh after new contact was added and any group is selected.
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Fix bug where max_group_members was ignored when adding a new contact (#1490214) |
| | | |
| | | RELEASE 1.1-rc |
| | | -------------- |
| | | - Update jQuery to version 2.1.3 |
| | |
| | | if (!src) |
| | | src = this.env.source; |
| | | |
| | | if (refresh) |
| | | group = this.env.group; |
| | | |
| | | if (page && this.current_page == page && src == this.env.source && group == this.env.group) |
| | | return false; |
| | | |
| | |
| | | $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)) && ($counts->count + 1 > $maxnum)) |
| | | $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); |
| | | |
| | | $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']); |
| | | if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum)) { |
| | | // @FIXME: should we remove the contact? |
| | | $msgtext = $RCMAIL->gettext(array('name' => 'maxgroupmembersreached', 'vars' => array('max' => $maxnum))); |
| | | $OUTPUT->command('parent.display_message', $msgtext, 'warning'); |
| | | } |
| | | else { |
| | | $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']); |
| | | } |
| | | } |
| | | } |
| | | |