Skip to content

Commit

Permalink
Fix so group/addressbook selection is retained on page refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Dec 29, 2016
1 parent c9b394b commit 58e63a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CHANGELOG Roundcube Webmail
- Fix adding images to new identity signatures
- Fix rsync error handling in installto.sh script (#5562)
- Fix some advanced search issues with multiple addressbooks (#5572)
- Fix so group/addressbook selection is retained on page refresh

RELEASE 1.2.3
-------------
Expand Down
3 changes: 3 additions & 0 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5585,6 +5585,9 @@ function rcube_webmail()
url._search = this.env.search_request;

this.http_request(this.env.task == 'mail' ? 'list-contacts' : 'list', url, lock);

if (this.env.task != 'mail')
this.update_state({_source: src, _page: page && page > 1 ? page : null, _gid: group});
};

this.list_contacts_clear = function()
Expand Down
10 changes: 7 additions & 3 deletions program/steps/addressbook/func.inc
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,18 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false)
else
$CONTACTS->set_page(isset($_SESSION['page']) ? $_SESSION['page'] : 1);

if (!empty($_REQUEST['_gid']))
$CONTACTS->set_group(rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC));
if (!empty($_REQUEST['_gid'])) {
$group = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC);
$CONTACTS->set_group($group);
}

if (!$init_env)
if (!$init_env) {
return $CONTACTS;
}

$OUTPUT->set_env('readonly', $CONTACTS->readonly);
$OUTPUT->set_env('source', (string) $source);
$OUTPUT->set_env('group', $group);

// reduce/extend $CONTACT_COLTYPES with specification from the current $CONTACT object
if (is_array($CONTACTS->coltypes)) {
Expand Down

0 comments on commit 58e63a6

Please sign in to comment.