forked from extern/egroupware
allow to filter by (not) shared and add groups to shared-with filter
This commit is contained in:
parent
d17f73cd79
commit
f6aad0cd46
@ -348,6 +348,12 @@ class addressbook_ui extends addressbook_bo
|
|||||||
}
|
}
|
||||||
$content['nm']['grouped_view_label'] = $sel_options['grouped_view'][(string) $content['nm']['grouped_view']];
|
$content['nm']['grouped_view_label'] = $sel_options['grouped_view'][(string) $content['nm']['grouped_view']];
|
||||||
|
|
||||||
|
// allow to also filter by (not) shared contacts
|
||||||
|
$sel_options['shared_with'] = [
|
||||||
|
'not' => lang('not shared'),
|
||||||
|
'shared' => lang('shared'),
|
||||||
|
];
|
||||||
|
|
||||||
$this->tmpl->read('addressbook.index');
|
$this->tmpl->read('addressbook.index');
|
||||||
return $this->tmpl->exec('addressbook.addressbook_ui.index',
|
return $this->tmpl->exec('addressbook.addressbook_ui.index',
|
||||||
$content,$sel_options,array(),$preserv);
|
$content,$sel_options,array(),$preserv);
|
||||||
|
@ -379,6 +379,7 @@ no categories selected addressbook de keine Kategorien ausgewählt
|
|||||||
no distribution list addressbook de Keine Verteilerliste
|
no distribution list addressbook de Keine Verteilerliste
|
||||||
no fallback addressbook de Keine Ausweichlösung
|
no fallback addressbook de Keine Ausweichlösung
|
||||||
no vcard addressbook de Keine vCard
|
no vcard addressbook de Keine vCard
|
||||||
|
not shared addressbook de nicht geteilt
|
||||||
number addressbook de Nummer
|
number addressbook de Nummer
|
||||||
number of records to read (%1) addressbook de Anzahl der einzulesenden Datensätze (%1)
|
number of records to read (%1) addressbook de Anzahl der einzulesenden Datensätze (%1)
|
||||||
open %1 crm view addressbook de Öffnet %1 in der CRM-Ansicht
|
open %1 crm view addressbook de Öffnet %1 in der CRM-Ansicht
|
||||||
@ -458,6 +459,7 @@ set full name and file as field in contacts of all users (either all or only emp
|
|||||||
set only full name addressbook de Nur vollen Namen setzen
|
set only full name addressbook de Nur vollen Namen setzen
|
||||||
share into addressbook addressbook de Teilen in Adressbuch
|
share into addressbook addressbook de Teilen in Adressbuch
|
||||||
share writable addressbook de Bearbeitbar teilen
|
share writable addressbook de Bearbeitbar teilen
|
||||||
|
shared addressbook de geteilt
|
||||||
shared by me addressbook de Von mir geteilt
|
shared by me addressbook de Von mir geteilt
|
||||||
shared into addressbook %1 addressbook de geteilt in Adressbuch %1
|
shared into addressbook %1 addressbook de geteilt in Adressbuch %1
|
||||||
shared with addressbook de Geteilt mit
|
shared with addressbook de Geteilt mit
|
||||||
|
@ -379,6 +379,7 @@ no categories selected addressbook en No categories selected
|
|||||||
no distribution list addressbook en No distribution list
|
no distribution list addressbook en No distribution list
|
||||||
no fallback addressbook en No fallback
|
no fallback addressbook en No fallback
|
||||||
no vcard addressbook en No vCard
|
no vcard addressbook en No vCard
|
||||||
|
not shared addressbook en not shared
|
||||||
number addressbook en Number
|
number addressbook en Number
|
||||||
number of records to read (%1) addressbook en Number of records to read (%1)
|
number of records to read (%1) addressbook en Number of records to read (%1)
|
||||||
open %1 crm view addressbook en Open %1 CRM view
|
open %1 crm view addressbook en Open %1 CRM view
|
||||||
@ -458,6 +459,7 @@ set full name and file as field in contacts of all users (either all or only emp
|
|||||||
set only full name addressbook en Set only full name
|
set only full name addressbook en Set only full name
|
||||||
share into addressbook addressbook en Share into addressbook
|
share into addressbook addressbook en Share into addressbook
|
||||||
share writable addressbook en Share writable
|
share writable addressbook en Share writable
|
||||||
|
shared addressbook en shared
|
||||||
shared by me addressbook en Shared by me
|
shared by me addressbook en Shared by me
|
||||||
shared into addressbook %1 addressbook en shared into addressbook %1
|
shared into addressbook %1 addressbook en shared into addressbook %1
|
||||||
shared with addressbook en Shared with
|
shared with addressbook en Shared with
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
<nextmatch-header label="Distribution lists" id="distribution_list"/>
|
<nextmatch-header label="Distribution lists" id="distribution_list"/>
|
||||||
<vbox>
|
<vbox>
|
||||||
<nextmatch-header label="Addressbook" id="owner"/>
|
<nextmatch-header label="Addressbook" id="owner"/>
|
||||||
<nextmatch-accountfilter empty_label="Shared with" id="shared_with"/>
|
<nextmatch-accountfilter empty_label="Shared with" id="shared_with" account_type="both"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
<nextmatch-sortheader label="ID" id="contact_id"/>
|
<nextmatch-sortheader label="ID" id="contact_id"/>
|
||||||
<vbox>
|
<vbox>
|
||||||
|
@ -668,17 +668,29 @@ class Sql extends Api\Storage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// shared with column and filter
|
||||||
if (!is_array($extra_cols)) $extra_cols = $extra_cols ? explode(',',$extra_cols) : array();
|
if (!is_array($extra_cols)) $extra_cols = $extra_cols ? explode(',',$extra_cols) : array();
|
||||||
|
$shared_with = '(SELECT '.$this->db->group_concat('DISTINCT shared_with').' FROM '.self::SHARED_TABLE.
|
||||||
|
' WHERE '.self::SHARED_TABLE.'.contact_id='.$this->table_name.'.contact_id AND shared_deleted IS NULL)';
|
||||||
if (($key = array_search('shared_with', $extra_cols)) !== false)
|
if (($key = array_search('shared_with', $extra_cols)) !== false)
|
||||||
{
|
{
|
||||||
$extra_cols[$key] = '(SELECT '.$this->db->group_concat('DISTINCT shared_with').' FROM '.self::SHARED_TABLE.
|
$extra_cols[$key] = "$shared_with AS shared_with";
|
||||||
' WHERE '.self::SHARED_TABLE.'.contact_id='.$this->table_name.'.contact_id AND shared_deleted IS NULL) AS shared_with';
|
|
||||||
}
|
}
|
||||||
if (!empty($filter['shared_with']))
|
switch ((string)$filter['shared_with'])
|
||||||
{
|
{
|
||||||
$join .= ' JOIN '.self::SHARED_TABLE.' sw ON '.$this->table_name.'.contact_id=sw.contact_id AND sw.'.
|
case '': // filter not set
|
||||||
$this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['shared_with']]).
|
break;
|
||||||
' AND sw.shared_deleted IS NULL';
|
case 'not':
|
||||||
|
$filter[] = $shared_with.' IS NULL';
|
||||||
|
break;
|
||||||
|
case 'shared':
|
||||||
|
$filter[] = $shared_with.' IS NOT NULL';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$join .= ' JOIN '.self::SHARED_TABLE.' sw ON '.$this->table_name.'.contact_id=sw.contact_id AND sw.'.
|
||||||
|
$this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['shared_with']]).
|
||||||
|
' AND sw.shared_deleted IS NULL';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
unset($filter['shared_with']);
|
unset($filter['shared_with']);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user