|
|
@ -20,9 +20,9 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$afields = $RCMAIL->config->get('contactlist_fields');
|
|
|
|
$afields = $RCMAIL->config->get('contactlist_fields');
|
|
|
|
$sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
|
|
|
|
$addr_sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
|
|
|
|
$page_size = $RCMAIL->config->get('addressbook_pagesize', $RCMAIL->config->get('pagesize', 50));
|
|
|
|
$page_size = $RCMAIL->config->get('addressbook_pagesize', $RCMAIL->config->get('pagesize', 50));
|
|
|
|
$page = max(1, intval($_GET['_page']));
|
|
|
|
$list_page = max(1, intval($_GET['_page']));
|
|
|
|
|
|
|
|
|
|
|
|
// Use search result
|
|
|
|
// Use search result
|
|
|
|
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) {
|
|
|
|
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) {
|
|
|
@ -42,7 +42,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search
|
|
|
|
|
|
|
|
|
|
|
|
while ($row = $result->next()) {
|
|
|
|
while ($row = $result->next()) {
|
|
|
|
$row['sourceid'] = $s;
|
|
|
|
$row['sourceid'] = $s;
|
|
|
|
$key = rcube_addressbook::compose_contact_key($row, $sort_col);
|
|
|
|
$key = rcube_addressbook::compose_contact_key($row, $addr_sort_col);
|
|
|
|
$records[$key] = $row;
|
|
|
|
$records[$key] = $row;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
unset($result);
|
|
|
|
unset($result);
|
|
|
@ -53,7 +53,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search
|
|
|
|
|
|
|
|
|
|
|
|
// create resultset object
|
|
|
|
// create resultset object
|
|
|
|
$count = count($records);
|
|
|
|
$count = count($records);
|
|
|
|
$first = ($page-1) * $page_size;
|
|
|
|
$first = ($list_page-1) * $page_size;
|
|
|
|
$result = new rcube_result_set($count, $first);
|
|
|
|
$result = new rcube_result_set($count, $first);
|
|
|
|
|
|
|
|
|
|
|
|
// we need only records for current page
|
|
|
|
// we need only records for current page
|
|
|
@ -71,7 +71,7 @@ else {
|
|
|
|
if ($CONTACTS && $CONTACTS->ready) {
|
|
|
|
if ($CONTACTS && $CONTACTS->ready) {
|
|
|
|
// set list properties
|
|
|
|
// set list properties
|
|
|
|
$CONTACTS->set_pagesize($page_size);
|
|
|
|
$CONTACTS->set_pagesize($page_size);
|
|
|
|
$CONTACTS->set_page($page);
|
|
|
|
$CONTACTS->set_page($list_page);
|
|
|
|
|
|
|
|
|
|
|
|
if ($group_id = get_input_value('_gid', RCUBE_INPUT_GPC)) {
|
|
|
|
if ($group_id = get_input_value('_gid', RCUBE_INPUT_GPC)) {
|
|
|
|
$CONTACTS->set_group($group_id);
|
|
|
|
$CONTACTS->set_group($group_id);
|
|
|
|