mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Mail - Improvements to list display in address search results
Now automatic group lists & created distribution lists limited to 10 each If there are more, this is indicated with ellipsis
This commit is contained in:
parent
228629f93f
commit
8f752fcc03
@ -1072,6 +1072,14 @@ ul.et2_link_string {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.et2_taglist .ms-res-item[data-json*='more_results']:after {
|
||||||
|
content:'…';
|
||||||
|
display: block;
|
||||||
|
font-size: 200%;
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 3ex;
|
||||||
|
margin-top: -1ex;
|
||||||
|
}
|
||||||
/* min-height to fix calculations done while hidden */
|
/* min-height to fix calculations done while hidden */
|
||||||
.et2_taglist, .et2_taglist > div.ms-ctn {
|
.et2_taglist, .et2_taglist > div.ms-ctn {
|
||||||
min-height: 23px;
|
min-height: 23px;
|
||||||
|
@ -3480,28 +3480,10 @@ class mail_compose
|
|||||||
$contacts_obj = new Api\Contacts();
|
$contacts_obj = new Api\Contacts();
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
// Add up to 5 matching mailing lists
|
// Add up to 10 matching mailing lists, and 10 groups
|
||||||
if($include_lists)
|
if($include_lists)
|
||||||
{
|
{
|
||||||
$lists = array_filter(
|
$results += static::get_lists($_searchString, $contacts_obj);
|
||||||
$contacts_obj->get_lists(Acl::READ),
|
|
||||||
function($element) use($_searchString) {
|
|
||||||
return (stripos($element, $_searchString) !== false);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
$list_count = 0;
|
|
||||||
foreach($lists as $key => $list_name)
|
|
||||||
{
|
|
||||||
$results[] = array(
|
|
||||||
'id' => $key,
|
|
||||||
'name' => $list_name,
|
|
||||||
'label' => $list_name,
|
|
||||||
'class' => 'mailinglist',
|
|
||||||
'title' => lang('Mailinglist'),
|
|
||||||
'data' => $key
|
|
||||||
);
|
|
||||||
if($list_count++ > 5) break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && strlen($_searchString)>=$_searchStringLength)
|
if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && strlen($_searchString)>=$_searchStringLength)
|
||||||
@ -3610,6 +3592,48 @@ class mail_compose
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of matching distribution lists when searching for email addresses
|
||||||
|
*
|
||||||
|
* The results are limited to 10 each of group lists and normal lists
|
||||||
|
*
|
||||||
|
* @param String $_searchString
|
||||||
|
* @param Contacts $contacts_obj
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected static function get_lists($_searchString, &$contacts_obj)
|
||||||
|
{
|
||||||
|
$group_lists = array();
|
||||||
|
$manual_lists = array();
|
||||||
|
$lists = array_filter(
|
||||||
|
$contacts_obj->get_lists(Acl::READ),
|
||||||
|
function($element) use($_searchString) {
|
||||||
|
return (stripos($element, $_searchString) !== false);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($lists as $key => $list_name)
|
||||||
|
{
|
||||||
|
$type = $key > 0 ? 'manual' : 'group';
|
||||||
|
$list = array(
|
||||||
|
'id' => $key,
|
||||||
|
'name' => $list_name,
|
||||||
|
'label' => $list_name,
|
||||||
|
'class' => 'mailinglist ' . "{$type}_list",
|
||||||
|
'title' => lang('Mailinglist'),
|
||||||
|
'data' => $key
|
||||||
|
);
|
||||||
|
${"${type}_lists"}[] = $list;
|
||||||
|
}
|
||||||
|
$trim = function($list) {
|
||||||
|
$limit = 10;
|
||||||
|
if(count($list) <= $limit) return $list;
|
||||||
|
$list[$limit-1]['class'].= ' more_results';
|
||||||
|
$list[$limit-1]['title'] .= ' (' . lang('%1 more', count($list) - $limit) . ')';
|
||||||
|
return array_slice($list, 0, $limit);
|
||||||
|
};
|
||||||
|
return array_merge($trim($group_lists), $trim($manual_lists));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Merge the selected contact ID into the document given in $_REQUEST['document']
|
* Merge the selected contact ID into the document given in $_REQUEST['document']
|
||||||
* and send it.
|
* and send it.
|
||||||
|
Loading…
Reference in New Issue
Block a user