mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 23:29:31 +01:00
* Addressbook - add filtering by distribution list for organisations
This commit is contained in:
parent
97b7d1f4bc
commit
8b844aff07
@ -886,8 +886,6 @@ class addressbook_ui extends addressbook_bo
|
||||
// Just switched from contact view, update actions
|
||||
$query['actions'] = $this->get_actions($query['col_filter']['tid']);
|
||||
}
|
||||
unset($query['col_filter']['list']); // does not work together
|
||||
$query['no_filter2'] = true; // switch the distribution list selection off
|
||||
|
||||
$query['template'] = $query['grouped_view'] == 'duplicates' ? 'addressbook.index.duplicate_rows' : 'addressbook.index.org_rows';
|
||||
|
||||
@ -910,9 +908,20 @@ class addressbook_ui extends addressbook_bo
|
||||
$query['order'] = 'org_name';
|
||||
}
|
||||
$query['org_view'] = $query['grouped_view'];
|
||||
$rows = parent::organisations($query);
|
||||
// switch the distribution list selection off for ldap
|
||||
if($this->contact_repository != 'sql')
|
||||
{
|
||||
$query['no_filter2'] = true;
|
||||
unset($query['col_filter']['list']); // does not work here
|
||||
}
|
||||
else
|
||||
{
|
||||
$rows = parent::organisations($query);
|
||||
}
|
||||
break;
|
||||
case 'addressbook.index.duplicate_rows':
|
||||
$query['no_filter2'] = true; // switch the distribution list selection off
|
||||
unset($query['col_filter']['list']); // does not work for duplicates
|
||||
$rows = parent::duplicates($query);
|
||||
break;
|
||||
}
|
||||
|
@ -170,6 +170,20 @@ class Sql extends Api\Storage
|
||||
{
|
||||
$filter[] = "org_name != ''";// AND org_name IS NOT NULL";
|
||||
}
|
||||
if (isset($filter['list']))
|
||||
{
|
||||
if ($filter['list'] < 0)
|
||||
{
|
||||
$join .= " JOIN egw_acl ON $this->table_name.account_id=acl_account AND acl_appname='phpgw_group' AND ".
|
||||
$this->db->expression('egw_acl', array('acl_location' => $filter['list']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$join .= " JOIN $this->ab2list_table ON $this->table_name.contact_id=$this->ab2list_table.contact_id AND ".
|
||||
$this->db->expression($this->ab2list_table, array('list_id' => $filter['list']));
|
||||
}
|
||||
unset($filter['list']);
|
||||
}
|
||||
$sort = $param['sort'] == 'DESC' ? 'DESC' : 'ASC';
|
||||
|
||||
list(,$by) = explode(',',$param['org_view']);
|
||||
|
Loading…
Reference in New Issue
Block a user