* Addressbook/Mail: new value "Hide groups without email" for preference "Hide user groups as distribution list"

This commit is contained in:
ralf 2024-03-11 11:35:27 +02:00
parent d24ca39d09
commit d7e9a093b7
4 changed files with 20 additions and 6 deletions

View File

@ -163,7 +163,12 @@ class addressbook_hooks
'default'=> '0' 'default'=> '0'
); );
$settings['hide_groups_as_lists'] = array( $settings['hide_groups_as_lists'] = array(
'type' => 'check', 'type' => 'select',
'values' => [
'0' => lang('Include all groups'),
'1' => lang('Hide all groups'),
'2' => lang('Hide groups without email address'),
],
'label' => 'Hide user groups as distribution lists', 'label' => 'Hide user groups as distribution lists',
'name' => 'hide_groups_as_lists', 'name' => 'hide_groups_as_lists',
'help' => 'User groups are automatically shown as distribution lists.', 'help' => 'User groups are automatically shown as distribution lists.',

View File

@ -286,6 +286,8 @@ group %1 addressbook de Gruppe %1
h addressbook de h h addressbook de h
hide accounts from addressbook addressbook de Benutzer im Adressbuch ausblenden hide accounts from addressbook addressbook de Benutzer im Adressbuch ausblenden
hide all accounts addressbook de Zeigt keine Benutzer an hide all accounts addressbook de Zeigt keine Benutzer an
hide all groups addressbook de Alle Gruppen ausblenden
hide groups without email address addressbook de Gruppen ohne EMail Adresse ausblenden
hide user groups as distribution lists addressbook de Benutzergruppen als Verteiler ausblenden hide user groups as distribution lists addressbook de Benutzergruppen als Verteiler ausblenden
hides accounts completly from the adressbook. addressbook de Entfernt die Benutzer komplett aus dem Adressbuch. hides accounts completly from the adressbook. addressbook de Entfernt die Benutzer komplett aus dem Adressbuch.
history logging admin de Verfolgung der Änderungen history logging admin de Verfolgung der Änderungen
@ -319,6 +321,7 @@ importer's personal addressbook de Persönliche Adressbuch des Importierenden
imports contacts into your addressbook from a csv file. csv means 'comma separated values'. however in the options tab you can also choose other seperators. addressbook de Importiert Kontakte aus einer CSV Datei in Ihr Adressbuch. CSV bedeutet Komma getrennte Werte. Sie können in dem Reiter Einstellungen auch ein anderes Trennzeichen wählen. imports contacts into your addressbook from a csv file. csv means 'comma separated values'. however in the options tab you can also choose other seperators. addressbook de Importiert Kontakte aus einer CSV Datei in Ihr Adressbuch. CSV bedeutet Komma getrennte Werte. Sie können in dem Reiter Einstellungen auch ein anderes Trennzeichen wählen.
imports contacts into your addressbook from a vcard file. addressbook de Importiert Kontakte in Ihr Adressbuch von einer vCard-Datei imports contacts into your addressbook from a vcard file. addressbook de Importiert Kontakte in Ihr Adressbuch von einer vCard-Datei
in %1 days (%2) is %3's birthday. addressbook de In %1 Tagen (%2) ist der Geburtstag von %3. in %1 days (%2) is %3's birthday. addressbook de In %1 Tagen (%2) ist der Geburtstag von %3.
include all groups addressbook de Alle Gruppen verwenden
income addressbook de Einkommen income addressbook de Einkommen
infolog addressbook de InfoLog Kontakt infolog addressbook de InfoLog Kontakt
infolog-organisation addressbook de InfoLog Organisation infolog-organisation addressbook de InfoLog Organisation

View File

@ -286,6 +286,8 @@ group %1 addressbook en Group %1
h addressbook en h h addressbook en h
hide accounts from addressbook addressbook en Hide user accounts hide accounts from addressbook addressbook en Hide user accounts
hide all accounts addressbook en Hide all accounts hide all accounts addressbook en Hide all accounts
hide all groups addressbook en Hide all groups
hide groups without email address addressbook en Hide groups without email address
hide user groups as distribution lists addressbook en Hide user groups as distribution lists hide user groups as distribution lists addressbook en Hide user groups as distribution lists
hides accounts completly from the adressbook. addressbook en Hide user accounts completely from the address book. hides accounts completly from the adressbook. addressbook en Hide user accounts completely from the address book.
history logging admin en History logging history logging admin en History logging
@ -319,6 +321,7 @@ importer's personal addressbook en Importer's personal
imports contacts into your addressbook from a csv file. csv means 'comma separated values'. however in the options tab you can also choose other seperators. addressbook en Imports contacts into address book from a CSV File. In the options tab you can choose separators. imports contacts into your addressbook from a csv file. csv means 'comma separated values'. however in the options tab you can also choose other seperators. addressbook en Imports contacts into address book from a CSV File. In the options tab you can choose separators.
imports contacts into your addressbook from a vcard file. addressbook en Imports contacts into your address book from a vCard file. imports contacts into your addressbook from a vcard file. addressbook en Imports contacts into your address book from a vCard file.
in %1 days (%2) is %3's birthday. addressbook en In %1 days (%2) is %3's birthday. in %1 days (%2) is %3's birthday. addressbook en In %1 days (%2) is %3's birthday.
include all groups addressbook en Include all groups
income addressbook en Income income addressbook en Income
infolog addressbook en InfoLog contact infolog addressbook en InfoLog contact
infolog-organisation addressbook en InfoLog organisation infolog-organisation addressbook en InfoLog organisation

View File

@ -1157,10 +1157,10 @@ class Storage
} }
/** /**
* Get the availible distribution lists for a user * Get the available distribution lists for a user
* *
* @param int $required =Api\Acl::READ required rights on the list or multiple rights or'ed together, * @param int $required =Api\Acl::READ required rights on the list or multiple rights or'ed together,
* to return only lists fullfilling all the given rights * to return only lists fulfilling all the given rights
* @param string $extra_labels =null first labels if given (already translated) * @param string $extra_labels =null first labels if given (already translated)
* @return array with id => label pairs or false if backend does not support lists * @return array with id => label pairs or false if backend does not support lists
*/ */
@ -1195,13 +1195,16 @@ class Storage
// add groups for all backends, if accounts addressbook is not hidden & // add groups for all backends, if accounts addressbook is not hidden &
// preference has not turned them off // preference has not turned them off
if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1' && if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] !== '1' &&
$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_groups_as_lists'] == '0') $GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_groups_as_lists'] !== '1')
{ {
foreach($GLOBALS['egw']->accounts->search(array( foreach($GLOBALS['egw']->accounts->search(array(
'type' => 'groups' 'type' => 'groups'
)) as $account_id => $group) )) as $account_id => $group)
{ {
$lists[(string)$account_id] = Api\Accounts::format_username($group['account_lid'], '', '', $account_id); if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_groups_as_lists'] === '0' || !empty($group['account_email']))
{
$lists[(string)$account_id] = Api\Accounts::format_username($group['account_lid'], '', '', $account_id);
}
} }
} }
@ -1209,7 +1212,7 @@ class Storage
} }
/** /**
* Get the availible distribution lists for givens users and groups * Get the available distribution lists for givens users and groups
* *
* @param array $keys column-name => value(s) pairs, eg. array('list_uid'=>$uid) * @param array $keys column-name => value(s) pairs, eg. array('list_uid'=>$uid)
* @param string $member_attr ='contact_uid' null: no members, 'contact_uid', 'contact_id', 'caldav_name' return members as that attribute * @param string $member_attr ='contact_uid' null: no members, 'contact_uid', 'contact_id', 'caldav_name' return members as that attribute